diff tools/ncbi_blast_plus/ncbi_macros.xml @ 23:31e517610e1f draft

v0.3.0 Updated for NCBI BLAST+ 2.7.1
author peterjc
date Sat, 30 Jun 2018 17:22:46 -0400
parents 6f386c5dc4fb
children e25d3acf6e68
line wrap: on
line diff
--- a/tools/ncbi_blast_plus/ncbi_macros.xml	Mon Sep 18 06:21:27 2017 -0400
+++ b/tools/ncbi_blast_plus/ncbi_macros.xml	Sat Jun 30 17:22:46 2018 -0400
@@ -1,15 +1,17 @@
 <macros>
-    <token name="@WRAPPER_VERSION@">0.2.01</token>
+    <token name="@WRAPPER_VERSION@">0.3.0</token>
     <xml name="parallelism">
         <!-- If job splitting is enabled, break up the query file into parts -->
         <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" merge_outputs="output1" />
     </xml>
+
     <xml name="preamble">
         <requirements>
-            <requirement type="package" version="2.5.0">blast</requirement>
+            <requirement type="package" version="2.7.1">blast</requirement>
         </requirements>
         <version_command>@BINARY@ -version</version_command>
     </xml>
+
     <xml name="output_change_format">
         <change_format>
             <when input="output.out_format" value="0" format="txt"/>
@@ -21,6 +23,7 @@
             <when input="output.out_format" value="5" format="blastxml"/>
         </change_format>
     </xml>
+
     <xml name="input_out_format">
         <conditional name="output">
             <param name="out_format" argument="-outfmt" type="select" label="Output format">
@@ -108,6 +111,168 @@
             <when value="4 -html"/>
         </conditional>
     </xml>
