Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotBrowserTrack inconsistent coverage profiles #1555

Closed
Brawni opened this issue Aug 11, 2022 · 8 comments
Closed

plotBrowserTrack inconsistent coverage profiles #1555

Brawni opened this issue Aug 11, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@Brawni
Copy link

Brawni commented Aug 11, 2022

Hello!

I think I remember this being reported before but i cant find it anymore.
I find that running plotBrowserTrack multiple times with same exact data, region and parameters gives me back different coverage profiles. No errors are thrown. Here an example:

ex_cov <- plotBrowserTrack(
    ArchRProj = archp, 
    sizes = c(10, 1.5, 5, 4),
    useGroups = c('TME - Tregs','Tregs'),
    groupBy = metaGroupName, 
    geneSymbol = gene, 
    upstream = 10000,
    downstream = 100000,
    loops = getCoAccessibility (archp, corCutOff = 0.3,
      returnLoops = TRUE),
    pal = paletteDiscrete(unique(archp@cellColData[,metaGroupName]), set='rushmore', reverse=T)
)
plotPDF (ex_cov, ArchRProj = archp, name = paste0(gene,'L_coverage'), width=5, height=2,addDOC = F)

image
image
image
image

Running on ArchR v1.0.2

@Brawni Brawni added the bug Something isn't working label Aug 11, 2022
@rcorces
Copy link
Collaborator

rcorces commented Aug 11, 2022

Hi @Brawni! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.

Before we help you, you must respond to the following questions unless your original post already contained this information:
1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved?
2. Can you recapitulate your error using the tutorial code and dataset? If so, provide a reproducible example.
3. Did you post your log file? If not, add it now.
4. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

@rcorces
Copy link
Collaborator

rcorces commented Aug 11, 2022

#626

set a seed with set.seed() prior to plotting.

@rcorces rcorces closed this as completed Aug 11, 2022
@Brawni
Copy link
Author

Brawni commented Aug 11, 2022

I see. Sorry I missed that! Still chromatin profiles there are quite different from each other, why is the case? is there a subsampling step before generating these pseudo-bulks? How else can you get different profiles if you use same number of cells?

@rcorces
Copy link
Collaborator

rcorces commented Aug 11, 2022

There is an argument maxCells to the non-exported function .groupRegionSumArrows() which limits the total number of cells used for creating the profile. We do not allow users to change this parameter and it is effectively hard-coded at 500. So the randomness is introduced when subsampling cells. I'm open to allowing users to specify this parameter but I dont think it will make a difference in the appearance of the plot and it will just slow things down.

ArchR/R/ArchRBrowser.R

Lines 1056 to 1068 in f6c0388

.groupRegionSumArrows <- function(
ArchRProj = NULL,
useGroups = NULL,
groupBy = NULL,
region = NULL,
tileSize = NULL,
normMethod = NULL,
verbose = FALSE,
minCells = 25,
maxCells = 500,
threads = NULL,
logFile = NULL
){

@Brawni
Copy link
Author

Brawni commented Aug 11, 2022

I see. I think it wouldn't hurt to have it in the frontend function just in case someone wants to use all cells from groups, cause in some instances, like this one, 500 cells dont seem to be representative enough for the groups.

@rcorces
Copy link
Collaborator

rcorces commented Aug 11, 2022

ok. This is now available on dev and will be incorporated into release_1.0.3

@Brawni
Copy link
Author

Brawni commented Aug 11, 2022

Awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants