[Biopython-dev] sff file
Peter
biopython at maubp.freeserve.co.uk
Mon Oct 26 14:00:32 EDT 2009
On Mon, Oct 26, 2009 at 5:54 PM, Sebastian Bassi
<sbassi at clubdelarazon.org> wrote:
> On Mon, Oct 26, 2009 at 2:16 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
>> If you want a general example, that is a good choice. It is an unmodified file
>> created by the Roche tools containing just 10 random reads. The folder also
>> contains FASTA and QUAL files (with and without trimming), as converted
>> by the Roche tools.
>
> Looks like there is a problem:
>
>>>> from Bio import SeqIO
>>>> fh = open('/home/sbassi/E3MFGYR02_random_10_reads.sff')
Try binary mode - although on my tests it isn't essential on Unix,
it is on Windows.
>>>> for rec in SeqIO.parse(fh,'sff'):
> print rec.id
>
>
> E3MFGYR02JWQ7T
> E3MFGYR02JA6IL
> (... cut ...)
OK, so that looks good.
>>>> for rec in SeqIO.parse(fh,'sff'):
> print rec.seq
>
> Traceback (most recent call last):
> ...
> ValueError: Wrong SFF magic number in header
>
>
> I have 1.52 plus SffIO.py and __init__.py from your branch.
Are you using the same (finished) handle in the second example?
That would be like opening an empty file... I think it is just the
error message that is misleading here.
Peter
More information about the Biopython-dev
mailing list