changeset 6:9424de64bfa8 draft

"planemo upload for repository https://github.com/phac-nml/mob-suite commit dc6eaf2675bf842ab7a52c3fdf16d01028cddc9a"
author nml
date Wed, 11 Dec 2019 19:17:11 -0500
parents 09424ec94e80
children 822575bf359f
files mob_recon.xml mob_typer.xml
diffstat 2 files changed, 146 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/mob_recon.xml	Wed Nov 13 14:09:11 2019 -0500
+++ b/mob_recon.xml	Wed Dec 11 19:17:11 2019 -0500
@@ -1,17 +1,18 @@
-<tool id="mob_recon" name="MOB-Recon" version="1.4.9.1+galaxy0">
+<tool id="mob_recon" name="MOB-Recon" version="2.0.5+galaxy0">
   <description>Type contigs and extract plasmid sequences</description>
   <requirements>
-     <requirement type="package" version="1.4.9.1">mob_suite</requirement>
-  </requirements>   
+     <requirement type="package" version="2.0.5">mob_suite</requirement>
+  </requirements>
+  <version_command>mob_recon --version</version_command>
   <command detect_errors="exit_code">
   <![CDATA[  
     #import re
     #import os.path
     
-    #set $named_input = re.sub(r'(\s|\(|\)|:|!)', '_', str($input.element_identifier)+".fasta")
-    ln -s "$input" $named_input && 
+    #set $named_input = re.sub(r'(\s|\(|\)|:|!)', '_', str($input.element_identifier)+'.fasta')
+    ln -s '$input' '$named_input' &&
     
-    mob_recon  --num_threads \${GALAXY_SLOTS:-4}  --infile "${named_input}" 
+    mob_recon  --num_threads \${GALAXY_SLOTS:-4}  --infile '${named_input}'
     #if str($adv_param.unicycler_contigs) == "True":
       --unicycler_contigs 
     #end if   
@@ -19,7 +20,7 @@
       --run_circlator 
     #end if 
     #if str($adv_param.min_length_condition.min_length_param) == "True":
-      --min_length ${adv_param.min_length_condition.min_length_value}
+      --min_length '${adv_param.min_length_condition.min_length_value}'
     #end if 
     --run_typer --min_rep_evalue '${adv_param.min_rep_evalue}'
     --min_rep_evalue '${adv_param.min_rep_evalue}'
@@ -29,8 +30,8 @@
     --min_mob_ident '${adv_param.min_mob_ident}'
     --min_con_ident  '${adv_param.min_con_ident}'
     --min_rpp_ident   '${adv_param.min_rpp_ident}'
-    --outdir '.' && 
-    mkdir ./sequences && (cp plasmid*.fasta chromosome.fasta ./sequences 2> /dev/null || true)
+    --outdir 'outdir' &&
+    mkdir ./outdir/plasmids && (mv outdir/plasmid*.fasta ./outdir/plasmids 2> /dev/null || true)
   ]]>  
   </command>
   <inputs>
@@ -65,25 +66,26 @@
     </section>  
   </inputs>
   <outputs>
-    <data name="outfile1" format="tabular" from_work_dir="contig_report.txt" label="${tool.name} on ${on_string}: Overall contig MOB-recon report"/> 
-    <data name="outfile2" format="tabular" from_work_dir="repetitive_blast_report.txt" label="${tool.name} on ${on_string}: Repetitive elements BLAST report"/>
-    <data name="outfile3" format="tabular" from_work_dir="mobtyper_aggregate_report.txt" label="${tool.name} on ${on_string}: Aggregate MOB-typer report for all contigs"/>
-    <collection name="seqhits" type="list" label="${tool.name} on ${on_string}: Extracted sequences (plasmids,chromosome(s))">
-            <discover_datasets pattern="__name_and_ext__" directory="sequences" />
+    <data name="contig_report" format="tabular" from_work_dir="outdir/contig_report.txt" label="${tool.name} on ${input.element_identifier}: Overall contig MOB-recon report"/> 
+    <data name="repetitive_blast_report" format="tabular" from_work_dir="outdir/repetitive_blast_report.txt" label="${tool.name} on ${input.element_identifier}: Repetitive elements BLAST report"/>
+    <data name="mobtyper_aggregate_report" format="tabular" from_work_dir="outdir/mobtyper_aggregate_report.txt" label="${tool.name} on ${input.element_identifier}: Aggregate MOB-typer report for all contigs"/>
+    <data name="chromosome" format="fasta" from_work_dir="outdir/chromosome.fasta" label="${tool.name} on ${input.element_identifier}: Chromosomal sequences"/>
+    <collection name="plasmids" type="list" label="${tool.name} on ${input.element_identifier}: Plasmids">
+      <discover_datasets pattern="__name_and_ext__" directory="outdir/plasmids" />
     </collection>
   </outputs>
   <tests>
     <test>