+
+    <xml name="input_matrix_gapcosts">
+        <conditional name="matrix_gapcosts">
+            <param argument="-matrix" type="select" label="Scoring matrix and gap costs">
+                <option value="" selected="true">Use Defaults</option>
+                <option value="BLOSUM90">BLOSUM90</option>
+                <option value="BLOSUM80">BLOSUM80</option>
+                <option value="BLOSUM62">BLOSUM62</option>
+                <option value="BLOSUM50">BLOSUM50</option>
+                <option value="BLOSUM45">BLOSUM45</option>
+                <option value="PAM250">PAM250</option>
+                <option value="PAM70">PAM70</option>
+                <option value="PAM30">PAM30</option>
+            </param>
+            <when value="">
+            <!-- do nothing -->
+            </when>
+            <when value="BLOSUM90">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 9 -gapextend 2">Existence: 9  Extension: 2</option>
+                    <option value="-gapopen 8 -gapextend 2">Existence: 8  Extension: 2</option>
+                    <option value="-gapopen 7 -gapextend 2">Existence: 7  Extension: 2</option>
+                    <option value="-gapopen 6 -gapextend 2">Existence: 6  Extension: 2</option>
+                    <option value="-gapopen 11 -gapextend 1">Existence: 11  Extension: 1</option>
+                    <option value="-gapopen 10 -gapextend 1">Existence: 10  Extension: 1</option>
+                    <option value="-gapopen 9 -gapextend 1">Existence: 9  Extension: 1</option>
+                </param>
+
+            </when>
+            <when value="BLOSUM80">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 8 -gapextend 2">Existence: 8  Extension: 2</option>
+                    <option value="-gapopen 7 -gapextend 2">Existence: 7  Extension: 2</option>
+                    <option value="-gapopen 6 -gapextend 2">Existence: 6  Extension: 2</option>
+                    <option value="-gapopen 11 -gapextend 1">Existence: 11  Extension: 1</option>
+                    <option value="-gapopen 10 -gapextend 1">Existence: 10  Extension: 1</option>
+                    <option value="-gapopen 9 -gapextend 1">Existence: 9  Extension: 1</option>
+                </param>
+            </when>
+            <when value="BLOSUM62">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 11 -gapextend 2">Existence: 11  Extension: 2</option>
+                    <option value="-gapopen 10 -gapextend 2">Existence: 10  Extension: 2</option>
+                    <option value="-gapopen 9 -gapextend 2">Existence: 9  Extension: 2</option>
+                    <option value="-gapopen 8 -gapextend 2">Existence: 8  Extension: 2</option>
+                    <option value="-gapopen 7 -gapextend 2">Existence: 7  Extension: 2</option>
+                    <option value="-gapopen 6 -gapextend 2">Existence: 6  Extension: 2</option>
+                    <option value="-gapopen 13 -gapextend 1">Existence: 13  Extension: 1</option>
+                    <option value="-gapopen 12 -gapextend 1">Existence: 12  Extension: 1</option>
+                    <option value="-gapopen 11 -gapextend 1">Existence: 11  Extension: 1</option>
+                    <option value="-gapopen 10 -gapextend 1">Existence: 10  Extension: 1</option>
+                    <option value="-gapopen 9 -gapextend 1">Existence: 9  Extension: 1</option>
+                </param>
+
+            </when>
+            <when value="BLOSUM50">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 13 -gapextend 3">Existence: 13  Extension: 3</option>
+                    <option value="-gapopen 12 -gapextend 3">Existence: 12  Extension: 3</option>
+                    <option value="-gapopen 11 -gapextend 3">Existence: 11  Extension: 3</option>
+                    <option value="-gapopen 10 -gapextend 3">Existence: 10  Extension: 3</option>
+                    <option value="-gapopen 9 -gapextend 3">Existence: 9  Extension: 3</option>
+                    <option value="-gapopen 16 -gapextend 2">Existence: 16  Extension: 2</option>
+                    <option value="-gapopen 15 -gapextend 2">Existence: 15  Extension: 2</option>
+                    <option value="-gapopen 14 -gapextend 2">Existence: 14  Extension: 2</option>
+                    <option value="-gapopen 13 -gapextend 2">Existence: 13  Extension: 2</option>
+                    <option value="-gapopen 12 -gapextend 2">Existence: 12  Extension: 2</option>
+                    <option value="-gapopen 19 -gapextend 1">Existence: 19  Extension: 1</option>
+                    <option value="-gapopen 18 -gapextend 1">Existence: 18  Extension: 1</option>
+                    <option value="-gapopen 17 -gapextend 1">Existence: 17  Extension: 1</option>
+                    <option value="-gapopen 16 -gapextend 1">Existence: 16  Extension: 1</option>
+                    <option value="-gapopen 15 -gapextend 1">Existence: 15  Extension: 1</option>
+                </param>
+
+            </when>
+            <when value="BLOSUM45">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 13 -gapextend 3">Existence: 13  Extension: 3</option>
+                    <option value="-gapopen 12 -gapextend 3">Existence: 12  Extension: 3</option>
+                    <option value="-gapopen 11 -gapextend 3">Existence: 11  Extension: 3</option>
+                    <option value="-gapopen 10 -gapextend 3">Existence: 10  Extension: 3</option>
+                    <option value="-gapopen 15 -gapextend 2">Existence: 15  Extension: 2</option>
+                    <option value="-gapopen 14 -gapextend 2">Existence: 14  Extension: 2</option>
+                    <option value="-gapopen 13 -gapextend 2">Existence: 13  Extension: 2</option>
+                    <option value="-gapopen 12 -gapextend 2">Existence: 12  Extension: 2</option>
+                    <option value="-gapopen 19 -gapextend 1">Existence: 19  Extension: 1</option>
+                    <option value="-gapopen 18 -gapextend 1">Existence: 18  Extension: 1</option>
+                    <option value="-gapopen 17 -gapextend 1">Existence: 17  Extension: 1</option>
+                    <option value="-gapopen 16 -gapextend 1">Existence: 16  Extension: 1</option>
+                </param>
+            </when>
+            <when value="PAM250">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 15 -gapextend 3">Existence: 15  Extension: 3</option>
+                    <option value="-gapopen 14 -gapextend 3">Existence: 14  Extension: 3</option>
+                    <option value="-gapopen 13 -gapextend 3">Existence: 13  Extension: 3</option>
+                    <option value="-gapopen 12 -gapextend 3">Existence: 12  Extension: 3</option>
+                    <option value="-gapopen 17 -gapextend 2">Existence: 17  Extension: 2</option>
+                    <option value="-gapopen 16 -gapextend 2">Existence: 16  Extension: 2</option>
+                    <option value="-gapopen 15 -gapextend 2">Existence: 15  Extension: 2</option>
+                    <option value="-gapopen 14 -gapextend 2">Existence: 14  Extension: 2</option>
+                    <option value="-gapopen 13 -gapextend 2">Existence: 13  Extension: 2</option>
+                    <option value="-gapopen 21 -gapextend 1">Existence: 21  Extension: 1</option>
+                    <option value="-gapopen 20 -gapextend 1">Existence: 20  Extension: 1</option>
+                    <option value="-gapopen 19 -gapextend 1">Existence: 19  Extension: 1</option>
+                    <option value="-gapopen 18 -gapextend 1">Existence: 18  Extension: 1</option>
+                    <option value="-gapopen 17 -gapextend 1">Existence: 17  Extension: 1</option>
+                </param>
+
+            </when>
+            <when value="PAM70">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 12 -gapextend 3">Existence: 12 Extension: 3</option>
+                    <option value="-gapopen 11 -gapextend 2">Existence: 11 Extension: 2</option>
+                    <option value="-gapopen 8 -gapextend 2">Existence: 8  Extension: 2</option>
+                    <option value="-gapopen 7 -gapextend 2">Existence: 7  Extension: 2</option>
+                    <option value="-gapopen 6 -gapextend 2">Existence: 6  Extension: 2</option>
+                    <option value="-gapopen 11 -gapextend 1">Existence: 11  Extension: 1</option>
+                    <option value="-gapopen 10 -gapextend 1">Existence: 10  Extension: 1</option>
+                    <option value="-gapopen 9 -gapextend 1">Existence: 9  Extension: 1</option>
+                </param>
+
+            </when>
+            <when value="PAM30">
+                <param name="gap_costs" type="select" label="Gap Costs">
+                    <option value="" selected="true">Use defaults</option>
+                    <option value="-gapopen 15 -gapextend 3">Existence: 15 Extension: 3</option>
+                    <option value="-gapopen 13 -gapextend 3">Existence: 13 Extension: 3</option>
+                    <option value="-gapopen 14 -gapextend 2">Existence: 14 Extension: 2</option>
+                    <option value="-gapopen 7 -gapextend 2">Existence: 7  Extension: 2</option>
+                    <option value="-gapopen 6 -gapextend 2">Existence: 6  Extension: 2</option>
+                    <option value="-gapopen 5 -gapextend 2">Existence: 5  Extension: 2</option>
+                    <option value="-gapopen 14 -gapextend 1">Existence: 14 Extension: 1</option>
+                    <option value="-gapopen 10 -gapextend 1">Existence: 10  Extension: 1</option>
+                    <option value="-gapopen 9 -gapextend 1">Existence: 9  Extension: 1</option>
+                    <option value="-gapopen 8 -gapextend 1">Existence: 8  Extension: 1</option>
+                </param>
+            </when>
+        </conditional>
+    </xml>
+    <!-- these gapopen and gapextend macros are only used in blastn.
+        otherwise, the combined matrix/gapcosts macro is used -->
+    <xml name="input_gapopen">
+        <param argument="-gapopen" type="integer" optional="true" min="0"
+            label="Cost to open a gap"
+            help="Leave blank for default. See tool help for defaults."/>
+    </xml>
+
+    <xml name="input_gapextend">
+        <param argument="-gapextend" type="integer" optional="true" min="1"
+            label="Cost to extend a gap"
+            help="Leave blank for default. See tool help for defaults."/>
+    </xml>
+
+    <!-- this matrix macro is used in deltablast, makeprofiledb, psiblast, and tblastx -->
     <xml name="input_scoring_matrix">
         <param argument="-matrix" type="select" label="Scoring matrix">
             <option value="BLOSUM90">BLOSUM90</option>
