Repository 'mykrobe_predict'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/mykrobe_predict

Changeset 4:a2e3ad69ee23 (2021-08-26)
Previous changeset 3:e8405163fb4e (2021-08-10)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mykrobe commit 3df97df276e6d3c2800d6f41161b3d7cd8fcbf2a"
modified:
macro.xml
mykrobe_predict.xml
b
diff -r e8405163fb4e -r a2e3ad69ee23 macro.xml
--- a/macro.xml Tue Aug 10 11:29:58 2021 +0000
+++ b/macro.xml Thu Aug 26 20:38:36 2021 +0000
[
b'@@ -1,121 +1,102 @@\n-<?xml version="1.1"?>\n <macros>\n-  <token name="@TOOL_VERSION@">0.10.0</token>\n-  <xml name="requirements">\n-    <requirements>\n-      <requirement type="package" version="@TOOL_VERSION@">mykrobe</requirement>\n-    </requirements>    \n-  </xml>\n-  <token name="@select_inputs@">\n-    <![CDATA[\n-         #set $name=\'sample\'\n-    ]]>\n-  </token>\n-\n-  <token name="@shared_options@">\n-    <![CDATA[\n-        #if $kmer:\n-          --kmer \'${kmer}\'\n-        #end if\n-        #if $expected_depth:\n-          --expected_depth \'${expected_depth}\'\n-        #end if\n-\n-        $ont\n-\n-        $report_all_calls\n+    <token name="@TOOL_VERSION@">0.10.0</token>\n+    <token name="@PROFILE@">20.09</token>\n+    <xml name="requirements">\n+        <requirements>\n+            <requirement type="package" version="@TOOL_VERSION@">mykrobe</requirement>\n+      </requirements>\n+    </xml>\n \n-        #if $expected_error_rate:\n-          --expected_error_rate \'${expected_error_rate}\'\n-        #end if\n-\n-        #if $min_variant_conf:\n-          --min_variant_conf \'${min_variant_conf}\'\n-        #end if\n-\n-        #if $min_gene_conf:\n-          --min_gene_conf \'${min_gene_conf}\'\n-        #end if\n-\n-        #if $min_proportion_expected_depth:\n-          --min_proportion_expected_depth \'${min_proportion_expected_depth}\'\n-        #end if\n-\n-        #if $min_gene_percent_covg_threshold:\n-          --min_gene_percent_covg_threshold  \'${min_gene_percent_covg_threshold}\'\n-        #end if\n-\n-        $guess_sequence_method\n-\n-        $ignore_minor_calls\n-\n-        #if $ignore_filtered:\n-          --ignore_filtered \'${ignore_filtered}\'\n-        #end if\n-\n-        #if $model:\n-          --model \'${model}\'\n-        #end if\n+    <token name="@shared_options@">\n+        <![CDATA[\n+            #if $kmer:\n+                --kmer ${kmer}\n+            #end if\n+            #if $expected_depth:\n+                --expected_depth ${expected_depth}\n+            #end if\n+            $ont\n+            $report_all_calls\n+            #if $expected_error_rate:\n+                --expected_error_rate ${expected_error_rate}\n+            #end if\n+            #if $min_variant_conf:\n+                --min_variant_conf ${min_variant_conf}\n+            #end if\n+            #if $min_gene_conf:\n+                --min_gene_conf ${min_gene_conf}\n+            #end if\n+            #if $min_proportion_expected_depth:\n+                --min_proportion_expected_depth ${min_proportion_expected_depth}\n+            #end if\n+            #if $min_gene_percent_covg_threshold:\n+                --min_gene_percent_covg_threshold  ${min_gene_percent_covg_threshold}\n+            #end if\n+            $guess_sequence_method\n+            $ignore_minor_calls\n+            #if $ignore_filtered:\n+                --ignore_filtered \'${ignore_filtered}\'\n+            #end if\n+            #if $model:\n+                --model \'${model}\'\n+            #end if\n+            #if $ploidy:\n+                --ploidy \'${ploidy}\'\n+            #end if\n+        ]]>\n+    </token>\n \n-        #if $ploidy:\n-          --ploidy \'${ploidy}\'\n-        #end if\n-    ]]>\n-  </token>\n-\n-  <xml name="inputs">\n-    <conditional name="data_type">\n-      <param name="type" type="select" label="Specify the read type.">\n-        <option value="single">Single-end Data</option>\n-        <option value="paired">Paired-end Data</option>\n-        <option value="collection">Collection Paired-end Data</option>\n-      </param>\n-      <when value="single">\n-        <param name="seq1" type="data" format="fastqsanger,fastqsanger.gz,fastq,fastq.gz,fasta,fasta.gz,bam" label="Single end read file(s)"/>\n-      </when>\n-      <when value="paired">\n-        <param name="seq1" type="data" format="fastqsanger,fastqsanger.gz,fastq,fastq.gz" label="Forward paired-end read file"/>\n-        <param name="seq2" type="data" format="fastqsanger,fastqsanger.gz,fastq,fastq.gz" label="Reverse paired-end read file"/>\n-      </when>\n-      <when value="collection">\n-  '..b'inor calls when running resistance prediction"/>\n-    <param argument="--ignore_filtered" type="data" format="txt" label="Ignore filtered" optional="True" help="Don\'t include filtered genotypes"/>\n-    <param argument="--guess_sequence_method" type="boolean" truevalue="--guess_sequence_method" falsevalue="" label="Guess sequence method"  help="Guess if ONT or Illumia based on error rate. If error rate is > 10%, ploidy is set to haploid and a confidence threshold is used"/>\n-  </xml>\n+    <xml name="options">\n+        <param argument="--kmer" optional="True" type="integer" min="0" label="Kmer length" value="21" help="default = 21"/>\n+        <param argument="--expected_error_rate" optional="True" type="float" label="Expected error rate"  help="Expected sequencing error rate. Set to 0.15 for ONT genotyping"/>\n+        <param argument="--expected_depth" optional="True" type="integer" min="0" label="Expected depth"  help=""/>\n+        <param argument="--ont" type="boolean" truevalue="--ont" falsevalue="" label="Set default for ONT data"  help=""/>\n+        <param argument="--min_variant_conf" optional="True" type="integer" min="0" label="Minimum genotype confidence for variant genotyping"  help=""/>\n+        <param argument="--min_gene_conf" optional="True" type="integer" min="0" label="Minimum genotype confidence for gene genotyping"  help=""/>\n+        <param argument="--min_gene_percent_covg_threshold" optional="True" type="integer" min="0" label="Minimum gene predict coverage"  help="all genes alleles found above this percent coverage will be reported (default 100 (only best alleles reported))"/>\n+        <param argument="--min_proportion_expected_depth" optional="True" type="float" label="Minimum depth required on the sum of both alleles" help="Default 0.3 (30%)"/>\n+        <param argument="--model" optional="True" type="data" format="txt" label="Genotype model used" help="default kmer_count. Options kmer_count, median_depth"/>\n+        <param argument="--ploidy" optional="True" type="select" label="Diploid or Haploid" help="Use a diploid (includes 0/1 calls) or haploid genotyping model">\n+            <option value="diploid">diploid</option>\n+            <option value="haploid">haploid</option>\n+        </param>\n+        <param argument="--report_all_calls" type="boolean" truevalue="--report_all_calls" falsevalue="" label="Report all calls"  help=""/>\n+        <param argument="--ignore_minor_calls" type="boolean" truevalue="--ignore_minor_calls" falsevalue="" label="Ignore minor calls"  help="Ignore minor calls when running resistance prediction"/>\n+        <param argument="--ignore_filtered" type="data" format="txt" label="Ignore filtered" optional="True" help="Don\'t include filtered genotypes"/>\n+        <param argument="--guess_sequence_method" type="boolean" truevalue="--guess_sequence_method" falsevalue="" label="Guess sequence method"  help="Guess if ONT or Illumia based on error rate. If error rate is > 10%, ploidy is set to haploid and a confidence threshold is used"/>\n+    </xml>\n \n-  <token name="@ATTRIBUTION@">\n-    <![CDATA[\n-             \n-             **MyKrobe predict - Antibiotic resistance predictions**\n-             \n-             Rapid antibiotic-resistance predictions from genome sequence data for Staphylococcus aureus and Mycobacterium tuberculosis\n-             using Bruijn graph.\n-    ]]>      \n-  </token>\n+    <token name="@ATTRIBUTION@">\n+        <![CDATA[\n+            **MyKrobe predict - Antibiotic resistance predictions**\n+            Rapid antibiotic-resistance predictions from genome sequence data for Staphylococcus aureus and Mycobacterium tuberculosis\n+            using Bruijn graph.\n+        ]]>\n+    </token>\n \n-  <xml name="citation">\n-    <citations>\n-      <citation type="doi">10.1038/ncomms10063</citation>\n-    </citations>\n-  </xml>\n+    <xml name="citation">\n+        <citations>\n+            <citation type="doi">10.1038/ncomms10063</citation>\n+        </citations>\n+    </xml>\n </macros>\n'
b
diff -r e8405163fb4e -r a2e3ad69ee23 mykrobe_predict.xml
--- a/mykrobe_predict.xml Tue Aug 10 11:29:58 2021 +0000
+++ b/mykrobe_predict.xml Thu Aug 26 20:38:36 2021 +0000
[
b'@@ -1,129 +1,140 @@\n-<tool id="mykrobe_predict" name="mkyrobe predict" version="@TOOL_VERSION@">\n-  <description>Antibiotic resistance predictions</description>\n-  <macros>\n-    <import>macro.xml</import>\n-  </macros>\n-  <expand macro="requirements"/>\n-  <command detect_errors="exit_code">\n-<![CDATA[\n-        @select_inputs@\n+<tool id="mykrobe_predict" name="mkyrobe predict" version="@TOOL_VERSION@.1+galaxy0"  profile="@PROFILE@">\n+    <description>Antibiotic resistance predictions</description>\n+    <macros>\n+        <import>macro.xml</import>\n+    </macros>\n+    <expand macro="requirements"/>\n+    <command detect_errors="exit_code"><![CDATA[\n+#import difflib\n+#import re\n \n-        mykrobe predict \n-        --sample \'${name}\'\n-        --species ${select_species.species}\n-        --panel \'${select_species.panel}\'\n+mykrobe predict\n+--species \'${select_species.species}\'\n+--panel \'${select_species.panel}\'\n \n-        #if $conf_percent_cutoff:\n-          --conf_percent_cutoff \'${conf_percent_cutoff}\'\n-        #end if\n+#if $conf_percent_cutoff:\n+    --conf_percent_cutoff \'${conf_percent_cutoff}\'\n+#end if\n \n-        #if $min_depth:\n-          --min_depth \'${min_depth}\'\n-        #end if\n+#if $min_depth:\n+    --min_depth ${min_depth}\n+#end if\n \n-        @shared_options@\n+@shared_options@\n \n-        -q\n-        -t "\\${GALAXY_SLOTS:-1}"\n+-q\n+-t "\\${GALAXY_SLOTS:-1}"\n \n-        --seq\n-        #if $data_type.type == "single":\n-          $data_type.seq1\n-        #elif $data_type.type == "paired":\n-\t  $data_type.seq1 $data_type.seq2\n-        #elif $data_type.type == "collection":\n-          $data_type.collection1.forward $data_type.collection1.reverse\n-\t#end if\n+#if $data_type.type in ["single", "paired"]:\n+    #set read1 = $data_type.seq1\n+    #set read1_identifier = re.sub(\'[^\\s\\w\\-]\', \'_\', str($read1.element_identifier))\n+    #if $data_type.type == "single":\n+        --sample \'${read1_identifier}\'\n+    --seq \'${read1}\'\n+    #else:\n+        #set read2 = $data_type.seq2\n+        #set read2_identifier = re.sub(\'[^\\s\\w\\-]\', \'_\', str($read2.element_identifier))\n+        #set matches = difflib.SequenceMatcher(None, read1_identifier, read2_identifier).get_matching_blocks()\n+        #set match = $matches[0]\n+        #set identifier = re.sub(\'[^\\s\\w\\-]\', \'_\', str($read1_identifier[match.a:match.a + match.size]))\n+    --sample \'${identifier}\'\n+    --seq \'${read1}\' \'${read2}\'\n+    #end if\n+#elif $data_type.type == "collection":\n+    #set identifier = re.sub(\'[^\\s\\w\\-]\', \'_\', str($data_type.collection1.element_identifier))\n+    --sample \'${identifier}\'\n+    --seq \'${data_type.collection1.forward}\' \'${data_type.collection1.reverse}\'\n+#end if\n \n-        --format \'${format}\'\n+--format \'${format}\'\n \n-        > \'$output\'\n-]]>\n-  </command>\n-  <inputs>\n-    <expand macro="inputs"/>\n-    <conditional name="select_species">\n-      <param name="species" type="select" label="Specify Species for AMR">\n-        <option value="tb">Mycobacterium tuberculosis (tb)</option>\n-        <option value="staph">Staphylococcus aureus (staph)</option>\n-        <option value="sonnei">Shigella sonnei (sonnei)</option>\n-      </param>\n-      <when value="staph">\n-        <param name="panel" type="select" label="Select panel for Staph only">\n-          <option value="20170217">20170217</option>\n-        </param>\n-      </when>\n-      <when value="tb">\n-\t<param name="panel" type="select" label="Select panel for TB only">\n-          <option value="202010">202010</option>\n-          <option value="201901">201901</option>\n-          <option value="bradley-2015">Bradely 2015</option>\n+> \'$output\']]>\n+    </command>\n+    <inputs>\n+        <expand macro="inputs"/>\n+        <conditional name="select_species">\n+            <param name="species" type="select" label="Specify Species for AMR">\n+                <option value="tb">Mycobacterium tuberculosis (tb)</option>\n+                <option value="staph">Staphylococcus aureus (staph)</option>\n+                <option value="sonnei">Shig'..b't_conf, by simulating variants and choosing the cutoff that would keep x% of the variants. Default is 90 if --ont, otherwise --min_variant_conf is used as the cutoff">\n-      <validator type="in_range" min="0" max="100" message="Confidence percent cutoff should be between 0 and 100" />\n-    </param>\n-    <expand macro="options"/>\n-    <param argument="--format" type="select" label="Select the prefered output format">\n-      <option value="csv" >csv</option>\n-      <option value="json">json</option>\n-    </param>\n-  </inputs>\n-  <outputs>\n-    <data name="output" format="csv" label="prediction">\n-      <change_format>\n-        <when input="format" value="json" format="json"/>\n-      </change_format>\n-    </data>\n-  </outputs>\n-  <tests>\n-    <test>\n-      <param name="type" value="single"/>\n-      <param name="seq1" ftype="fastq" value="reads.fastq"/>\n-      <param name="species" value="tb"/>\n-      <param name="panel" value="bradley-2015"/>\n-      <param name="format" value="json"/>\n-      <output name="output">\n-        <assert_contents>\n-          <has_text_matching expression="susceptibility"/>\n-        </assert_contents>\n-      </output>\n-    </test>\n-    <test>\n-      <param name="type" value="single"/>\n-      <param name="seq1" ftype="fastq" value="reads.fastq"/>\n-      <param name="species" value="sonnei"/>\n-      <param name="panel" value="20201012"/>\n-      <param name="format" value="json"/>\n-      <output name="output">\n-        <assert_contents>\n-          <has_text_matching expression="susceptibility"/>\n-        </assert_contents>\n-      </output>\n-    </test>\n-    <test>\n-      <param name="type" value="single"/>\n-      <param name="seq1" ftype="fastq.gz" value="reads.fastq.gz"/>\n-      <param name="species" value="sonnei"/>\n-      <param name="panel" value="20201012"/>\n-      <param name="format" value="json"/>\n-      <output name="output">\n-        <assert_contents>\n-          <has_text_matching expression="susceptibility"/>\n-        </assert_contents>\n-      </output>\n-    </test>\n-  </tests>\n-  <help>\n-    @ATTRIBUTION@\n-  </help>\n-  <expand macro="citation" />\n+    </inputs>\n+    <outputs>\n+        <data name="output" format="csv" label="prediction">\n+            <change_format>\n+                <when input="format" value="json" format="json"/>\n+            </change_format>\n+        </data>\n+    </outputs>\n+    <tests>\n+        <test>\n+            <param name="type" value="single"/>\n+            <param name="seq1" ftype="fastq" value="reads.fastq"/>\n+            <param name="species" value="tb"/>\n+            <param name="panel" value="bradley-2015"/>\n+            <param name="format" value="json"/>\n+            <output name="output">\n+                <assert_contents>\n+                    <has_text_matching expression="susceptibility"/>\n+                </assert_contents>\n+            </output>\n+        </test>\n+        <test>\n+            <param name="type" value="single"/>\n+            <param name="seq1" ftype="fastq" value="reads.fastq"/>\n+            <param name="species" value="sonnei"/>\n+            <param name="panel" value="20201012"/>\n+            <param name="format" value="json"/>\n+            <output name="output">\n+                <assert_contents>\n+                    <has_text_matching expression="susceptibility"/>\n+                </assert_contents>\n+            </output>\n+        </test>\n+        <test>\n+            <param name="type" value="single"/>\n+            <param name="seq1" ftype="fastq.gz" value="reads.fastq.gz"/>\n+            <param name="species" value="sonnei"/>\n+            <param name="panel" value="20201012"/>\n+            <param name="format" value="json"/>\n+            <output name="output">\n+                <assert_contents>\n+                    <has_text_matching expression="susceptibility"/>\n+              </assert_contents>\n+            </output>\n+        </test>\n+    </tests>\n+    <help>\n+        @ATTRIBUTION@\n+    </help>\n+    <expand macro="citation" />\n </tool>\n+\n'