Mercurial > repos > iuc > kraken2
comparison kraken2.xml @ 6:e452fed07fbb draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tool_collections/kraken2/kraken2 commit 39ebbc539c35a194c97c93497849b6136bbc7a8c
| author | iuc |
|---|---|
| date | Sun, 07 Dec 2025 11:30:46 +0000 |
| parents | 9c5599b8c9a0 |
| children |
comparison
equal
deleted
inserted
replaced
| 5:9c5599b8c9a0 | 6:e452fed07fbb |
|---|---|
| 1 <?xml version="1.0"?> | 1 <tool id="kraken2" name="Kraken2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> |
| 2 <tool id="kraken2" name="Kraken2" version="@TOOL_VERSION@+galaxy1"> | |
| 3 <description> | 2 <description> |
| 4 assign taxonomic labels to sequencing reads | 3 assign taxonomic labels to sequencing reads |
| 5 </description> | 4 </description> |
| 6 <macros> | 5 <macros> |
| 7 <import>macros.xml</import> | 6 <import>macros.xml</import> |
| 13 <requirement type="package" version="@TOOL_VERSION@">kraken2</requirement> | 12 <requirement type="package" version="@TOOL_VERSION@">kraken2</requirement> |
| 14 </requirements> | 13 </requirements> |
| 15 <version_command>kraken2 --version</version_command> | 14 <version_command>kraken2 --version</version_command> |
| 16 <command detect_errors="exit_code"> | 15 <command detect_errors="exit_code"> |
| 17 <![CDATA[ | 16 <![CDATA[ |
| 18 | |
| 19 #def get_type($data) | |
| 20 #if $data.is_of_type('fastq'): | |
| 21 #return 'fastq' | |
| 22 #elif $data.is_of_type('fasta'): | |
| 23 #return 'fasta' | |
| 24 #elif $data.is_of_type('fastqsanger'): | |
| 25 #return 'fastqsanger' | |
| 26 #elif $data.is_of_type('fasta.gz'): | |
| 27 #return 'fasta.gz' | |
| 28 #elif $data.is_of_type('fasta.bz2'): | |
| 29 #return 'fasta.bz2' | |
| 30 #elif $data.is_of_type('fastq.gz'): | |
| 31 #return 'fastq.gz' | |
| 32 #elif $data.is_of_type('fastq.bz2'): | |
| 33 #return 'fastq.bz2' | |
| 34 #end if | |
| 35 #end def | |
| 36 | |
| 37 kraken2 | 17 kraken2 |
| 38 --threads \${GALAXY_SLOTS:-1} | 18 --threads \${GALAXY_SLOTS:-1} |
| 39 --db '${kraken2_database.fields.path}' | 19 --db '${kraken2_database.fields.path}' |
| 40 | 20 |
| 41 $quick | 21 $quick |
| 42 | 22 |
| 43 #if $single_paired.single_paired_selector == "yes" | 23 #if $single_paired.single_paired_selector == "collection": |
| 44 --paired | |
| 45 '${single_paired.forward_input}' '${single_paired.reverse_input}' | |
| 46 #elif $single_paired.single_paired_selector == "collection": | |
| 47 --paired | 24 --paired |
| 48 '${single_paired.input_pair.forward}' '${single_paired.input_pair.reverse}' | 25 '${single_paired.input_pair.forward}' '${single_paired.input_pair.reverse}' |
| 49 #else: | 26 #else: |
| 50 '${single_paired.input_sequences}' | 27 '${single_paired.input_sequences}' |
| 51 #end if | 28 #end if |
| 52 | 29 |
| 53 #if $split_reads: | 30 #if $split_reads: |
| 54 #if $single_paired.single_paired_selector == "no": | 31 #if $single_paired.single_paired_selector == "no": |
| 55 --classified-out '${classified_out_s}' --unclassified-out '${unclassified_out_s}' | 32 --unclassified-out 'un_out' |
| 56 #elif $single_paired.single_paired_selector == "yes": | 33 --classified-out 'cl_out' |
| 57 #set $result = $get_type($single_paired.forward_input) | |
| 58 --unclassified-out 'un_out#.${result}' --classified-out 'cl_out#.${result}' | |
| 59 #else: | 34 #else: |
| 60 #set $result = $get_type($single_paired.input_pair.forward) | 35 --unclassified-out 'un_out#' |
| 61 --unclassified-out 'un_out#.${result}' --classified-out 'cl_out#.${result}' | 36 --classified-out 'cl_out#' |
| 62 #end if | 37 #end if |
| 63 #end if | 38 #end if |
| 64 | 39 |
| 65 --confidence '${confidence}' | 40 --confidence '${confidence}' |
| 66 --minimum-base-quality '${min_base_quality}' | 41 --minimum-base-quality '${min_base_quality}' |
| 67 --minimum-hit-groups '${minimum_hit_groups}' | 42 --minimum-hit-groups '${minimum_hit_groups}' |
| 68 | 43 |
| 69 $use_names | 44 $use_names |
| 70 | 45 |
| 71 #if $report.create_report: | 46 #if $report.create_report == "true": |
| 72 --report '${report_output}' | 47 --report '${report_output}' |
| 73 $report.use_mpa_style | 48 $report.use_mpa_style |
| 74 $report.report_zero_counts | 49 $report.report_zero_counts |
| 75 $report.report_minimizer_data | 50 $report.report_minimizer_data |
| 76 #end if | 51 #end if |
| 77 | 52 |
| 78 > '${output}' | 53 > '${output}' |
| 54 | |
| 55 #if $split_reads: | |
| 56 #if $single_paired.single_paired_selector == "no": | |
| 57 #if $single_paired.input_sequences.ext.endswith(".gz") | |
| 58 #set command = "gzip -c" | |
| 59 #elif $single_paired.input_sequences.ext.endswith(".bz2") | |
| 60 #set command = "bzip2 -c" | |
| 61 #else | |
| 62 #set command = "cat" | |
| 63 #end if | |
| 64 && $command un_out > '$unclassified_out_s' | |
| 65 && $command cl_out > '$classified_out_s' | |
| 66 #else: | |
| 67 #if $single_paired.input_pair.forward.ext.endswith(".gz") | |
| 68 #set command = "gzip -c" | |
| 69 #elif $single_paired.input_pair.forward.ext.endswith(".bz2") | |
| 70 #set command = "bzip2 -c" | |
| 71 #else | |
| 72 #set command = "cat" | |
| 73 #end if | |
| 74 && $command un_out_1 > '$out_unclassified_paired.forward' | |
| 75 && $command un_out_2 > '$out_unclassified_paired.reverse' | |
| 76 && $command cl_out_1 > '$out_classified_paired.forward' | |
| 77 && $command cl_out_1 > '$out_classified_paired.forward' | |
| 78 #end if | |
| 79 #end if | |
| 79 ]]></command> | 80 ]]></command> |
| 80 <inputs> | 81 <inputs> |
| 81 <conditional name="single_paired"> | 82 <conditional name="single_paired"> |
| 82 <param name="single_paired_selector" type="select" label="Single or paired reads" help="--paired"> | 83 <param name="single_paired_selector" type="select" label="Single or paired reads" help="--paired"> |
| 83 <option value="collection">Paired Collection</option> | 84 <option value="collection">Paired</option> |
| 84 <option value="yes">Paired</option> | |
| 85 <option selected="True" value="no">Single</option> | 85 <option selected="True" value="no">Single</option> |
| 86 </param> | 86 </param> |
| 87 <when value="collection"> | 87 <when value="collection"> |
| 88 <param format="@INTYPES@" name="input_pair" type="data_collection" collection_type="paired" label="Collection of paired reads"/> | 88 <param format="@INTYPES@" name="input_pair" type="data_collection" collection_type="paired" label="Collection of paired reads"/> |
| 89 </when> | |
| 90 <when value="yes"> | |
| 91 <param format="@INTYPES@" name="forward_input" type="data" label="Forward strand"/> | |
| 92 <param format="@INTYPES@" name="reverse_input" type="data" label="Reverse strand"/> | |
| 93 </when> | 89 </when> |
| 94 <when value="no"> | 90 <when value="no"> |
| 95 <param format="@INTYPES@" label="Input sequences" name="input_sequences" type="data"/> | 91 <param format="@INTYPES@" label="Input sequences" name="input_sequences" type="data"/> |
| 96 </when> | 92 </when> |
| 97 </conditional> | 93 </conditional> |
| 99 <param argument="--confidence" type="float" label="Confidence" value="0.0" min="0" max="1" help="Confidence score threshold. Must be in [0, 1]"/> | 95 <param argument="--confidence" type="float" label="Confidence" value="0.0" min="0" max="1" help="Confidence score threshold. Must be in [0, 1]"/> |
| 100 <param argument="--minimum-base-quality" name="min_base_quality" type="integer" label="Minimum Base Quality" value="0" help="Minimum base quality used in classification (only effective with FASTQ input)"/> | 96 <param argument="--minimum-base-quality" name="min_base_quality" type="integer" label="Minimum Base Quality" value="0" help="Minimum base quality used in classification (only effective with FASTQ input)"/> |
| 101 <param argument="--minimum-hit-groups" type="integer" label="Minimum hit groups" value="2" help="Number of overlapping k-mers sharing the same minimizer needed to make a call" /> | 97 <param argument="--minimum-hit-groups" type="integer" label="Minimum hit groups" value="2" help="Number of overlapping k-mers sharing the same minimizer needed to make a call" /> |
| 102 <param argument="--quick" type="boolean" truevalue="--quick" falsevalue="" label="Enable quick operation" help="Quick operation (use first hit)"/> | 98 <param argument="--quick" type="boolean" truevalue="--quick" falsevalue="" label="Enable quick operation" help="Quick operation (use first hit)"/> |
| 103 <param name="split_reads" type="boolean" label="Split classified and unclassified outputs?" help="Sets --unclassified-out and --classified-out"/> | 99 <param name="split_reads" type="boolean" label="Split classified and unclassified outputs?" help="Sets --unclassified-out and --classified-out"/> |
| 104 | 100 <conditional name="report"> |
| 105 <section name="report" title="Create Report" expanded="false"> | 101 <param argument="--report" name="create_report" type="select" label="Print a report with aggregrate counts/clade to file" help="Can be used as input for bracken"> |
| 106 <param name="create_report" type="boolean" label="Print a report with aggregrate counts/clade to file" help="--report" /> | 102 <option value="true">Yes</option> |
| 107 <param argument="--use-mpa-style" type="boolean" truevalue="--use-mpa-style" falsevalue="" label="Format report output like Kraken 1's kraken-mpa-report" /> | 103 <option value="false" selected="true">No</option> |
| 108 <param argument="--report-zero-counts" type="boolean" truevalue="--report-zero-counts" falsevalue="" label="Report counts for ALL taxa, even if counts are zero" /> | 104 </param> |
| 109 <param argument="--report-minimizer-data" type="boolean" truevalue="--report-minimizer-data" falsevalue="" label="Report minimizer data" help="Report minimizer and distinct minimizer count information in addition to normal Kraken report" /> | 105 <when value="true"> |
| 110 </section> | 106 <param argument="--use-mpa-style" type="boolean" truevalue="--use-mpa-style" falsevalue="" label="Format report output like Kraken 1's kraken-mpa-report" /> |
| 111 | 107 <param argument="--report-zero-counts" type="boolean" truevalue="--report-zero-counts" falsevalue="" label="Report counts for ALL taxa, even if counts are zero" /> |
| 108 <param argument="--report-minimizer-data" type="boolean" truevalue="--report-minimizer-data" falsevalue="" label="Report minimizer data" help="Report minimizer and distinct minimizer count information in addition to normal Kraken report" /> | |
| 109 </when> | |
| 110 <when value="false"/> | |
| 111 </conditional> | |
| 112 <expand macro="input_database"/> | 112 <expand macro="input_database"/> |
| 113 </inputs> | 113 </inputs> |
| 114 <outputs> | 114 <outputs> |
| 115 <data name="classified_out_s" format_source="input_sequences" label="${tool.name} on ${on_string}: Classified reads"> | 115 <data name="classified_out_s" format_source="input_sequences" label="${tool.name} on ${on_string}: Classified reads"> |
| 116 <filter>(split_reads and ('no' in single_paired['single_paired_selector']))</filter> | 116 <filter>split_reads and single_paired['single_paired_selector'] == "no"</filter> |
| 117 </data> | 117 </data> |
| 118 <data name="unclassified_out_s" format_source="input_sequences" label="${tool.name} on ${on_string}: Unclassified reads"> | 118 <data name="unclassified_out_s" format_source="input_sequences" label="${tool.name} on ${on_string}: Unclassified reads"> |
| 119 <filter>(split_reads and ('no' in single_paired['single_paired_selector']))</filter> | 119 <filter>split_reads and single_paired['single_paired_selector'] == "no"</filter> |
| 120 </data> | 120 </data> |
| 121 <data name="report_output" format="tabular" label="${tool.name} on ${on_string}: Report"> | 121 <data name="report_output" format="tabular" label="${tool.name} on ${on_string}: Report"> |
| 122 <filter>(report['create_report'])</filter> | 122 <filter>report['create_report'] == "true"</filter> |
| 123 </data> | 123 </data> |
| 124 | |
| 125 <data name="out1" format_source="forward_input" label="${tool.name} on ${on_string}: Unclassified forward reads" from_work_dir="un_out_1.*"> | |
| 126 <filter>(split_reads and ("yes" in single_paired['single_paired_selector']))</filter> | |
| 127 </data> | |
| 128 <data name="out2" format_source="forward_input" label="${tool.name} on ${on_string}: Unclassified reverse reads" from_work_dir="un_out_2.*"> | |
| 129 <filter>(split_reads and ("yes" in single_paired['single_paired_selector']))</filter> | |
| 130 </data> | |
| 131 <data name="out3" format_source="forward_input" label="${tool.name} on ${on_string}: Classified forward reads" from_work_dir="cl_out_1.*"> | |
| 132 <filter>(split_reads and ("yes" in single_paired['single_paired_selector']))</filter> | |
| 133 </data> | |
| 134 <data name="out4" format_source="forward_input" label="${tool.name} on ${on_string}: Classified reverse reads" from_work_dir="cl_out_2.*"> | |
| 135 <filter>(split_reads and ("yes" in single_paired['single_paired_selector']))</filter> | |
| 136 </data> | |
| 137 | |
| 138 <collection name="out_unclassified_paired" type="paired" format_source="input_pair" label="${tool.name} on ${on_string}: Unclassified read pairs"> | 124 <collection name="out_unclassified_paired" type="paired" format_source="input_pair" label="${tool.name} on ${on_string}: Unclassified read pairs"> |
| 139 <data name="forward" from_work_dir="un_out_1.*"/> | 125 <filter>split_reads and single_paired['single_paired_selector'] == "collection"</filter> |
| 140 <data name="reverse" from_work_dir="un_out_2.*"/> | |
| 141 <filter>(split_reads and ("collection" in single_paired['single_paired_selector']))</filter> | |
| 142 </collection> | 126 </collection> |
| 143 <collection name="out_classified_paired" type="paired" format_source="input_pair" label="${tool.name} on ${on_string}: Classified read pairs"> | 127 <collection name="out_classified_paired" type="paired" format_source="input_pair" label="${tool.name} on ${on_string}: Classified read pairs"> |
| 144 <data name="forward" from_work_dir="cl_out_1.*"/> | 128 <filter>split_reads and "collection" in single_paired['single_paired_selector'] == "collection"</filter> |
| 145 <data name="reverse" from_work_dir="cl_out_2.*"/> | |
| 146 <filter>(split_reads and ("collection" in single_paired['single_paired_selector']))</filter> | |
| 147 </collection> | 129 </collection> |
| 148 | 130 |
| 149 <data name="output" format="tabular" label="${tool.name} on ${on_string}: Classification"/> | 131 <data name="output" format="tabular" label="${tool.name} on ${on_string}: Classification"/> |
| 150 <!--<data format="tabular" label="${tool.name} on ${on_string}: Translated classification" name="translated" />--> | 132 <!--<data format="tabular" label="${tool.name} on ${on_string}: Translated classification" name="translated" />--> |
| 151 </outputs> | 133 </outputs> |
| 152 <tests> | 134 <tests> |
| 153 <test expect_num_outputs="1"> | 135 <test expect_num_outputs="1"> |
| 154 <param name="single_paired_selector" value="no"/> | 136 <conditional name="single_paired"> |
| 155 <param name="input_sequences" value="kraken_test1.fa" ftype="fasta"/> | 137 <param name="single_paired_selector" value="no"/> |
| 138 <param name="input_sequences" value="kraken_test1.fa" ftype="fasta"/> | |
| 139 </conditional> | |
| 156 <param name="split_reads" value="false"/> | 140 <param name="split_reads" value="false"/> |
| 157 <param name="quick" value="no"/> | 141 <param name="quick" value="no"/> |
| 158 <param name="confidence" value=".2"/> | 142 <param name="confidence" value=".2"/> |
| 159 <param name="kraken2_database" value="test_entry"/> | 143 <param name="kraken2_database" value="test_entry"/> |
| 160 <output name="output" file="kraken_test1_output.tab" ftype="tabular"/> | 144 <output name="output" file="kraken_test1_output.tab" ftype="tabular"/> |
| 161 </test> | 145 </test> |
| 162 <test expect_num_outputs="5"> | 146 |
| 163 <param name="single_paired_selector" value="yes"/> | 147 <test expect_num_outputs="3"> |
| 164 <param name="forward_input" value="kraken_test2_R1.fastq" ftype="fastq"/> | 148 <conditional name="single_paired"> |
| 165 <param name="reverse_input" value="kraken_test2_R2.fastq" ftype="fastq"/> | 149 <param name="single_paired_selector" value="no"/> |
| 150 <param name="input_sequences" value="kraken_test1.fa" ftype="fasta"/> | |
| 151 </conditional> | |
| 152 <param name="split_reads" value="true"/> | |
| 153 <param name="quick" value="no"/> | |
| 154 <param name="confidence" value=".2"/> | |
| 155 <param name="kraken2_database" value="test_entry"/> | |
| 156 <output name="output" file="kraken_test1_output.tab" ftype="tabular"/> | |
| 157 <output name="classified_out_s" file="kraken_test1_cl.fas" ftype="fasta"/> | |
| 158 <output name="unclassified_out_s" file="kraken_test1_un.fas" ftype="fasta"/> | |
| 159 </test> | |
| 160 | |
| 161 <test expect_num_outputs="7"> | |
| 162 <conditional name="single_paired"> | |
| 163 <param name="single_paired_selector" value="collection"/> | |
| 164 <param name="input_pair"> | |
| 165 <collection type="paired"> | |
| 166 <element name="forward" value="kraken_test2_R1.fastq.gz" ftype="fastqsanger.gz"/> | |
| 167 <element name="reverse" value="kraken_test2_R2.fastq.gz" ftype="fastqsanger.gz"/> | |
| 168 </collection> | |
| 169 </param> | |
| 170 <param name="single_paired_selector" value="collection"/> | |
| 171 </conditional> | |
| 166 <param name="split_reads" value="true"/> | 172 <param name="split_reads" value="true"/> |
| 167 <param name="quick" value="no"/> | 173 <param name="quick" value="no"/> |
| 168 <param name="confidence" value="0"/> | 174 <param name="confidence" value="0"/> |
| 169 <param name="kraken2_database" value="test_entry"/> | 175 <param name="kraken2_database" value="test_entry"/> |
| 170 <output name="out1" file="un_test2_output_1.fastq" ftype="fastq"/> | |
| 171 <output name="out2" file="un_test2_output_2.fastq" ftype="fastq"/> | |
| 172 <output name="out3" file="cl_test2_output_1.fastq" ftype="fastq"/> | |
| 173 <output name="out4" file="cl_test2_output_2.fastq" ftype="fastq"/> | |
| 174 <output name="output" file="kraken_test2_output.tab" ftype="tabular"/> | |
| 175 </test> | |
| 176 <!-- same test but collection in/output --> | |
| 177 <test expect_num_outputs="7"> | |
| 178 <param name="single_paired_selector" value="collection"/> | |
| 179 <param name="input_pair"> | |
| 180 <collection type="paired"> | |
| 181 <element name="forward" value="kraken_test2_R1.fastq" ftype="fastq"/> | |
| 182 <element name="reverse" value="kraken_test2_R2.fastq" ftype="fastq"/> | |
| 183 </collection> | |
| 184 </param> | |
| 185 <param name="split_reads" value="true"/> | |
| 186 <param name="quick" value="no"/> | |
| 187 <param name="confidence" value="0"/> | |
| 188 <param name="kraken2_database" value="test_entry"/> | |
| 189 <output_collection name="out_unclassified_paired" type="paired"> | 176 <output_collection name="out_unclassified_paired" type="paired"> |
| 190 <element name="forward" file="un_test2_output_1.fastq" ftype="fastq"/> | 177 <element name="forward" file="un_test2_output_1.fastq" ftype="fastqsanger.gz" decompress="true"/> |
| 191 <element name="reverse" file="un_test2_output_2.fastq" ftype="fastq"/> | 178 <element name="reverse" file="un_test2_output_2.fastq" ftype="fastqsanger.gz" decompress="true"/> |
| 192 </output_collection> | 179 </output_collection> |
| 193 <output_collection name="out_classified_paired" type="paired"> | 180 <output_collection name="out_classified_paired" type="paired"> |
| 194 <element name="forward" file="cl_test2_output_1.fastq" ftype="fastq"/> | 181 <element name="forward" file="cl_test2_output_1.fastq" ftype="fastqsanger.gz" decompress="true"/> |
| 195 <element name="reverse" file="cl_test2_output_2.fastq" ftype="fastq"/> | 182 <element name="reverse" file="cl_test2_output_2.fastq" ftype="fastqsanger.gz" decompress="true"/> |
| 196 </output_collection> | 183 </output_collection> |
| 197 <output name="output" file="kraken_test2_output.tab" ftype="tabular"/> | 184 <output name="output" file="kraken_test2_output.tab" ftype="tabular"/> |
| 198 </test> | 185 <assert_command> |
| 186 <has_text text="gzip -c"/> | |
| 187 </assert_command> | |
| 188 </test> | |
| 189 | |
| 199 <test expect_num_outputs="2"> | 190 <test expect_num_outputs="2"> |
| 200 <param name="single_paired_selector" value="yes"/> | 191 <conditional name="single_paired"> |
| 201 <param name="forward_input" value="kraken_test2_R1.fastq" ftype="fastq"/> | 192 <param name="single_paired_selector" value="collection"/> |
| 202 <param name="reverse_input" value="kraken_test2_R2.fastq" ftype="fastq"/> | 193 <param name="input_pair"> |
| 203 <param name="use-names" value="true"/> | 194 <collection type="paired"> |
| 204 <section name="report"> | 195 <element name="forward" value="kraken_test2_R1.fastq" ftype="fastqsanger"/> |
| 196 <element name="reverse" value="kraken_test2_R2.fastq" ftype="fastqsanger"/> | |
| 197 </collection> | |
| 198 </param> | |
| 199 </conditional> | |
| 200 <param name="use_names" value="true"/> | |
| 201 <conditional name="report"> | |
| 205 <param name="create_report" value="true"/> | 202 <param name="create_report" value="true"/> |
| 206 <param name="report_minimizer_data" value="true"/> | 203 <param name="report_minimizer_data" value="true"/> |
| 207 </section> | 204 </conditional> |
| 208 <param name="kraken2_database" value="test_entry"/> | 205 <param name="kraken2_database" value="test_entry"/> |
| 209 <output name="report_output" file="kraken_test2_report.tab" ftype="tabular"/> | 206 <output name="report_output" file="kraken_test2_report.tab" ftype="tabular"/> |
| 210 </test> | 207 </test> |
| 211 </tests> | 208 </tests> |
| 212 <help> | 209 <help> |