-        <param name="input" value="plasmid_476.fasta" ftype="fasta"/>
-        <section name="adv_param">
-         <param name="unicycler_contigs" value="True"/>
-         <param name="run_circlator"  value="True"/>
-        </section>
-        <output name="outfile1">
-          <assert_contents>
-            <has_text text="NC_019097"/>
-          </assert_contents>  
-        </output> 
+      <param name="input" value="plasmid_476.fasta" ftype="fasta"/>
+      <section name="adv_param">
+        <param name="unicycler_contigs" value="True"/>
+        <param name="run_circlator"  value="True"/>
+      </section>
+      <output name="contig_report">
+        <assert_contents>
+          <has_text text="NC_019097"/>
+        </assert_contents>
+      </output>
     </test>
   </tests>
   <help>
--- a/mob_typer.xml	Wed Nov 13 14:09:11 2019 -0500
+++ b/mob_typer.xml	Wed Dec 11 19:17:11 2019 -0500
@@ -1,12 +1,14 @@
-<tool id="mob_typer" name="MOB-Typer" version="1.4.9.1+galaxy0">
+<tool id="mob_typer" name="MOB-Typer" version="2.0.5+galaxy0">
   <description>Get the plasmid type and mobility given its sequence</description>
   <requirements>
-     <requirement type="package" version="1.4.9.1">mob_suite</requirement>
-  </requirements>   
+     <requirement type="package" version="2.0.5">mob_suite</requirement>
+  </requirements>
+  <version_command>mob_typer --version</version_command>
   <command detect_errors="exit_code">
   <![CDATA[
-    ln -s "${input}" "${input.name}";
-    mob_typer  --num_threads \${GALAXY_SLOTS:-4} --infile "${input.name}" 
+    ln -s '${input}' '${input.name}' &&
+    mob_typer  --num_threads \${GALAXY_SLOTS:-4} --infile '${input.name}'
+    ${host_range_detailed}
    --min_rep_evalue '$adv_param.min_rep_evalue_value'
    --min_mob_evalue '$adv_param.min_mob_evalue_value'
    --min_con_evalue '$adv_param.min_con_evalue_value'
@@ -16,11 +18,12 @@
    --min_mob_ident '$adv_param.min_mob_ident'
    --min_ori_ident '$adv_param.min_ori_ident'
    --min_mpf_ident '$adv_param.min_mpf_ident'
-    --outdir '.';
+    --outdir 'outdir';
   ]]>
   </command>
   <inputs>
     <param name="input" type="data" format="fasta" label="Input" help="FASTA file with contig(s)"/>
+    <param name="host_range_detailed" type="boolean" truevalue="--host_range_detailed" falsevalue="" checked="true" label="Perform detailed host range analysis" />
     <section name="adv_param" title="Advanced parameters" expanded="False">
       <param name="min_rep_evalue_value" type="float" value="0.00001" min="0.00001" max="1" label="Minimum evalue threshold for replicon blastn"/> 
       <param name="min_mob_evalue_value" type="float" value="0.00001" min="0.00001" max="1" label="Minimum evalue threshold for relaxase tblastn"/> 
@@ -31,19 +34,122 @@
       <param name="min_mob_ident" label="Minimum sequence identity for relaxases" type="integer"  min="0" max="100" value="80"/>
       <param name="min_ori_ident" label="Minimum sequence identity for oriT elements" type="integer"  min="0" max="100" value="90"/>
       <param name="min_mpf_ident" label="Minimum sequence identity for mpf elements" type="integer"  min="0" max="100" value="80"/>
-    </section>  
+    </section>
   </inputs>
   <outputs>
