Skip to content


Subversion checkout URL

You can clone with
Download ZIP


GFF parsing with initial sequence fails #75

benjiec opened this Issue · 2 comments

2 participants


Hi Brad,

I tried to use the GFF parser with initial sequence. I followed the example from the Wiki, and essentially had something like

  def import_sequence_and_gff(self, fasta_fn, gff_fn):
    in_seq_file = fasta_fn
    in_seq_handle = open(fasta_fn)
    seq_dict = SeqIO.to_dict(SeqIO.parse(in_seq_handle, "fasta"))

    in_file = gff_fn
    in_handle = open(in_file)
    for rec in GFF.parse(in_handle, base_dict=seq_dict):
      print rec

But I get this error message

ValueError: Only CompoundLocation gets an operator ('join')

Looking through the stack, it looks like GFF created a SeqFeature with a SeqLocation, and tried to use the 'join' operator, and BioPython only allows CompoundLocation to have operators.

I am not familiar with the details of BioPython and GFF parser, is this a known problem? Is there a work-around?


@chapmanb chapmanb closed this issue from a commit
@chapmanb Provide basic support for new Biopython 1.62 handling of CompoundFeat…
…ures. Still uses deprecated sub_features until sorting out a reasonable place to put GFF attributes. Fixes #75
@chapmanb chapmanb closed this in ddd08a8

Thanks for the problem report. I hadn't fixed the feature location handling in the GFF parser to handle the new CompoundLocations in 1.62. For now I updated a solution that will handle both 1.62 and previous versions, so if you upgrade the GFF parser to 0.3 it should work cleanly. Please let me know if you run into any more issues and thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.