This package contains data of allelic expression counts of spatial
slices of a fly embryo, which is a D melanogaster x D
simulans cross. The experiment is a reciprocal cross (see
strain), with three replicates of one parental arrangement
and two of another, which was sufficient to ensure at least one embryo
of each sex for each parental arrangement.
Data was downloaded from GSE102233 as described in the
publication:
Combs PA, Fraser HB (2018) Spatially varying cis-regulatory divergence in Drosophila embryos elucidates cis-regulatory logic. PLOS Genetics 14(11): e1007631. https://doi.org/10.1371/journal.pgen.1007631
The scripts for creating the SummarizedExperiment object can
be found in inst/scripts/make-data.R.
We can find the resource via ExperimentHub:
## Loading required package: BiocGenerics
## Loading required package: generics
##
## Attaching package: 'generics'
## The following objects are masked from 'package:base':
##
## as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
## setequal, union
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## anyDuplicated, aperm, append, as.data.frame, basename, cbind,
## colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
## get, grep, grepl, is.unsorted, lapply, Map, mapply, match, mget,
## order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
## rbind, Reduce, rownames, sapply, saveRDS, table, tapply, unique,
## unsplit, which.max, which.min
## Loading required package: AnnotationHub
## Loading required package: BiocFileCache
## Loading required package: dbplyr
## ExperimentHub with 1 record
## # snapshotDate(): 2026-04-21
## # names(): EH6129
## # package(): spatialDmelxsim
## # $dataprovider: Fraser Lab, Stanford
## # $species: Drosophila melanogaster
## # $rdataclass: RangedSummarizedExperiment
## # $rdatadateadded: 2021-06-16
## # $title: spatialDmelxsim
## # $description: Allelic expression counts of spatial slices of a fly embryo ...
## # $taxonomyid: 7227
## # $genome: dm6
## # $sourcetype: TXT
## # $sourceurl: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE102233
## # $sourcesize: NA
## # $tags: c("allelic", "ASE", "Drosophila_melanogaster_Data", "embryo",
## # "ExpressionData", "GEO", "patterning", "RNASeqData",
## # "SequencingData", "spatial")
## # retrieve record with 'object[["EH6129"]]'
Or load directly with a function defined within this package:
suppressPackageStartupMessages(library(SummarizedExperiment))
library(spatialDmelxsim)
se <- spatialDmelxsim()## see ?spatialDmelxsim and browseVignettes('spatialDmelxsim') for documentation
## downloading 1 resources
## retrieving 1 resource
## loading from cache
The rownames of the SummarizedExperiment are Ensembl IDs. For simplicity of code for plotting individual genes, we will change the rownames to gene symbols (those used in the paper). We check first that all genes have a symbol, because rownames cannot contain an NA.
##
## FALSE
## 13498
Note we use the following annotation of alleles:
Then we calculate the allelic ratio for D simulans allele:
assay(se, "total") <- assay(se, "a1") + assay(se, "a2")
assay(se, "ratio") <- assay(se, "a1") / assay(se, "total")We plot the ratio over the slice, using the normSlice
column of metadata. This is the original slice number,
scaled up to 27 (rep2 had 26 slices and rep4 had 25 slices).
plotGene <- function(gene) {
x <- se$normSlice
y <- assay(se, "ratio")[gene,]
col <- as.integer(se$rep)
plot(x, y, xlab="normSlice", ylab="sim / total ratio",
ylim=c(0,1), main=gene, col=col)
lw <- loess(y ~ x, data=data.frame(x,y=unname(y)))
lines(sort(lw$x), lw$fitted[order(lw$x)], col="red", lwd=2)
abline(h=0.5, col="grey")
}An example of a gene with global bias toward the simulans allele.
Example of some genes with spatial patterning of allelic expression:
Other interesting spatial genes can be found by consulting the Combs
and Fraser (2018) paper, in Supplementary Figure 6 “Complete heatmap of
ASE for genes with svASE.” Other species-specific genes are found in
Supplementary Figure 7 “Genes with species-specific expression,
regardless of parent of origin.” Note that the SF6 spatially varying ASE
genes are labelled in mcols(se)$scASE.
As said above, the file inst/scripts/make-data.R
provides the script that was used to construct the
SummarizedExperiment object from the data available on GEO.
Here are some additional details:
mcols(se)$matchDm557). When compiling
the data I noticed that other genes, where the genomic locations of
dm5.57 and dm6 were not a match, had missing allelic counts. The current
dataset is provided with respect to dm6.mcols(se)$predicted.mcols(se). One is the
SYMBOL that matches the Ensembl gene_id according to
org.Dm.eg.db. The other is the symbol that I obtained from
the per-sample FPKM matrices which have both Ensembl and gene symbols.
The paper_symbol column is therefore better for matching
genes according to their ID in the paper figures.## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 26.04.1 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## time zone: Etc/UTC
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] spatialDmelxsim_1.18.0 SummarizedExperiment_1.42.0
## [3] Biobase_2.72.0 GenomicRanges_1.64.0
## [5] Seqinfo_1.2.0 IRanges_2.46.0
## [7] S4Vectors_0.50.3 MatrixGenerics_1.24.0
## [9] matrixStats_1.5.0 ExperimentHub_3.2.2
## [11] AnnotationHub_4.2.2 BiocFileCache_3.2.0
## [13] dbplyr_2.6.0 BiocGenerics_0.58.1
## [15] generics_0.1.4 BiocStyle_2.40.0
##
## loaded via a namespace (and not attached):
## [1] KEGGREST_1.52.2 xfun_0.61 bslib_0.12.0
## [4] httr2_1.3.0 lattice_0.23-1 vctrs_0.7.3
## [7] tools_4.6.1 curl_8.0.0 tibble_3.3.1
## [10] AnnotationDbi_1.74.0 RSQLite_3.53.3 blob_1.3.0
## [13] pkgconfig_2.0.3 Matrix_1.7-6 lifecycle_1.0.5
## [16] compiler_4.6.1 Biostrings_2.80.2 htmltools_0.5.9
## [19] sys_3.4.3 buildtools_1.0.0 sass_0.4.10
## [22] yaml_2.3.12 pillar_1.11.1 crayon_1.5.3
## [25] jquerylib_0.1.4 DelayedArray_0.38.2 cachem_1.1.0
## [28] abind_1.4-8 tidyselect_1.2.1 digest_0.6.39
## [31] dplyr_1.2.1 purrr_1.2.2 BiocVersion_3.23.1
## [34] maketools_1.3.2 grid_4.6.1 fastmap_1.2.0
## [37] SparseArray_1.12.3 cli_3.6.6 magrittr_2.0.5
## [40] S4Arrays_1.12.1 withr_3.0.3 filelock_1.0.3
## [43] rappdirs_0.3.4 bit64_4.8.6 rmarkdown_2.32
## [46] XVector_0.52.0 httr_1.4.9 bit_4.6.0
## [49] png_0.1-9 memoise_2.0.1 evaluate_1.0.5
## [52] knitr_1.52 rlang_1.3.0 glue_1.8.1
## [55] DBI_1.3.0 BiocManager_1.30.27 jsonlite_2.0.0
## [58] R6_2.6.1