@@ -120,9 +285,10 @@
             <option value="PAM30">PAM30</option>
         </param>
     </xml>
+
     <xml name="input_query_gencode">
         <param argument="-query_gencode" type="select" label="Query genetic code">
-            <!-- See http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi for details -->
+            <!-- See https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi for details -->
             <option value="1" selected="true">1. Standard</option>
             <option value="2">2. Vertebrate Mitochondrial</option>
             <option value="3">3. Yeast Mitochondrial</option>
@@ -143,9 +309,10 @@
             <option value="24">24. Pterobranchia mitochondrial code</option>
         </param>
     </xml>
+
     <xml name="input_db_gencode">
         <param argument="-db_gencode" type="select" label="Database/subject genetic code">
-            <!-- See http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi for details -->
+            <!-- See https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi for details -->
             <option value="1" selected="true">1. Standard</option>
             <option value="2">2. Vertebrate Mitochondrial</option>
             <option value="3">3. Yeast Mitochondrial</option>
@@ -166,6 +333,7 @@
             <option value="24">24. Pterobranchia mitochondrial code</option>
         </param>
     </xml>
+
     <xml name="input_conditional_nucleotide_db">
         <!-- Usually database argument mapped to -db, but -in in dustmasker -->
         <conditional name="db_opts">
