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

any(seqnames(location)=="MT") question #60

Closed
tiagochst opened this issue Jul 9, 2021 · 2 comments
Closed

any(seqnames(location)=="MT") question #60

tiagochst opened this issue Jul 9, 2021 · 2 comments

Comments

@tiagochst
Copy link

I just want to double-check this part of the code at OSCA devel - quality control:

is.mito <- any(seqnames(location)=="MT") will give me only a TRUE.

However, I understood this should be a vector or index of features. In that case, this should be
is.mito <- which(seqnames(location)=="MT") ?

Screen Shot 2021-07-09 at 12 50 33 PM

@LTLA
Copy link
Collaborator

LTLA commented Jul 11, 2021

This depends on whether your location is a GRanges or GRangesList. For sce.416b, it's the latter, so the any() function will yield a vector (because the boolean ANY applies within each GRL entry, rather than across GRL entries). If you just have a GRanges, it's more appropriate to do which(); I believe that this is done for some of the other datasets.

Ideally, we would have a representation-agnostic way of getting this kind of vector, regardless of whether the input is a GR or GRL. I proposed this in Bioconductor/GenomicRanges#52 but it looks like there hasn't been much appetite for this.

@tiagochst
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants