This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BAM file processing in chunks in R

When I want to process a FASTQ file in chunks in R, I can use the "FastqStreamer" function from the Bioconductor package "ShortRead".

Is there an analogous function for BAM files (for instance, in the "Rsamtools" package)? If so, could you give some toy code?

Many thanks for your help in advance!

r sequencing rna-seq

1 answer

Have you tried to read the entire vignette of Rsamtools? There is a function call scanBam. Take a look at this link.

Alternatively if you already have bam chunks for specific chromosomes which you can obtain by splitting the total bams for each chromosomes and then process with scanBAM. Take a look at this SO link.

Splitting bam files in bash

Split with samtools

Bioconductor For Large Bam File Analysis

Log in to answer this question.