This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Use R To Segment Genome And Count Reads From Sequencing Data?

Hi everyone:

I have some whole-genome sequencing data, now I would like to segment human genome (1:22, X,Y) to nonoverlap equal size bins and count reads within it, defining by the location of fire base of one read.

What to do this only through R?

I am trying Rsamtools but didn't get any solution. Could some help me on this?

Thanks

1 answer

In addition to Rsamtools to read your bam file you will need the IRanges package, have a look at the countOverlaps function, and the function successiveIRanges to generate interval bins. If you are experiencing problems, please post a code example to improve.

Log in to answer this question.