Repository 'progressivemauve'
hg clone https://testtoolshed.g2.bx.psu.edu/repos/iuc/progressivemauve

Changeset 15:7ea1fa36f3f4 (2020-06-26)
Previous changeset 14:3055fcee9129 (2019-02-07) Next changeset 16:a2254971af93 (2021-10-13)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/progressivemauve commit fc61c9d4850614a6580d25f92e3032dc8edbc10d"
modified:
test-data/1.gff3
xmfa2gff3.py
xmfa2gff3.xml
b
diff -r 3055fcee9129 -r 7ea1fa36f3f4 test-data/1.gff3
--- a/test-data/1.gff3 Thu Feb 07 05:23:57 2019 -0500
+++ b/test-data/1.gff3 Fri Jun 26 09:35:00 2020 +0000
b
@@ -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
b
diff -r 3055fcee9129 -r 7ea1fa36f3f4 xmfa2gff3.py
--- a/xmfa2gff3.py Thu Feb 07 05:23:57 2019 -0500
+++ b/xmfa2gff3.py Fri Jun 26 09:35:00 2020 +0000
[
@@ -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')
 
b
diff -r 3055fcee9129 -r 7ea1fa36f3f4 xmfa2gff3.xml
--- a/xmfa2gff3.xml Thu Feb 07 05:23:57 2019 -0500
+++ b/xmfa2gff3.xml Fri Jun 26 09:35:00 2020 +0000
b
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tool id="xmfa2gff3" name="Convert XMFA to gapped GFF3" version="@WRAPPER_VERSION@.0">
+<tool id="xmfa2gff3" name="Convert XMFA to gapped GFF3" version="@WRAPPER_VERSION@.1">
   <description></description>
   <macros>
     <import>macros.xml</import>