@@ -189,10 +357,11 @@
             <when value="file">
                 <param name="database" type="hidden" value="" />
                 <param name="histdb" type="hidden" value="" />
-                <param argument="-subject" type="data" format="fasta" label="Nucleotide FASTA subject file to use instead of a database"/>
+                <param argument="-subject" type="data" format="fasta,fasta.gz" label="Nucleotide FASTA subject file to use instead of a database"/>
             </when>
         </conditional>
     </xml>
+
     <xml name="input_conditional_protein_db">
         <!-- Usually database argument mapped to -db, but -in in segmasker -->
         <conditional name="db_opts">
@@ -220,6 +389,7 @@
             </when>
         </conditional>
     </xml>
+
     <xml name="input_conditional_pssm">
         <conditional name="db_opts">
             <param name="db_opts_selector" type="select" label="Protein domain database (PSSM)">
@@ -240,6 +410,7 @@
             </when>
         </conditional>
     </xml>
+
     <xml name="input_conditional_choose_db_type">
         <conditional name="db_opts">
             <param argument="-db_type" type="select" label="Type of BLAST database">
@@ -258,25 +429,34 @@
             </when>
         </conditional>
     </xml>
+
     <xml name="input_parse_deflines">
         <param argument="-parse_deflines" type="boolean" label="Should the query and subject defline(s) be parsed?" truevalue="-parse_deflines" falsevalue="" checked="false" help="This affects the formatting of the query/subject ID strings"/>
     </xml>
+
     <xml name="input_filter_query_default_false">
         <param name="filter_query" argument="-seg" type="boolean" label="Filter out low complexity regions (with SEG)" truevalue="-seg yes" falsevalue="-seg no" checked="false" />
     </xml>
+
     <xml name="input_filter_query_default_true">
         <param name="filter_query" argument="-seg" type="boolean" label="Filter out low complexity regions (with SEG)" truevalue="-seg yes" falsevalue="-seg no" checked="true" />
     </xml>
+
     <xml name="input_max_hits">
         <param name="max_hits" type="integer" min="0" value="0" label="Maximum hits to show" help="Use zero for default limits" />
         <param argument="-max_hsps" type="integer" min="1" optional="true" value="" label="Maximum number of HSPs (alignments) to keep for any single query-subject pair" help="The HSPs shown will be the best as judged by expect value. If this option is not set, BLAST shows all HSPs meeting the expect value criteria" />
     </xml>
+
     <xml name="input_evalue">
         <param name="evalue_cutoff" argument="-evalue" type="float" size="15" value="0.001" label="Set expectation value cutoff" />
     </xml>
+
     <xml name="input_word_size">
-        <param argument="-word_size" type="integer" min="0" value="0" label="Word size for wordfinder algorithm" help="Use zero for default, otherwise minimum 2" />
+        <param argument="-word_size" type="integer" min="2" optional="true"
+        label="Word size for wordfinder algorithm"
+        help="Leave blank for default, otherwise minimum 2" />
     </xml>
+
     <xml name="input_strand">
         <param argument="-strand" type="select" label="Query strand(s) to search against database/subject">
             <option value="-strand both">Both</option>
@@ -284,9 +464,36 @@
             <option value="-strand minus">Minus (reverse complement)</option>
         </param>
     </xml>
+
     <xml name="input_qcov_hsp_perc">
         <param argument="-qcov_hsp_perc" type="float" value="0" min="0" max="100" label="Minimum query coverage per hsp (percentage, 0 to 100)" help="See also the output column qcovhsp"/>
     </xml>
