Dear Samtools team,
I'm writing a BAM parser by integrating htslib and I need to be able to
tell and seek a BAM file to read back and forth BAM records.
I'm using bam_read1 to sequential read records but sometime I have to go
back and continue from a previous position, so I'm looking for a
tell/seek type API.
I found htell and hseek in hfile.h, but they seem to be not working the
way I expected.
I currently try this to record the cursor position and then come back to
the same record
iCurPos = htell(htsInputFile->fp.bgzf->fp)
...some bam_read1 calls....
hseek(htsInputFile->fp.bgzf->fp, iCurPos, SEEK_SET)
After the hseek call the bam_read1 calls continue reading without going
back to iCurPos.
What am I doing wrong?
Is there any other way to achieve this.
Thanks!
Kind regards,
Claudio
--
Claudio Alberti
----------------------------------------------
EPFL SCI STI MM
ELG 140 (ELG Building)
Station 11
CH-1015 Lausanne - Switzerland
Tel. +41 21 6936869
----------------------------------------------
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Samtools-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/samtools-help