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

Rstudio crashes at summarizeOverlaps() #22

Open
chuddy-ibk opened this issue Jan 30, 2024 · 1 comment
Open

Rstudio crashes at summarizeOverlaps() #22

chuddy-ibk opened this issue Jan 30, 2024 · 1 comment

Comments

@chuddy-ibk
Copy link

Hi there,

I am trying to use my 42 BAM files (aligned with Subjunc from RSubread package) to prepare a DEXSeqDataSet according to point 2 in the manual (https://bioconductor.org/packages/release/bioc/vignettes/DEXSeq/inst/doc/DEXSeq.html#2_Preparations)

Following would be my script I copied and adjusted from the mentioned link:

txdb = makeTxDbFromGFF("/home/chuddy/bioinformatics/ref_genomes/mouse_38/annotation/ensembl/Mus_musculus.GRCm38.102.gtf.gz")


flattenedAnnotation = exonicParts(txdb, linked.to.single.gene.only = TRUE)
names(flattenedAnnotation) = sprintf("%s:E%0.3d", flattenedAnnotation$gene_id, flattenedAnnotation$exonic_part)

bamFiles <- list.files("../BAM/subjunc/", full.names = T, include.dirs = F, pattern = "\\.BAM$")
bamFiles <- normalizePath(bamFiles) 

bamFiles = BamFileList(bamFiles)

se = summarizeOverlaps(flattenedAnnotation, 
                       bamFiles, 
                       singleEnd=T,
                       ignore.strand=TRUE)

I changed BamFileList(bamFiles) to bamFiles, because we used this function already on the bam files. But also with the original code snippet Rstudio crashed.
Since I have seven condition with each six replicates, I would love to use all BAM files for more complex analyses.
Are there any recommendations how to approach without the need of too much RAM (I have approx 60GB left over)?

Best
Thomas

@NanoCoreUSA
Copy link

You can divide the BAMs into chunks by setting the yieldSize parameter when you create the BamFileList:

bamFiles = BamFileList(bamFiles, yieldSize = 1000000)

Setting it to 1000000 worked for me with 6 files and 32Gb of RAM, but might have to reduce it even further for 42 BAM files.

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