+
+    <xml name="input_window_size">
+        <param argument="-window_size" type="integer" optional="true" min="0"
+            label="Multiple hits window size: use 0 to specify 1-hit algorithm, leave blank for default"
+            help="Default window size varies with substitution matrix and BLAST type. Enter an integer to override the default."/>
+    </xml>
+
+    <xml name="input_threshold">
+        <param argument="-threshold" type="integer" optional="true" min="0"
+            label="Minimum score to add a word to the BLAST lookup table."
+            help="Leave blank for default, which varies based on application."/>
+    </xml>
+
+    <xml name="input_comp_based_stats">
+        <param argument="-comp_based_stats" type="select"
+            label="Composition-based statistics"
+            help="The default value varies based on application and task. Most common default is 2.">
+            <option value="">Use default</option>
+            <option value="0">0: No composition-based statistics</option>
+            <option value="1">1: Composition-based statistics as in NAR 29:2994-3005, 2001</option>
+            <option value="2">2: Composition-based score adjustment as in Bioinformatics
+                21:902-911, 2005, conditioned on sequence properties</option>
+            <option value="3">3: Composition-based score adjustment as in Bioinformatics 21:902-911, 2005, unconditionally</option>
+        </param>
+    </xml>
+
     <xml name="advanced_options">
         <conditional name="adv_opts">
             <param name="adv_opts_selector" type="select" label="Advanced Options">
@@ -299,6 +506,7 @@
             </when>
         </conditional>
     </xml>
+
     <xml name="advanced_optional_id_files">
         <conditional name="adv_optional_id_files_opts">
             <param name="adv_optional_id_files_opts_selector" type="select"
@@ -324,31 +532,47 @@
             </when>
         </conditional>
     </xml>
-    <token name="@ADV_QCOV_HSP_PERC@">
-#if float(str($adv_opts.qcov_hsp_perc)) &gt; 0:
-    -qcov_hsp_perc $adv_opts.qcov_hsp_perc
+<!--Tokens-->
+    <token name="@ADV_MATRIX_GAPCOSTS@"><![CDATA[
+#if str($adv_opts.matrix_gapcosts.matrix):
+    -matrix '${adv_opts.matrix_gapcosts.matrix}'
+    ${adv_opts.matrix_gapcosts.gap_costs}
 #end if
-    </token>
-    <token name="@ADV_ID_LIST_FILTER@">
+    ]]></token>
+
+    <token name="@ADV_QCOV_HSP_PERC@"><![CDATA[
+#if float(str($adv_opts.qcov_hsp_perc)) > 0:
+    -qcov_hsp_perc '${adv_opts.qcov_hsp_perc}'
+#end if
+    ]]></token>
+
+    <token name="@ADV_ID_LIST_FILTER@"><![CDATA[
 #if $adv_opts.adv_optional_id_files_opts.adv_optional_id_files_opts_selector == 'negative_gilist':
-    -negative_gilist $adv_opts.adv_optional_id_files_opts.negative_gilist
+    -negative_gilist '${adv_opts.adv_optional_id_files_opts.negative_gilist}'
 #elif $adv_opts.adv_optional_id_files_opts.adv_optional_id_files_opts_selector == 'gilist':
-    -gilist $adv_opts.adv_optional_id_files_opts.gilist
+    -gilist '{$adv_opts.adv_optional_id_files_opts.gilist}'
 #elif $adv_opts.adv_optional_id_files_opts.adv_optional_id_files_opts_selector == 'seqidlist':
-    -seqidlist $adv_opts.adv_optional_id_files_opts.seqidlist
+    -seqidlist '${adv_opts.adv_optional_id_files_opts.seqidlist}'
 #end if
-    </token>
+    ]]></token>
+
     <token name="@THREADS@">-num_threads "\${GALAXY_SLOTS:-8}"</token>
-    <token name="@BLAST_DB_SUBJECT@">
+
+    <token name="@BLAST_DB_SUBJECT@"><![CDATA[
 #if $db_opts.db_opts_selector == "db":
   -db '${" ".join(str($db_opts.database.fields.path).split(","))}'
 #elif $db_opts.db_opts_selector == "histdb":
   -db '${os.path.join($db_opts.histdb.extra_files_path, "blastdb")}'
 #else:
-  -subject '$db_opts.subject'
+    #if $db_opts.subject.is_of_type('fasta.gz'):
+        -subject <(gunzip -c '${$db_opts.subject}')
+    #else:
+        -subject '${db_opts.subject}'
+    #end if
 #end if
-    </token>
-    <token name="@BLAST_OUTPUT@">-out '$output1'
+    ]]></token>
+
+    <token name="@BLAST_OUTPUT@"><![CDATA[ -out '$output1'
 ##Set the extended list here so when we add things, saved workflows are not affected
 #if str($output.out_format)=="ext":
     -outfmt '6 std sallseqid score nident positive gaps ppos qframe sframe qseq sseq qlen slen salltitles'
@@ -359,61 +583,102 @@
     -outfmt '6 $cols'
 #else:
 ## Note do not quote this as can be '0 -html' which is really two arguments
-    -outfmt $output.out_format
+    -outfmt ${output.out_format}
 #end if
-    </token>
+    ]]></token>
     <token name="@ADV_FILTER_QUERY@">$adv_opts.filter_query</token>
