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!