Repository 'kraken2'
hg clone https://toolshed.g2.bx.psu.edu/repos/dfornika/kraken2

Changeset 0:a77e88d426d9 (2019-03-01)
Next changeset 1:7932d09da19b (2019-03-04)
Commit message:
planemo upload for repository https://github.com/dfornika/galaxytools/blob/master/tools/kraken2 commit f05f93ee024df8b38efa1c92db9785d52c726f85-dirty
added:
kraken2.xml
macros.xml
test-data/kraken_test1.fa
test-data/test_database.loc
tool_data_table_conf.xml.test
b
diff -r 000000000000 -r a77e88d426d9 kraken2.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/kraken2.xml Fri Mar 01 12:43:26 2019 -0500
[
@@ -0,0 +1,88 @@
+<tool id="kraken2" name="kraken2" version="@TOOL_VERSION@+galaxy0">
+    <description></description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">kraken2</requirement>
+    </requirements>
+    <version_command>kraken2 --version</version_command>
+    <command detect_errors="exit_code">
+        <![CDATA[
+        @SET_DATABASE_PATH@ &&
+
+        kraken2
+            --threads \${GALAXY_SLOTS:-1}
+            @INPUT_DATABASE@
+
+            #if $single_paired.single_paired_selector == 'yes'
+                #if $forward_input.is_of_type( 'fastq' ):
+                    --fastq-input
+                #else:
+                    --fasta-input
+                #end if
+                '${single_paired.forward_input}' '${single_paired.reverse_input}'
+                ${single_paired.check_names}
+            #elif $single_paired.single_paired_selector == "collection":
+                #if $single_paired.input_pair.forward.is_of_type( 'fastq' ):
+                    --fastq-input
+                #else:
+                    --fasta-input
+                #end if
+                '${single_paired.input_pair.forward}' '${single_paired.input_pair.reverse}'
+                ${single_paired.check_names}
+            #else:
+                #if $single_paired.input_sequences.is_of_type('fastq')
+                    --fastq-input
+                #else:
+                    --fasta-input
+                #end if
+                '${single_paired.input_sequences}'
+            #end if
+            --db '$database'
+            > '$output'
+ ]]>
+    </command>
+    <inputs>
+        <conditional name="single_paired">
+            <param name="single_paired_selector" type="select" label="Single or paired reads" help="--paired">
+                <option value="collection">Collection</option>
+                <option value="yes">Paired</option>
+                <option selected="True" value="no">Single</option>
+            </param>
+            <when value="collection">
+                <param format="fasta,fastq" name="input_pair" type="data_collection" collection_type="paired" label="Collection of paired reads" help="FASTA or FASTQ datasets" />
+                <param name="check_names" argument="--check-names" type="boolean" checked="False" truevalue="--paired --check-names" falsevalue="--paired" label="Verify read names match"/>
+            </when>
+            <when value="yes">
+                <param format="fasta,fastq" name="forward_input" type="data" label="Forward strand" help="FASTA or FASTQ dataset"/>
+                <param format="fasta,fastq" name="reverse_input" type="data" label="Reverse strand" help="FASTA or FASTQ dataset"/>
+                <param name="check_names" type="boolean" checked="False" truevalue="--paired --check-names" falsevalue="--paired" label="Verify read names match" help="--check-names" />
+            </when>
+            <when value="no">
+                <param format="fasta,fastq" label="Input sequences" name="input_sequences" type="data" help="FASTA or FASTQ datasets"/>
+            </when>
+        </conditional>
+        <param name="" type="" format="" />
+    </inputs>
+    <outputs>
+        <data name="output" format="" />
+    </outputs>
+    <tests>
+        <test>
+            <param name="single_paired_selector" value="no"/>
+            <param name="input_sequences" value="kraken_test1.fa" ftype="fasta"/>
+            <param name="split_reads" value="false"/>
+            <param name="quick" value="no"/>
+            <param name="only-classified-output" value="false"/>
+            <param name="kraken_database" value="new_style_test_entry"/>
+            <output name="output" file="kraken_test1_output.tab" ftype="tabular"/>
+        </test>
+    </tests>
+    <help>
+      <![CDATA[
+Kraken is a taxonomic classification system using exact k-mer matches to achieve high accuracy and fast classification speeds. This classifier matches each k-mer within a query sequence to the lowest common ancestor (LCA) of all genomes containing the given k-mer. The k-mer assignments inform the classification algorithm. 
+      ]]>
+    </help>
+    <expand macro="citations" />
+</tool>
b
diff -r 000000000000 -r a77e88d426d9 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Fri Mar 01 12:43:26 2019 -0500
[
@@ -0,0 +1,15 @@
+<macros>
+    <token name="@TOOL_VERSION@">2.0.7_beta</token>
+    <token name="@INTYPES@">
+        fasta,fasta.gz,fastq,fastq.gz,fastqsanger,fastqsanger.gz
+    </token>
+    <xml name="input_database">
+        <param label="Select a Kraken2 database" name="kraken2_database" type="select">
+            <options from_data_table="kraken2_databases">
+                <validator message="No Kraken2 database is available" type="no_options" />
+            </options>
+        </param>
+    </xml>
+    <token name="@SET_DATABASE_PATH@">if [ -d '${kraken2_database.fields.path}/${kraken2_database.fields.name}' ]; then export KRAKEN2_DEFAULT_DB='${kraken2_database.fields.path}/${kraken2_database.fields.name}'; else export KRAKEN2_DEFAULT_DB='${kraken_database.fields.path}'; fi</token>
+    <token name="@INPUT_DATABASE@">--db "\$KRAKEN2_DEFAULT_DB"</token>
+</macros>
b
diff -r 000000000000 -r a77e88d426d9 test-data/kraken_test1.fa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/kraken_test1.fa Fri Mar 01 12:43:26 2019 -0500
b
@@ -0,0 +1,70 @@
+>gi|145231|gb|M33724.1|ECOALPHOA Escherichia coli K-12 truncated PhoA (phoA) gene, partial cds; and transposon Mu dI, partial sequence
+CAAAGCTCCGGGCCTCACCCAGGCGCTAAATACCAAAGATGGCGCAGTGATGGTGATGAGTTACGGGAAC
+TCCGAAGAGGATTCACAAGAACATACCGGCAGTCAGTTGCGTATTGCGGCGTATGGCCCGCATGCCGCCA
+ATGAAGCGGCGCACGAAAAACGCGAAAGCGT
+
+>gi|145232|gb|M33725.1|ECOALPHOB Escherichia coli K12 phoA pseudogene and transposon Mu dl-R, partial sequence
+CTGTCATAAAGTTGTCACGGCCGAGACTTATAGTCGCTTTGTTTTTATTTTTTAATGTATTTGTACATGG
+AGAAAATAAAGTGAAACAAAGCACTATTGCACTGGCACTCTTACCGTTACTGTTTACCCCTGTGACAAAA
+GCCCGGACACCAGTGAAGCGGCGCACGAAAAACGCGAAAGCGT
+
+>gi|145234|gb|M33727.1|ECOALPHOE Escherichia coli K12 upstream sequence of psiA5::Mu dI. is identical to psiA30 upstream sequence; putative (phoA) pseudogene and transposon Mu dl-R, partial sequence
+TTGTTTTTATTTTTTAATGTATTTGTACATGGAGAAAATAAAGTGAAACAAAGCACTATTGCACTGGTGA
+AGCGGCGCACGAAAAACGCGAAAGCGT
+
+>gi|146195|gb|J01619.1|ECOGLTA Eschericia coli gltA gene, sdhCDAB operon and sucABCD operons, complete sequence
+GAATTCGACCGCCATTGCGCAAGGCATCGCCATGACCAGGCAGGATACAAAAGAGAGTCGATAAATATTC
+ACGGTGTCCATACCTGATAAATATTTTATGAAAGGCGGCGATGATGCCGCAAAATAATACTTATTTATAA
+TCCAGCACGTAGGTTGCGTTAGCGGTTACTTCACCTGCCGTGACATCGACTGCATTATCAATTTGTTCCA
+TCCAGGCGAAAAAGTTCAGCGTCTGTTCTGATGAGCTTGCATCCAGGTCAAGATCTGGCGCGGCTGAACC
+TAATACGATGTTACCGTCATTTTTGTCCATCAGTCGTACACCGACCCCAGTTGCTTCGCCTGCACTGGTG
+TTGCTCAACAAAGGCGTAGCACCAGTTGTCTTAGCCGTGCTATCGAAGGTTACGCCAAACTTTGGATACC
+GGCATTCCGCTACCGTTGTCAGAAGCAGGCAGATCACAGTTGATCAAGCGAATGTCGACGGCCACTTTAT
+TGCTATGATGCTCCCGGTTTATATGGGTTGTCGTGACTTGTCCAAGATCTATGTTTTTATCAATATCTTC
+TGGATGAATTTCACAAGGTGCTTCAATAACCTCCCCCTTAAAGTGAATTTCGCCAGAACCTTCATCAGCA
+GCATAAACAGGTGCAGTGAACAGCAGAGATACGGCCAGTGCGGCCAATGTTTTTTGTCCTTTAAACATAA
+CAGAGTCCTTTAAGGATATAGAATAGGGGTATAGCTACGCCAGAATATCGTATTTGATTATTGCTAGTTT
+TTAGTTTTGCTTAAAAAATATTGTTAGTTTTATTAAATTGGAAAACTAAATTATTGGTATCATGAATTGT
+TGTATGATGATAAATATAGGGGGGATATGATAGACGTCATTTTCATAGGGTTATAAAATGCGACTACCAT
+GAAGTTTTTAATTCAAAGTATTGGGTTGCTGATAATTTGAGCTGTTCTATTCTTTTTAAATATCTATATA
+GGTCTGTTAATGGATTTTATTTTTACAAGTTTTTTGTGTTTAGGCATATAAAAATCAAGCCCGCCATATG
+AACGGCGGGTTAAAATATTTACAACTTAGCAATCGAACCATTAACGCTTGATATCGCTTTTAAAGTCGCG
+TTTTTCATATCCTGTATACAGCTGACGCGGACGGGCAATCTTCATACCGTCACTGTGCATTTCGCTCCAG
+TGGGCGATCCAGCCAACGGTACGTGCCATTGCGAAAATGACGGTGAACATGGAAGACGGAATACCCATCG
+CTTTCAGGATGATACCAGAGTAGAAATCGACGTTCGGGTACAGTTTCTTCTCGATAAAGTACGGGTCGTT
+CAGCGCGATGTTTTCCAGCTCCATAGCCACTTCCAGCAGGTCATCCTTCGTGCCCAGCTCTTTCAGCACT
+TCATGGCAGGTTTCACGCATTACGGTGGCGCGCGGGTCGTAATTTTTGTACACGCGGTGACCGAAGCCCA
+TCAGGCGGAAAGAATCATTTTTGTCTTTCGCACGACGAAAAAATTCCGGAATGTGTTTAACGGAGCTGAT
+TTCTTCCAGCATTTTCAGCGCCGCTTCGTTAGCACCGCCGTGCGCAGGTCCCCACAGTGAAGCAATACCT
+GCTGCGATACAGGCAAACGGGTTCGCACCCGAAGAGCCAGCGGTACGCACGGTGGAGGTAGAGGCGTTCT
+GTTCATGGTCAGCGTGCAGGATCAGAATACGGTCCATAGCACGTTCCAGAATCGGATTAACTTCATACGG
+TTCGCACGGCGTGGAGAACATCATATTCAGGAAGTTACCGGCGTAGGAGAGATCGTTGCGCGGGTAAACA
+AATGGCTGACCAATGGAATACTTGTAACACATCGCGGCCATGGTCGGCATTTTCGACAGCAGGCGGAACG
+CGGCAATTTCACGGTGACGAGGATTGTTAACATCCAGCGAGTCGTGATAGAACGCCGCCAGCGCGCCGGT
+AATACCACACATGACTGCCATTGGATGCGAGTCGCGACGGAAAGCATGGAACAGACGGGTAATCTGCTCG
+TGGATCATGGTATGACGGGTCACCGTAGTTTTAAATTCGTCATACTGTTCCTGAGTCGGTTTTTCACCAT
+TCAGCAGGATGTAACAAACTTCCAGGTAGTTAGAATCGGTCGCCAGCTGATCGATCGGGAAACCGCGGTG
+CAGCAAAATACCTTCATCACCATCAATAAAAGTAATTTTAGATTCGCAGGATGCGGTTGAAGTGAAGCCT
+GGGTCAAAGGTGAACACACCTTTTGAACCGAGAGTACGGATATCAATAACATCTTGACCCAGCGTGCCTT
+TCAGCACATCCAGTTCAACAGCTGTATCCCCGTTGAGGGTGAGTTTTGCTTTTGTATCAGCCATTTAAGG
+TCTCCTTAGCGCCTTATTGCGTAAGACTGCCGGAACTTAAATTTGCCTTCGCACATCAACCTGGCTTTAC
+CCGTTTTTTATTTGGCTCGCCGCTCTGTGAAAGAGGGGAAAACCTGGGTACAGAGCTCTGGGCGCTTGCA
+GGTAAAGGATCCATTGATGACGAATAAATGGCGAATCAAGTACTTAGCAATCCGAATTATTAAACTTGTC
+TACCACTAATAACTGTCCCGAATGAATTGGTCAATACTCCACACTGTTACATAAGTTAATCTTAGGTGAA
+ATACCGACTTCATAACTTTTACGCATTATATGCTTTTCCTGGTAATGTTTGTAACAACTTTGTTGAATGA
+TTGTCAAATTAGATGATTAAAAATTAAATAAATGTTGTTATCGTGACCTGGATCACTGTTCAGGATAAAA
+CCCGACAAACTATATGTAGGTTAATTGTAATGATTTTGTGAACAGCCTATACTGCCGCCAGTCTCCGGAA
+CACCCTGCAATCCCGAGCCACCCAGCGTTGTAACGTGTCGTTTTCGCATCTGGAAGCAGTGTTTTGCATG
+ACGCGCAGTTATAGAAAGGACGCTGTCTGACCCGCAAGCAGACCGGAGGAAGGAAATCCCGACGTCTCCA
+GGTAACAGAAAGTTAACCTCTGTGCCCGTAGTCCCCAGGGAATAATAAGAACAGCATGTGGGCGTTATTC
+ATGATAAGAAATGTGAAAAAACAAAGACCTGTTAATCTGGACCTACAGACCATCCGGTTCCCCATCACGG
+CGATAGCGTCCATTCTCCATCGCGTTTCCGGTGTGATCACCTTTGTTGCAGTGGGCATCCTGCTGTGGCT
+TCTGGGTACCAGCCTCTCTTCCCCTGAAGGTTTCGAGCAAGCTTCCGCGATTATGGGCAGCTTCTTCGTC
+AAATTTATCATGTGGGGCATCCTTACCGCTCTGGCGTATCACGTCGTCGTAGGTATTCGCCACATGATGA
+TGGATTTTGGCTATCTGGAAGAAACATTCGAAGCGGGTAAACGCTCCGCCAAAATCTCCTTTGTTATTAC
+TGTCGTGCTTTCACTTCTCGCAGGAGTCCTCGTATGGTAAGCAACGCCTCCGCATTAGGACGCAATGGCG
+TACATGATTTCATCCTCGTTCGCGCTACCGCTATCGTCCTGACGCTCTACATCATTTATATGGTCGGTTT
+TTTCGCTACCAGTGGCGAGCTGACATATGAAGTCTGGATCGGTTTCTTCGCCTCTGCGTTCACCAAAGTG
+TTCACCCTGCTGGCGCTGTTTTCTATCTTGATCCATGCCTGGATCGGCATGTGGCAGGTGTTGACCGACT
+ACGTTAAACCGCTGGCTTTGCGCCTGATGCTGCAACTGGTGATTGTCGTTGCACTGGTGGTTTACGTGAT
+TTATGGATTCGTTGTGGTGTGGGGTGTGTGATGAAATTGCCAGTCAGAGAATTTGATGCAGTTGTGATTG
b
diff -r 000000000000 -r a77e88d426d9 test-data/test_database.loc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test_database.loc Fri Mar 01 12:43:26 2019 -0500
b
@@ -0,0 +1,7 @@
+# Tab separated with three columns:
+# - value (Galaxy records this in the Galaxy DB)
+# - name (Galaxy shows this in the UI)
+# - path (folder name containing the Kraken DB)
+#
+#
+test_entry "Test Database" ${__HERE__}/test_db
b
diff -r 000000000000 -r a77e88d426d9 tool_data_table_conf.xml.test
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.test Fri Mar 01 12:43:26 2019 -0500
b
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<tables>
+    <!-- Locations of Kraken2 database in the required format -->
+    <table name="kraken2_databases" comment_char="#">
+        <columns>value, name, path</columns>
+        <file path="${__HERE__}/test-data/test_database.loc" />
+    </table>
+</tables>