[Biopython] AssertionError
Pierre-Yves
pingou at pingoured.fr
Wed Jul 21 04:47:53 EDT 2010
Hi,
I am running into a problem which I can't figure why.
I parse a fasta file using biopython:
for seq_record in SeqIO.parse(fastafile, "fasta"):
if seq_record.id == name:
print seq_record.id
return seq_record
This seq_record becomes seq and I try to extract only a subpart of the
sequence:
s = Seq(seq.seq[start:stop], generic_dna)
seq_out = SeqRecord(s, id = row[col_name])
Print of start and stop shows me:
251944 253441
which is what I expect.
But the creation of the sequence object fails with the following error:
Traceback (most recent call last):
File "FastaExtractor.py", line 91, in <module>
s = Seq(seq.seq[start:stop], generic_dna)
File "/usr/lib64/python2.6/site-packages/Bio/Seq.py", line 87, in
__init__
type(data) == type(u"")) # but can be a unicode string
AssertionError
When I try to create an object by hand using the python consol, it works
perfectly well.
Any idea what could be wrong ?
Thanks,
Pierre
More information about the Biopython
mailing list