Question: How To Read Bam File Line By Line Using Ruby
1
gravatar for Gangcai
8.4 years ago by
Gangcai230
Berlin Or Shanghai
Gangcai230 wrote:

Dear all, I am trying to read bam file line by line by using ruby scripts. Although there is ruby gem bio-samtools(http://rubygems.org/gems/bio-samtools), I don't find a way to read the whole bam file line by line(can get the alignments for given genomic regions). Any suggestion will be appreciated. BTW,I have used IO.poen("samtools view sample1.bam").each do {|x| ...},however it will put the whole bam file into the memory first.

bam file • 2.1k views
ADD COMMENTlink written 8.4 years ago by Gangcai230
1

Really? At least in C, the whole idea of popen() is NOT to read the whole file into memory.

ADD REPLYlink written 8.4 years ago by lh332k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1559 users visited in the last hour