stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
327 stars 88 forks source link

CoveragePlot() No cells present in the requested region error #5

Closed npervola closed 5 years ago

npervola commented 5 years ago

In using CoveragePlot to visualize pseudobulk profiles by cluster, the function is currently unable to find cells in requested regions that are on any double digit chromosomes ( those > chr 9) for mouse mm10 aligned Cell Ranger Processed data. The regions I am trying to plot come from a differential accessibility analysis where I know cells have signal there (can be visualized via VlnPlot or FeaturePlot). The plotting works fine for any regions on chromosomes 1:9, but not the others, so I don't know if its an issue with CoveragePlot or the annotation.

The function call looks like this:

CoveragePlot( object = seurat.signac.object, region = region1, sep = c(":","-"), annotation = EnsDb.Mmusculus.v79, extend.upstream = 5000, extend.downstream = 5000, ncol = 1, idents=c(0,1,2,3) )

My attached packages are as follows:

[1] EnsDb.Mmusculus.v79_2.99.0 ensembldb_2.8.0 AnnotationFilter_1.8.0
[4] GenomicFeatures_1.36.1 AnnotationDbi_1.46.0 Signac_0.1.0
[7] SummarizedExperiment_1.14.0 DelayedArray_0.10.0 BiocParallel_1.17.18
[10] matrixStats_0.54.0 Biobase_2.44.0 GenomicRanges_1.36.0
[13] GenomeInfoDb_1.20.0 IRanges_2.18.1 S4Vectors_0.22.0
[16] BiocGenerics_0.30.0 chromVAR_1.6.0 data.table_1.12.2
[19] dplyr_0.8.1 ggplot2_3.2.0 Seurat_3.0.2

timoast commented 5 years ago

In the mouse vignette we plot chromosomes >9 using CoveragePlot, which is also 10x data mapped to mm10, so I'm surprised this doesn't work.

Are you able to reproduce the mouse brain vignette this using the dataset from 10x (downloadable here), to verify first that that gives the expected result for you?

npervola commented 5 years ago

I was able to reproduce the mouse brain vignette and get the expected results, including plotting in those regions on the chromosomes in questions. I also checked some specific sites that hadn't worked in my own analysis and they worked as well. I reran my own dataset exactly as the brain one is processed, and continued to have the same issue. It may be important to note that this is a dataset that has been aggregated using cell ranger functionality as well, and is on the order of ~20,000 cells. Could it be some issue in indexing the fragments file for these specific chromosomes? The file is very large, although it gives me the error almost immediately when running the CoveragePlot() function.

timoast commented 5 years ago

Ok this likely has something to do with running CellRanger aggr, are you able to send me the Seurat object and the fragments file so I can debug this further? You can email it to tstuart@nygenome.org

npervola commented 5 years ago

Thank you. I have emailed the object, the fragments file, and its index to you. Let me know if you'd need any other info from me.

timoast commented 5 years ago

Got it, thanks. Taking a look now

timoast commented 5 years ago

This turned out to be an issue with the Rsamtools package on Windows. I've opened an issue with Rsamtools (https://github.com/Bioconductor/Rsamtools/issues/8) and will close this issue now