chapmanb / bcbb

Incubator for useful bioinformatics code, primarily in Python and R

Home Page:http://bcbio.wordpress.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GFF parsing stopped working on system upgrade - biopython error

patena opened this issue · comments

I upgraded my system from Xubuntu 12.10 to 14.04, and GFF parsing stopped working.

I get this error:

>>> from BCBio import GFF
>>> with open('gff_test.gff3') as INFILE:
...     for chromosome_record in GFF.parse(INFILE):
...         print len(chromosome_record.features)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python2.7/dist-packages/bcbio-0.1-py2.7.egg/BCBio/GFF/GFFParser.py", line 709, in parse
    target_lines):
  File "/usr/local/lib/python2.7/dist-packages/bcbio-0.1-py2.7.egg/BCBio/GFF/GFFParser.py", line 304, in parse_in_parts
    cur_dict = self._results_to_features(cur_dict, results)
  File "/usr/local/lib/python2.7/dist-packages/bcbio-0.1-py2.7.egg/BCBio/GFF/GFFParser.py", line 344, in _results_to_features
    results.get('child', []))
  File "/usr/local/lib/python2.7/dist-packages/bcbio-0.1-py2.7.egg/BCBio/GFF/GFFParser.py", line 402, in _add_parent_child_features
    children)
  File "/usr/local/lib/python2.7/dist-packages/bcbio-0.1-py2.7.egg/BCBio/GFF/GFFParser.py", line 447, in _add_children_to_parent
    cur_parent.location_operator = "join"
  File "/usr/local/lib/python2.7/dist-packages/Bio/SeqFeature.py", line 247, in _set_location_operator
    raise ValueError("Only CompoundLocation gets an operator (%r)" % value)
ValueError: Only CompoundLocation gets an operator ('join')

The file I'm using is this extremely simple one (and I get the same error on real files from Phytozome that used to parse fine):

chrA    test    gene    101 700 .   +   .   ID=gene1;Name=gene1;
chrA    test    mRNA    101 700 .   +   .   ID=PAC:gene1_mRNA;Name=gene1.t1.2;pacid=gene1_mRNA;Parent=gene1

I tried reinstalling BCBio (now on version 0.1) and Biopython (1.64), it didn't help.
Is this something I should submit to biopython rather than here?

Weronika;
Sorry for the delay in getting back with you. The most recent release of bcbio-gff (0.4) supports newer location models in Biopython so if you upgrade:

pip install --upgrade bcbio-gff

This should work cleanly. Sorry about the issue and hope this fixes it for you.

I had already installed the new release, but I looked around some more now and realized that I also had an old one hanging around for some reason, and python was loading that. Thanks!