diff xmfa2gff3.py @ 1:bca52822843e draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/progressivemauve commit e0cd7ae10ce97bed51594e7cc0b969a803d698b7
author iuc
date Fri, 07 Sep 2018 11:30:11 -0400
parents 74093fb62bdf
children 97a43bcbf44d
line wrap: on
line diff
--- a/xmfa2gff3.py	Wed Aug 17 14:46:55 2016 -0400
+++ b/xmfa2gff3.py	Fri Sep 07 11:30:11 2018 -0400
@@ -1,12 +1,17 @@
 #!/usr/bin/env python
+import argparse
+import logging
 import sys
+
+from BCBio import GFF
 from Bio import SeqIO
 from Bio.Seq import Seq
+from Bio.SeqFeature import (
+    FeatureLocation,
+    SeqFeature
+)
 from Bio.SeqRecord import SeqRecord
-from Bio.SeqFeature import SeqFeature, FeatureLocation
-import argparse
-from BCBio import GFF
-import logging
+
 logging.basicConfig(level=logging.INFO)
 log = logging.getLogger(__name__)
 
@@ -131,6 +136,10 @@
                 # Ignore 0% identity sequences
                 if pid == 0:
                     continue
+
+                # Support for Biopython 1.68 and above, which removed sub_features
+                if not hasattr(other['feature'], "sub_features"):
+                    other['feature'].sub_features = []
                 other['feature'].sub_features.append(
                     SeqFeature(
                         FeatureLocation(real_start, real_end),