-    <data name="outfile1" label="${tool.name}: Plasmid report on ${input.name}" format="tabular">
-      <discover_datasets pattern=".+_report\.txt" visible="true" format="tabular" assign_primary_output="true"/>
-    </data>  
+    <data name="plasmid_report" from_work_dir="outdir/mobtyper*_report.txt" label="${tool.name}: Plasmid report on ${input.element_identifier}"  format="tabular" />
+    <data name="refseq_hostrange_phylogeny_tree" from_work_dir="outdir/*_refseqhostrange_phylogeny_tree.nwk" label="${tool.name} on ${input.element_identifier}: RefSeq Host Range Phylogeny Tree" format="newick">
+      <filter>host_range_detailed</filter>
+    </data>
+    <data name="literature_hostrange_phylogeny_tree" from_work_dir="outdir/*_literaturehostrange_phylogeny_tree.nwk" label="${tool.name} on ${input.element_identifier}: Literature Host Range Phylogeny Tree" format="newick">
+      <filter>host_range_detailed</filter>
+    </data>
+    <data name="refseq_hostrange_ascii_tree" from_work_dir="outdir/*_refseqhostrange_asci_tree.txt" label="${tool.name} on ${input.element_identifier}: RefSeq Host Range ASCII Tree" format="txt">
+      <filter>host_range_detailed</filter>
+    </data>
+    <data name="literature_hostrange_ascii_tree" from_work_dir="outdir/*_literaturehostrange_asci_tree.txt" label="${tool.name} on ${input.element_identifier}: Literature Host Range ASCII Tree" format="txt">
+      <filter>host_range_detailed</filter>
+    </data>
+    <data name="literature_report" from_work_dir="outdir/*_literature_report.txt" label="${tool.name} on ${input.element_identifier}: Literature Report" format="tabular">
+      <filter>host_range_detailed</filter>
+    </data>
+    <data name="refseq_hostrange_report" from_work_dir="outdir/*_refseqhostrange_report.txt" label="${tool.name} on ${input.element_identifier}: RefSeq Host Range Report" format="tabular">
+      <filter>host_range_detailed</filter>
+    </data>
+    <data name="refseq_hostrange_phylostats" from_work_dir="outdir/*_refseqhostrange_phylostats.txt" label="${tool.name} on ${input.element_identifier}: RefSeq Host Range Phylogeny Stats" format="tabular">
+      <filter>host_range_detailed</filter>
+    </data>
   </outputs>
   <tests>
     <test>
-        <param name="input" value="plasmid_476.fasta" ftype="fasta"/>
-        <assert_stdout>
-            <has_text text="JN253636"/> 
-         </assert_stdout>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="False" />
+      <output name="plasmid_report">
+        <assert_contents>
+          <has_text text="000145__HE610900_00001"/>
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="True" />
+      <output name="refseq_hostrange_phylogeny_tree">
+        <assert_contents>
+          <has_text text="(624:1,984897:1)"/> 
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="True" />
+      <output name="literature_hostrange_phylogeny_tree">
+        <assert_contents>
+          <has_text text="(90371:1,611:1,28144:1)"/> 
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="True" />
+      <output name="refseq_hostrange_ascii_tree">
+        <assert_contents>
+          <has_text text="order, Enterobacterales"/>
+          <has_text text="family, Enterobacteriaceae"/>
+          <has_text text="genus, Shigella"/>
+          <has_text text="species, Escherichia coli"/>
+          <has_text text="genus, Serratia"/>
+          <has_text text="species, Serratia marcescens"/>
+          <has_text text="species, Klebsiella pneumoniae"/>
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="True" />
+      <output name="literature_hostrange_ascii_tree">
+        <assert_contents>
+          <has_text text="family, Enterobacteriaceae"/>
+          <has_text text="species, Escherichia coli"/>
+          <has_text text="species, Klebsiella pneumoniae"/>
+          <has_text text="subspecies, Salmonella enterica subsp. enterica"/>
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="True" />
+      <output name="literature_report">
+        <assert_contents>
+          <has_text text="IncI1"/>
+          <has_text text="R64"/>
+          <has_text text="pHNRD174"/>
+          <has_text text="pKHSB1"/>
+          <has_text text="pCTXM1-MU2"/>
+          <has_text_matching expression="family\tEnterobacteriaceae"/>
+          <has_text_matching expression="order\tEnterobacteriales"/>
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="True" />
+      <output name="refseq_hostrange_report">
+        <assert_contents>
+          <has_text text="IncI1"/>
+          <has_text text="Enterobacterales"/> 
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="input" value="plasmid_476.fasta" ftype="fasta" />
+      <param name="host_range_detailed" value="True" />
+      <output name="refseq_hostrange_phylostats">
+        <assert_contents>
+          <has_line_matching expression="rank\tsci_name\tdb_hits\tconvergance_rank\tconvergance_sci_name"/>
+          <has_line_matching expression="family\tEnterobacteriaceae\t351"/>
+          <has_line_matching expression="genus\tSalmonella\t113"/> 
+        </assert_contents>
+      </output>
     </test>
   </tests>
   <help>