-
Notifications
You must be signed in to change notification settings - Fork 14
Correct mitochondrial gene identification. #20
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
base: devel
Are you sure you want to change the base?
Conversation
|
Thanks! I'd like to ensure that we have checks to guard against this in the build |
|
Are you sure? The code here works fine for me in 3.22: library(scRNAseq)
sce.416b <- LunSpikeInData(which="416b")
sce.416b$block <- factor(sce.416b$block)
library(SingleCellExperiment)
# Identifying the mitochondrial transcripts in our SingleCellExperiment.
location <- rowRanges(sce.416b)
is.mito <- any(seqnames(location)=="MT")
summary(is.mito)
## Mode FALSE TRUE
## logical 46567 37 Also works fine on the build system, seeing as how the percentages on the compiled book range from 4.5 to 15.6. |
This should work for both GRanges object and a GRangesList object, if the latter doesn't actually have any hierarchical structure
|
Ok, apologies for the confusion. The current code definitely works with the example data in the book. Where I got into a problem was trying to analyze another dataset. So I went here to see how to actually populate the So the main problem is just the fact that At this point I'm not sure if the change is worth it, since current one doesn't work on |
|
Reminds me of Bioconductor/GenomicRanges#52, actually. |
|
I see, not a new problem. What about something like this: is.mito <- sapply(seqnames(location)=="MT", any)Still works on |
Revert "Switch to gene names" This reverts commit c7ae896.
|
I'll leave your suggestion to the discretion of @PeteHaitch. Though it might also be a good time to nudge @hpages to have a fresh look at Bioconductor/GenomicRanges#60, now that we have a real user running into this problem. |
|
I'll also note here the main drawback I found with the With |
I followed the OSCA introduction and saw that 100% of genes were classified as mitochondrial.
The GRanges accessor
seqnamesreturns afactor-Rleobject andanycollapses it to a singlelogical value, which usually will be TRUE.
Not sure if something changed in GenomicRanges or if
anyhas special behavious for GRangesList objects,but the book shows adding
rowRangesas just a GRanges object. The exact conversion to an indexcan be done differently, and maybe faster, like so
as.logical(seqnames(location)=="MT), but I don'tsee much difference in practice.