From: Heng Li <lh...@sa...> - 2012-01-31 02:48:33
|
I have never used bam_tell() with bam_write(). I only use bam_tell() with bam_read(). If bam_flush_try() is causing the problem, you may comment out that line. I am afraid that there is no easy solution to allow both bam_tell+bam_write and bam_flush_try(). Heng On Jan 25, 2012, at 10:09 AM, Daehwan Kim wrote: > Hi guys, > > I wrote bam records (bam_write) while storing the locations of those > records (bam_tell). In the second step, when I opened the bam file, I > could not retrieve some records in some case (bam_seek). > > For instance, (1) bgzf_seek is called with "block offset = 65503" (or > "offset" of 67186393055), which is very close to the size of the > uncompressed block 65536 (or 2^16), and then followed by (2) bgzf_read, > which failed to retrieve a bam record. > > I detected this issue in a mixture of bam_write and bam_tell, for > instance, a call to bam_tell returns the block offset of 65503, but the > next call of bam_write writes a bam record onto the next block (as the > new record cannot fit into the current block), so the actual location of > the new record is the new block address and the block offset of 0, which > is not the same as the one I got from the bam_tell function. This is > due to the "bgzf_flush" called in "bam_write1_core" function in bam.c. > > > Thanks, > Daehwan > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Samtools-help mailing list > Sam...@li... > https://lists.sourceforge.net/lists/listinfo/samtools-help -- 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. |