# HG changeset patch # User iuc # Date 1593164125 14400 # Node ID 97a43bcbf44d5b61c68fa314b1990ab1b2ba45b5 # Parent bdb752f3c6bbbcb64026425029b235008df3478d "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/progressivemauve commit fc61c9d4850614a6580d25f92e3032dc8edbc10d" diff -r bdb752f3c6bb -r 97a43bcbf44d test-data/1.gff3 --- a/test-data/1.gff3 Thu Feb 07 05:24:24 2019 -0500 +++ b/test-data/1.gff3 Fri Jun 26 05:35:25 2020 -0400 @@ -1,6 +1,6 @@ ##gff-version 3 ##sequence-region karma 1 1 -karma progressiveMauve match 83044 149558 . - . ID=phagey;target=phagey +karma progressiveMauve match 83044 149558 . - . ID=phagey;Target=phagey 61896 118870 + karma progressiveMauve match_part 83044 83053 30.0 + . Parent=phagey karma progressiveMauve match_part 83054 83063 70.0 + . Parent=phagey karma progressiveMauve match_part 83064 83073 30.0 + . Parent=phagey diff -r bdb752f3c6bb -r 97a43bcbf44d xmfa2gff3.py --- a/xmfa2gff3.py Thu Feb 07 05:24:24 2019 -0500 +++ b/xmfa2gff3.py Fri Jun 26 05:35:25 2020 -0400 @@ -16,6 +16,15 @@ log = logging.getLogger(__name__) +# Patch bcbio gff to work around url encoding issue. This is clearly +# sub-optimal but we should transition to the newer library. +def _new_format_keyvals(self, keyvals): + return ";".join(["%s=%s" % (k, ",".join(v)) for (k, v) in sorted(keyvals.items())]) + + +GFF.GFFOutput.GFF3Writer._format_keyvals = _new_format_keyvals + + def parse_xmfa(xmfa): """Simple XMFA parser until https://github.com/biopython/biopython/pull/544 """ @@ -112,7 +121,7 @@ type="match", strand=parent['strand'], qualifiers={ "source": "progressiveMauve", - "target": label_convert.get(other['id'], other['id']), + "Target": " ".join(map(str, [label_convert.get(other['id'], other['id']), other['start'], other['end'], '+' if other['strand'] > 0 else '-'])), "ID": label_convert.get(other['id'], 'xmfa_' + other['rid']) } ) @@ -158,10 +167,10 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='Convert XMFA alignments to gff3', prog='xmfa2gff3') - parser.add_argument('xmfa_file', type=file, help='XMFA File') + parser.add_argument('xmfa_file', type=argparse.FileType('r'), help='XMFA File') parser.add_argument('--window_size', type=int, help='Window size for analysis', default=1000) parser.add_argument('--relative_to', type=str, help='Index of the parent sequence in the MSA', default='1') - parser.add_argument('--sequences', type=file, nargs='+', + parser.add_argument('--sequences', type=argparse.FileType('r'), nargs='+', help='Fasta files (in same order) passed to parent for reconstructing proper IDs') parser.add_argument('--version', action='version', version='%(prog)s 1.0') diff -r bdb752f3c6bb -r 97a43bcbf44d xmfa2gff3.xml --- a/xmfa2gff3.xml Thu Feb 07 05:24:24 2019 -0500 +++ b/xmfa2gff3.xml Fri Jun 26 05:35:25 2020 -0400 @@ -1,5 +1,5 @@ - + macros.xml