changeset 1:3616b6eda1da draft

"planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/match_plasmid_to_reference commit dcdac86bce5c44043516fbd472ab7c19d7bf4d50-dirty"
author dfornika
date Wed, 06 Nov 2019 00:42:05 -0500
parents 8bb674372911
children faf74a1bbd5f
files match_plasmid_to_reference.py match_plasmid_to_reference.xml
diffstat 2 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/match_plasmid_to_reference.py	Wed Nov 06 00:08:43 2019 -0500
+++ b/match_plasmid_to_reference.py	Wed Nov 06 00:42:05 2019 -0500
@@ -65,18 +65,22 @@
             if line.startswith('ACCESSION'):
                 return line.strip().split()[1]
 
-            
 
 def count_contigs(plasmid_fasta_path):
     contigs = 0
     with open(plasmid_fasta_path, 'r') as f:
-        contigs = 2
+        for line in f:
+            if line.startswith('>'):
+                contigs += 1
     return contigs
 
 def count_bases(plasmid_fasta_path):
     bases = 0
     with open(plasmid_fasta_path, 'r') as f:
-        bases = 11117
+        for line in f:
+            line = line.strip()
+            if not line.startswith('>'):
+                bases += len(line)
     return bases
 
 def main(args):
--- a/match_plasmid_to_reference.xml	Wed Nov 06 00:08:43 2019 -0500
+++ b/match_plasmid_to_reference.xml	Wed Nov 06 00:42:05 2019 -0500
@@ -19,10 +19,23 @@
     </inputs>
     <outputs>
         <data name="plasmid" from_work_dir="outdir/plasmid.fasta" />
-        <data name="reference_plasmid" from_work_dir="outdir/reference_plasmid.gbk" />
+        <data name="matched_reference_plasmid" from_work_dir="outdir/reference_plasmid.gbk" />
 	<data name="matched_mob_typer_record" from_work_dir="outdir/mob_typer_record.tsv" />
     </outputs>
     <tests>
+        <test>
+            <param name="plasmid" value="SRR9113487_plasmid_2719.fasta"/>
+            <param name="reference_plasmids">
+                <collection type="list">
+                    <element name="CP008719.gbk" value="CP008719.gbk" ftype="genbank" />
+                    <element name="CP008719.gbk" value="CP008719.gbk" ftype="genbank" />
+                </collection>
+            </param>
+	    <param name="concatenated_mob_typer_reports" value="concatenated_mob_typer_reports.tsv" />
+            <output name="plasmid" file="outdir/plasmid.fasta" />
+            <output name="reference_plasmid" file="outdir/reference_plasmid.gbk" />
+            <output name="mob_typer_record" file="outdir/mob_typer_record.gbk" />
+        </test>
     </tests>
     <help><![CDATA[
     ]]></help>