On Mon, Dec 07, 2015 at 06:03:45PM +0100, Claudio Alberti wrote: > it seems that bgzf_seek and bgzf_tell work better even if I get a > crash after about 43000 reads...
"Better" isn't good though if it still crashes. Fundamentally, if you're using bgzf_tell/seek then you have to do all I/O at the bgzf level and never call something on the higher level hts_file API. This means losing some other functionality. What is it you're trying to achieve here? I guess the reason this isn't a problem for most people is that tell/seek isn't that useful for most applications. Yes it offers a way of going to specific file locations, but usually tools want specific genomic locations instead. Eg fetch me all the data for this gene or split by chromosome. These are dealt with using iterators and the bam/cram indices. They're well tested and used by many samtools components, unlike tell/seek which are more internal things. I can see some benefits to the file level slicing too (eg in some parallel processing techniques), so I think it's something we need to get working robustly, but not at top priority right now. James -- James Bonfield (j...@sanger.ac.uk) | Hora aderat briligi. Nunc et Slythia Tova | Plurima gyrabant gymbolitare vabo; A Staden Package developer: | Et Borogovorum mimzebant undique formae, https://sf.net/projects/staden/ | Momiferique omnes exgrabure Rathi. -- 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