comparison 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
comparison
equal deleted inserted replaced
0:74093fb62bdf 1:bca52822843e
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 import argparse
3 import logging
2 import sys 4 import sys
5
6 from BCBio import GFF
3 from Bio import SeqIO 7 from Bio import SeqIO
4 from Bio.Seq import Seq 8 from Bio.Seq import Seq
9 from Bio.SeqFeature import (
10 FeatureLocation,
11 SeqFeature
12 )
5 from Bio.SeqRecord import SeqRecord 13 from Bio.SeqRecord import SeqRecord
6 from Bio.SeqFeature import SeqFeature, FeatureLocation 14
7 import argparse
8 from BCBio import GFF
9 import logging
10 logging.basicConfig(level=logging.INFO) 15 logging.basicConfig(level=logging.INFO)
11 log = logging.getLogger(__name__) 16 log = logging.getLogger(__name__)
12 17
13 18
14 def parse_xmfa(xmfa): 19 def parse_xmfa(xmfa):
129 for other in others: 134 for other in others:
130 pid = _percent_identity(block_seq, other['seq'][i:i + real_window_size]) 135 pid = _percent_identity(block_seq, other['seq'][i:i + real_window_size])
131 # Ignore 0% identity sequences 136 # Ignore 0% identity sequences
132 if pid == 0: 137 if pid == 0:
133 continue 138 continue
139
140 # Support for Biopython 1.68 and above, which removed sub_features
141 if not hasattr(other['feature'], "sub_features"):
142 other['feature'].sub_features = []
134 other['feature'].sub_features.append( 143 other['feature'].sub_features.append(
135 SeqFeature( 144 SeqFeature(
136 FeatureLocation(real_start, real_end), 145 FeatureLocation(real_start, real_end),
137 type="match_part", strand=strand, 146 type="match_part", strand=strand,
138 qualifiers={ 147 qualifiers={