On Wed, Aug 6, 2014 at 2:19 PM, Wolfgang Maier
<[email protected]> wrote:
> Dear all,
>
> I've been asking this in the pysam user group, but didn't get any
> answers there, so I am giving it one more try here on this bigger list
> (it may well be a samtools api question anyway):

You forgot the link to that discussion:
https://groups.google.com/forum/#!topic/pysam-user-group/HTFch5Ejxd0

> pysam refuses to provide an iterator over reads in sam files that don't
> specify an @SQ sequence dictionary in their header (if you're asking for
> one, it raises - a somewhat misleading - "NotImplementedError: can not
> iterate over samfile without header").
> There seems to be a good reason for this, since if you bypass the error,
> then sometimes (though, interestingly, not with every sam file) the
> Python interpreter crashes immediately when you try to retrieve the
> first read.
>
> I am trying to understand what is going on here and why, so I guess my
> question is:
>
> - is an @SQ entry in the header an absolute technical requirement to
> retrieve reads from a samfile or

No, while SAM files ought to have @SQ lines they can often be
missing (thus useful commands like samtools reheader exist), and
if you had a SAM file of entirely unmapped reads there should be
no @SQ lines at all.

> - is this some kind of limitation of the samtools api or
> - simply a bug in pysam

Probably one of those - I'm not familiar enough with the samtools API
to say which.

Peter

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Samtools-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to