Difficulty filtering non-standard chromosomes #1252
Unanswered
dustin-mullaney
asked this question in
Q&A
Replies: 1 comment
-
In case someone else stumbles on this question, here's how I filtered out peaks on non-standard chromosomes in Seurat object: main.chroms <- standardChromosomes(BSgenome.Mmusculus.UCSC.mm10)
keep.peaks <- rownames(seurat)[lapply(strsplit(rownames(seurat), '-'), `[[`, 1) %in% main.chroms]
seurat <- subset(seurat, features = keep.peaks) And how to filter the genome on non-standard chromosomes: # from https://support.bioconductor.org/p/83588/
keepBSgenomeSequences <- function(genome, seqnames)
{
stopifnot(all(seqnames %in% seqnames(genome)))
genome@user_seqnames <- setNames(seqnames, seqnames)
genome@seqinfo <- genome@seqinfo[seqnames]
genome
}
# main.chroms <- standardChromosomes(BSgenome.Mmusculus.UCSC.mm10)
filtered_genome <- keepBSgenomeSequences(BSgenome.Mmusculus.UCSC.mm10, main.chroms)
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am attempting to use the LinkPeaks() function, but I am having trouble getting it to work. I am working with 10x atac data that was aligned with hg38. I use the following code to create the chromatin assay:
I did not use Macs2 to call the peaks .
When I run RegionStats() before LinkPeaks() (after all the standard data processing) I get the following error:
Going off of this post, I assume I need to use keepStandardChromosomes() to filter the peaks in non-standard chromosomes. However what I have tried so far hasn't solved my issue. I tried running:
Should I instead be using keepStandardChromosomes() elsewhere in the code?
Any suggestions are appreciated!
Beta Was this translation helpful? Give feedback.
All reactions