[Biopython] Issues with BioSQL and BioPython--can't access features and annotation
Peter Cock
p.j.a.cock at googlemail.com
Mon Mar 4 20:59:57 UTC 2013
On Mon, Mar 4, 2013 at 8:52 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> On Mon, Mar 4, 2013 at 8:44 PM, Dan Tomso <dtomso at agbiome.com> wrote:
>> Hi all--
>> New list subscriber here. I'm having an issue using DBSeqRecord objects
>> pulled via BioSQL. Any insight welcome!
>>
>> Hello all-- Running on Ubuntu 12.10 with Python 2.7, latest BioPython and
>> BioSQL.
>>
>> ...
>>
>> However--when I retrieve via 'lookup,' I can only access the id, name, and
>> description for the DBSeqRecords. Annotations and features are supposed to
>> be called on demand, but this crashes things. For example:
>>
>> File "/usr/lib/pymodules/python2.7/Bio/SeqRecord.py", line 595, in __str__
>> lines.append("Number of features: %i" % len(self.features))
>> File "/usr/lib/pymodules/python2.7/BioSQL/BioSeq.py", line 516, in
>> __get_features
>> self._primary_id)
>> File "/usr/lib/pymodules/python2.7/BioSQL/BioSeq.py", line 280, in
>> _retrieve_features
>> feature.location = SeqFeature.FeatureLocation(start, end)
>> File "/usr/lib/pymodules/python2.7/Bio/SeqFeature.py", line 561, in
>> __init__
>> raise TypeError(start)
>> TypeError: 0
>> Any idea what is happening here? Thanks! Dan
>
> Hmm. Do you have the original sequence file loaded into the database?
> If so, we could try and reproduce the problem - that would be the
> easiest way forward. Otherwise you might need to look into the
> start value for the location for that feature (e.g. SQL queries on the
> database, or some debug print statements in the Biopython code).
Based on the trace above, you could be running Biopython 1.60, but
if you were running the current release of Biopython 1.61 you'd get
a slightly more explicit TypeError here when there is something odd
about the start co-ordinate.
Right now my hunch is a low level C int vs long issue, which could
be dependent on the OS and MySQL version, and thus escaped
our testing. If I'm right, this should be an easy fix.
Could you update to Biopython 1.61 (or the latest code from GitHub)
and retest?
Thanks,
Peter
More information about the Biopython
mailing list