# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User peterjc <p.j.a.cock@googlemail.com> # Date 1286381268 -3600 # Node ID c4c2b6eea3e11ee8a024b32f58419f7b1d36f114 # Parent 9bf65ebafa8fc89115a5b42ebb9865ed99c1cf84 Added support for BLAST+ -max_target_seqs option --- a/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml @@ -3,7 +3,8 @@ <command> ## The command is a Cheetah template which allows some Python based syntax. ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces -blastn -query "$query" +blastn +-query "$query" #if $db_opts.db_opts_selector == "db": -db "$db_opts.database" #else: @@ -16,6 +17,11 @@ blastn -query "$query" -out $output1 -outfmt $out_format -num_threads 8 +## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string +## Note -max_target_seqs overrides -num_descriptions and -num_alignments +#if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0): +-max_target_seqs $adv_opts.max_hits +#end if </command><inputs><param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/> @@ -62,6 +68,7 @@ blastn -query "$query" <when value="basic"><param name="filter_query" type="hidden" value="" /><param name="strand" type="hidden" value="" /> + <param name="max_hits" type="hidden" value="" /></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'level window linker' --> @@ -71,6 +78,10 @@ blastn -query "$query" <option value="-strand plus">Plus (forward)</option><option value="-strand minus">Minus (reverse complement)</option></param> + <!-- Why doesn't optional override a validator? I want to accept an empty string OR a non-negative integer --> + <param name="max_hits" type="integer" value="0" lable="Maximum hits to show" help="Use zero for default limits"> + <validator type="in_range" min="0" /> + </param></when></conditional></inputs> --- a/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml @@ -17,6 +17,11 @@ blastp -out $output1 -outfmt $out_format -num_threads 8 +## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string +## Note -max_target_seqs overrides -num_descriptions and -num_alignments +#if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0): +-max_target_seqs $adv_opts.max_hits +#end if </command><inputs><param name="query" type="data" format="fasta" label="Protein query sequence(s)"/> @@ -60,6 +65,7 @@ blastp <when value="basic"><param name="filter_query" type="hidden" value="" /><param name="matrix" type="hidden" value="" /> + <param name="max_hits" type="hidden" value="" /></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' --> @@ -74,6 +80,10 @@ blastp <option value="-matrix PAM70">PAM70</option><option value="-matrix PAM30">PAM30</option></param> + <!-- Why doesn't optional override a validator? I want to accept an empty string OR a non-negative integer --> + <param name="max_hits" type="integer" value="0" lable="Maximum hits to show" help="Use zero for default limits"> + <validator type="in_range" min="0" /> + </param></when></conditional></inputs> --- a/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml @@ -17,6 +17,11 @@ tblastx -out $output1 -outfmt $out_format -num_threads 8 +## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string +## Note -max_target_seqs overrides -num_descriptions and -num_alignments +#if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0): +-max_target_seqs $adv_opts.max_hits +#end if </command><inputs><param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/> @@ -57,6 +62,7 @@ tblastx <param name="filter_query" type="hidden" value="" /><param name="strand" type="hidden" value="" /><param name="matrix" type="hidden" value="" /> + <param name="max_hits" type="hidden" value="" /></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' --> @@ -76,6 +82,10 @@ tblastx <option value="-matrix PAM70">PAM70</option><option value="-matrix PAM30">PAM30</option></param> + <!-- Why doesn't optional override a validator? I want to accept an empty string OR a non-negative integer --> + <param name="max_hits" type="integer" value="0" lable="Maximum hits to show (in plain text output)" help="Use zero for default limits"> + <validator type="in_range" min="0" /> + </param></when></conditional></inputs> --- a/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml @@ -17,6 +17,11 @@ blastx -out $output1 -outfmt $out_format -num_threads 8 +## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string +## Note -max_target_seqs overrides -num_descriptions and -num_alignments +#if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0): +-max_target_seqs $adv_opts.max_hits +#end if </command><inputs><param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/> @@ -57,6 +62,7 @@ blastx <param name="filter_query" type="hidden" value="" /><param name="strand" type="hidden" value="" /><param name="matrix" type="hidden" value="" /> + <param name="max_hits" type="hidden" value="" /></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' --> @@ -76,7 +82,10 @@ blastx <option value="-matrix PAM70">PAM70</option><option value="-matrix PAM30">PAM30</option></param> - + <!-- Why doesn't optional override a validator? I want to accept an empty string OR a non-negative integer --> + <param name="max_hits" type="integer" value="0" lable="Maximum hits to show" help="Use zero for default limits"> + <validator type="in_range" min="0" /> + </param></when></conditional></inputs> --- a/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml +++ b/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml @@ -16,6 +16,11 @@ tblastn -out $output1 -outfmt $out_format -num_threads 8 +## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string +## Note -max_target_seqs overrides -num_descriptions and -num_alignments +#if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0): +-max_target_seqs $adv_opts.max_hits +#end if </command><inputs><param name="query" type="data" format="fasta" label="Protein query sequence(s)"/> @@ -55,6 +60,7 @@ tblastn <when value="basic"><param name="filter_query" type="hidden" value="" /><param name="matrix" type="hidden" value="" /> + <param name="max_hits" type="hidden" value="" /></when><when value="advanced"><!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' --> @@ -69,6 +75,10 @@ tblastn <option value="-matrix PAM70">PAM70</option><option value="-matrix PAM30">PAM30</option></param> + <!-- Why doesn't optional override a validator? I want to accept an empty string OR a non-negative integer --> + <param name="max_hits" type="integer" value="0" lable="Maximum hits to show" help="Use zero for default limits"> + <validator type="in_range" min="0" /> + </param></when></conditional></inputs>