-    <token name="@ADV_MAX_HITS@">
+    <token name="@ADV_MAX_HITS@"><![CDATA[
 ## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string
 ## Note -max_target_seqs used to simply override -num_descriptions and -num_alignments
 ## but this was changed in BLAST+ 2.2.27 onwards to force their use (raised with NCBI)
 #if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0):
     #if str($output.out_format) in ["6", "ext", "cols", "5"]:
         ## Most output formats use this, including tabular and XML:
-        -max_target_seqs $adv_opts.max_hits
+        -max_target_seqs '${adv_opts.max_hits}'
     #else
         ## Text and HTML output formats 0-4 currently need this instead:
         -num_descriptions $adv_opts.max_hits -num_alignments $adv_opts.max_hits
     #end if
 #end if
 #if str($adv_opts.max_hsps)
-    -max_hsps $adv_opts.max_hsps
+    -max_hsps '${adv_opts.max_hsps}'
 #end if
-    </token>
-    <token name="@ADV_WORD_SIZE@">
-#if (str($adv_opts.word_size) and int(str($adv_opts.word_size)) > 0):
--word_size $adv_opts.word_size
+    ]]></token>
+    <token name="@ADV_WORD_SIZE@"><![CDATA[
+#if str($adv_opts.word_size):
+-word_size '${adv_opts.word_size}'
 #end if
 $adv_opts.parse_deflines
-    </token>
+    ]]></token>
+    <token name="@ADV_WINDOW_SIZE@"><![CDATA[
+#if str($adv_opts.window_size):
+-window_size '${adv_opts.window_size}'
+#end if
+    ]]></token>
+
+    <token name="@ADV_THRESHOLD@"><![CDATA[
+#if str($adv_opts.threshold):
+-threshold '${adv_opts.threshold}'
+#end if
+    ]]></token>
+
+    <token name="@ADV_COMP_BASED_STATS@"><![CDATA[
+#if str($adv_opts.comp_based_stats):
+-comp_based_stats '${adv_opts.comp_based_stats}'
+#end if
+    ]]></token>
+
+    <token name="@ADV_GAPOPEN@"><![CDATA[
+#if str($adv_opts.gapopen):
+-gapopen '${adv_opts.gapopen}'
+#end if
+    ]]></token>
+
+    <token name="@ADV_GAPEXTEND@"><![CDATA[
+#if str($adv_opts.gapextend):
+-gapextend '${adv_opts.gapextend}'
+#end if
+    ]]></token>
+
+    <token name="@ADV_MATRIX@"><![CDATA[
+#if str($adv_opts.matrix):
+-matrix '${adv_opts.matrix}'
+#end if
+    ]]></token>
+
     <!-- @ON_DB_SUBJECT@ is for use with @BLAST_DB_SUBJECT@ -->
-    <token name="@ON_DB_SUBJECT@">#if str($db_opts.db_opts_selector)=='db'
+    <token name="@ON_DB_SUBJECT@"><![CDATA[
+#if str($db_opts.db_opts_selector)=='db'
 '${db_opts.database}'
 #elif str($db_opts.db_opts_selector)=='histdb'
 '${db_opts.histdb.name}'
 #else
 '${db_opts.subject.name}'
-#end if</token>
-    <token name="@REFERENCES@">
+#end if
+]]></token>
+
+    <token name="@REFERENCES@"><![CDATA[
 Peter J. A. Cock, John M. Chilton, Björn Grüning, James E. Johnson, Nicola Soranzo (2015).
 NCBI BLAST+ integrated into Galaxy. *GigaScience* 4:39
-http://dx.doi.org/10.1186/s13742-015-0080-7
+https://doi.org/10.1186/s13742-015-0080-7
 
 Christiam Camacho et al. (2009).
 BLAST+: architecture and applications.
 *BMC Bioinformatics* 15;10:421.
-http://dx.doi.org/10.1186/1471-2105-10-421
+https://doi.org/10.1186/1471-2105-10-421
 
 This wrapper is available to install into other Galaxy Instances via the Galaxy
 Tool Shed at http://toolshed.g2.bx.psu.edu/view/devteam/ncbi_blast_plus
-    </token>
+    ]]></token>
     <xml name="blast_citations">
         <citations>
