GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
384 stars 137 forks source link

Single-cell tracks and bulk tracks not in the same order #406

Closed MagpiePKU closed 3 years ago

MagpiePKU commented 3 years ago

Hi @jgranja24

Thank you for adding in the single cell fragment plot feature which is extremely handy.

Screen Shot 2020-10-27 at 7 52 26 PM

Originally posted by @jgranja24 in https://github.com/GreenleafLab/ArchR/issues/228#issuecomment-717662407

We tried the feature and there is a little bit of problem that rows are not sorted in the similar order. For example, in the following figure:

image

The peaks are not arranged in the same order as the cells. In fact, the peaks followed the order given in 'useGroups' but the cells seems like to order like in natural character order. Could we modify that? Thanks a lot again.

PS We wonder if we could insert some additional layer like multiple co-accessibility maps one-by-one in the bottom.

Best, Yi

rcorces commented 3 years ago

I'm adding the bug label to this. The panels in these plots should get ordered properly.

jgranja24 commented 3 years ago

This is fixed --


devtools::install_github("GreenleafLab/ArchR", ref="release_1.0.1", repos = BiocManager::repositories())

library(ArchR)
proj <- getTestProject()
proj$DummyClusters <- ArchR:::.splitEvery(proj$cellNames, 150) %>%
    {rep(seq_along(.), unlist(lapply(., length)))} %>%
        paste0("Cluster",.)

p <- plotBrowserTrack(proj, geneSymbol = "CD8A", groupBy = "DummyClusters", 
    plotSummary = c("bulkTrack", "scTrack", "geneTrack"), sizes = c(5,5,1))
plotPDF(p, file = "TestTrack")
Screen Shot 2021-01-24 at 7 24 02 PM