On 8 Dec 2015, at 13:56, Claudio Alberti <claudio.albe...@epfl.ch> wrote:
> 
> It seems that bgfz_seek and bgzf_tell can work as well, do you see any issue 
> with them?

It would be a similar situation to that noted in that September BCF / VCF.GZ 
thread, though you are in a better position due to the legacy existence of a 
bam_read1() that takes a raw BGZF*.

If you open a BGZF file with bgzf_open(), you will be able to read BAM records 
from it with bam_read1() or SAM.GZ records from it with 
bgzf_getline()/sam_parse1().  These operate on the BGZF file handle directly 
(thus without further buffering), so bgzf_seek()/bgzf_tell() will cooperate 
with them.

But you will be out of luck entirely with SAM and CRAM files, as these do not 
have any underlying BGZF structure so can't be opened or read via BGZF routines.

So this is not a general solution, but it may suffice e.g. if for now you are 
only interested in BAM files.  But note also that bam_read1() and 
bgzf_getline() are at the less-supported end of the HTSlib API.

    John

-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

------------------------------------------------------------------------------
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
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to