+            <citation type="doi">10.1093/nar/25.17.3389</citation>
             <citation type="doi">10.1186/1471-2105-10-421</citation>
             <citation type="doi">10.1186/s13742-015-0080-7</citation>
         </citations>
     </xml>
-    <token name="@OUTPUT_FORMAT@">**Output format**
+    <token name="@OUTPUT_FORMAT@"><![CDATA[
+**Output format**
 
 Because Galaxy focuses on processing tabular data, the default output of this
 tool is tabular. The standard BLAST+ tabular output contains 12 columns:
@@ -421,8 +686,8 @@
 ====== ========= ============================================
 Column NCBI name Description
 ------ --------- --------------------------------------------
-     1 qseqid    Query Seq-id (ID of your sequence)
-     2 sseqid    Subject Seq-id (ID of the database hit)
+     1 qaccver   Query accession dot version
+     2 saccver   Subject accession dot version (database hit)
      3 pident    Percentage of identical matches
      4 length    Alignment length
      5 mismatch  Number of mismatches
@@ -435,6 +700,12 @@
     12 bitscore  Bit score
 ====== ========= ============================================
 
+Until BLAST+ 2.5.0, the first two columns were ``qseqid`` and ``sseqid``,
+which were usually strings contained multiple pipe-separated entries.
+In BLAST+ 2.5.0, the first two columns became ``qacc`` and ``sacc``
+(accesion only), while in BLAST+ 2.6.0 this was changed again to use
+``qaccver`` and ``saccver`` (accession dot version).
+
 The BLAST+ tools can optionally output additional columns of information,
 but this takes longer to calculate. Many commonly used extra columns are
 included by selecting the extended tabular output. The extra columns are
@@ -457,7 +728,7 @@
     22 sseq          Aligned part of subject sequence
     23 qlen          Query sequence length
     24 slen          Subject sequence length
-    25 salltitles    All subject title(s), separated by a '&lt;&gt;'
+    25 salltitles    All subject title(s), separated by a '<>'
 ====== ============= ===========================================
 
 The third option is to customise the tabular output by selecting which
@@ -472,8 +743,9 @@
 The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
 The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
 and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).
-    </token>
-    <token name="@FASTA_WARNING@">.. class:: warningmark
+    ]]></token>
+    <token name="@FASTA_WARNING@"><![CDATA[
+.. class:: warningmark
 
 You can also search against a FASTA file of subject (target)
 sequences. This is *not* advised because it is slower (only one
@@ -481,12 +753,26 @@
 searches (very small e-values which will look overly signficiant).
 In most cases you should instead turn the other FASTA file into a
 database first using *makeblastdb* and search against that.
-    </token>
-    <token name="@SEARCH_TIME_WARNING@">.. class:: warningmark
+    ]]></token>
+    <token name="@SEARCH_TIME_WARNING@"><![CDATA[
+.. class:: warningmark
 
 **Note**. Database searches may take a substantial amount of time.
 For large input datasets it is advisable to allow overnight processing.
 
 -----
-    </token>
+    ]]></token>
+    <token name="@CLI_OPTIONS@"><![CDATA[
+**Advanced Options**
+
+For help with advanced options and their default values, visit the
+NCBI BLAST® Command Line Applications User Manual, Appendices,
+`Options for the command-line applications
+<https://www.ncbi.nlm.nih.gov/books/NBK279684/#_appendices_Options_for_the_commandline_a_>`_.
+
+For amino acid substitution matrices, see `BLAST Substitution Matrices
+<https://www.ncbi.nlm.nih.gov/books/NBK279684/#_appendices_BLAST_Substitution_Matrices_>`_ in the same
+appendices.
+
+    ]]></token>
 </macros>