view msfragger_macros.xml @ 3:da9ebef968bd draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/fragpipe commit b1b03bb7cd31c1ec806b286d6c9444428b358e15
author galaxyp
date Thu, 12 Sep 2024 08:06:44 +0000
parents 14785481da2b
children
line wrap: on
line source

<macros>

    <!-- Utility functions for linking input files -->
    <token name="@CMD_IMPORTS@"><![CDATA[
        #import re
        #def identifier_or_name($input1)
            #if hasattr($input1, 'element_identifier')
                #return $input1.element_identifier
            #else
                #return $input1.name
            #end if
        #end def
        #def clean($name1)
            #set $name_clean = $re.sub('[^\w\-_]', '_', $re.sub('(?i)[.](fa|fas|fasta|imzml|mzml|mzxml|raw)$','', $re.sub('.*/','', $name1.rstrip('.gz'))))
            #return $name_clean
        #end def
        #def ln_name($ds)
            #set $ext = ''
            #if $ds.is_of_type('mzml') or $ds.is_of_type('imzml')
                #set $ext = ".mzML"
            #else if $ds.is_of_type('mzxml')
                #set $ext = ".mzXML"
            #else if $ds.is_of_type('mgf')
                #set $ext = ".mgf"
            #else if $ds.is_of_type('thermo.raw')
                #set $ext = ".raw"
            #else if $ds.is_of_type('fasta')
                #set $ext = ".fasta"
            #end if
            #set $name = "%s%s" % ($clean($identifier_or_name($ds)),$ext)
            #return $name
        #end def
        #set $i_names = []
        #set $db_name = None
    ]]></token>

    <!-- The following xml elements define the parameters for each given workflow -->
    <xml name="msfragger_default">
        <expand macro="search_tolerances"/>
        <expand macro="digestion"/>
        <expand macro="variable_modification"/>
        <expand macro="static_modification"/>
        <expand macro="glyco_labile"/>
        <expand macro="mass_offsets"/>
        <expand macro="spectrum_processing"/>
        <expand macro="open_search_options"/>
        <expand macro="modeling_output"/>
        <expand macro="advanced_options"/>
    </xml>
    <xml name="msfragger_open">
        <expand macro="search_tolerances"/>
        <expand macro="digestion"/>
        <expand macro="variable_modification"/>
        <expand macro="static_modification"/>
        <expand macro="glyco_labile"/>
        <expand macro="mass_offsets"/>
        <expand macro="spectrum_processing" mode_selected="false" mode_corrected="true"/>
        <expand macro="open_search_options" localize="true"/>
        <expand macro="modeling_output"/>
        <expand macro="advanced_options"/>
    </xml>
    <xml name="msfragger_nonspecific_HLA">
        <expand macro="search_tolerances" precursor_mass_lower="-20" precursor_mass_upper="20"/>
        <expand macro="digestion" stricttrypsin="false" nonspecific="true" digest_max_length="25" termini_0="true" termini_2="false"/>
        <expand macro="variable_modification"/>
        <expand macro="static_modification"/>
        <expand macro="glyco_labile"/>
        <expand macro="mass_offsets"/>
        <expand macro="spectrum_processing" transform_none="false" transform_sqrt="true"/>
        <expand macro="open_search_options"/>
        <expand macro="modeling_output"/>
        <expand macro="advanced_options"/>
    </xml>
    <xml name="msfragger_LFQ_MBR">
        <expand macro="search_tolerances"/>
        <expand macro="digestion"/>
        <expand macro="variable_modification"/>
        <expand macro="static_modification"/>
        <expand macro="glyco_labile"/>
        <expand macro="mass_offsets"/>
        <expand macro="spectrum_processing"/>
        <expand macro="open_search_options"/>
        <expand macro="modeling_output"/>
        <expand macro="advanced_options"/>
    </xml>
    <xml name="msfragger_TMT">
        <expand macro="search_tolerances"/>
        <expand macro="digestion" digest_mass_range_min="200.0"/>
        <expand macro="variable_modification"/>
        <expand macro="static_modification"/>
        <expand macro="glyco_labile"/>
        <expand macro="mass_offsets"/>
        <expand macro="spectrum_processing" clear_mz_range_min="125.5" clear_mz_range_max="131.5"/>
        <expand macro="open_search_options"/>
        <expand macro="modeling_output"/>
        <expand macro="advanced_options"/>
    </xml>

    <!--
      The following elements define specific MSFragger configuration sections. Each xml macro is followed by a token element that enters
      the parameters into a global msfragger_dict dictionary. This dictionary is used to generate a <configfile> configuration file.
    -->
    <xml name="search_tolerances" token_precursor_ppm="false" token_precursor_da="false" token_precursor_mass_lower="-50" token_precursor_mass_upper="50" token_isotope_error="" token_fragment_mass_tolerance="20">
        <section name="search_tolerances" expanded="false" title="Search Tolerances">

            <conditional name="precursor">
                <param name="precursor_mass_units" type="select" label="Set Precursor Mass tolerances" help="Sets default parameters">
                    <option value="default">Use default</option>
                    <option value="ppm" selected="@PRECURSOR_PPM@">ppm</option>
                    <option value="Da" selected="@PRECURSOR_DA@">Daltons</option>
                </param>
                <when value="default"/>
                <when value="ppm">
                    <param argument="precursor_mass_lower" type="integer" value="@PRECURSOR_MASS_LOWER@" max="0" optional="true" label="Precursor mass tolerance lower bound" />
                    <param argument="precursor_mass_upper" type="integer" value="@PRECURSOR_MASS_UPPER@" min="0" optional="true" label="Precursor mass tolerance upper bound" />
                </when>
                <when value="Da">
                    <param argument="precursor_mass_lower" type="float" max="0" optional="true" label="Precursor mass tolerance lower bound" />
                    <param argument="precursor_mass_upper" type="float" min="0" optional="true" label="Precursor mass tolerance upper bound" />
                </when>
            </conditional>

            <conditional name="precursor_true">
                <param name="precursor_true_units" type="select" label="Set Precursor True tolerance" help="STRONGLY recommended for open searches">
                    <option value="default">Use default</option>
                    <option value="ppm">ppm</option>
                    <option value="Da">Daltons</option>
                </param>
                <when value="default"/>
                <when value="ppm">
                    <param name="precursor_true_tolerance" type="integer" min="1" max="100" optional="true" label="Precursor true tolerance"
                        help="True precursor mass tolerance (window is +/- this value). Used for tie breaker of results (in spectrally ambiguous cases) and zero bin boosting in open searches (0 disables these features). This option is STRONGLY recommended for open searches.  Default: 0"/>
                </when>
                <when value="Da">
                    <param name="precursor_true_tolerance" type="float" min="0" max="10" optional="true" label="Precursor true tolerance"
                        help="True precursor mass tolerance (window is +/- this value). Used for tie breaker of results (in spectrally ambiguous cases) and zero bin boosting in open searches (0 disables these features). This option is STRONGLY recommended for open searches.  Default: 0"/>
                </when>
            </conditional>

            <conditional name="fragment">
                <param name="fragment_mass_units" type="select" label="Set Fragment Mass tolerances" help="Sets default parameters">
                    <option value="default">Use default</option>
                    <option value="ppm" selected="true">ppm</option>
                    <option value="Da">Daltons</option>
                </param>
                <when value="default"/>
                <when value="ppm">
                    <param name="fragment_mass_tolerance" type="integer" value="@FRAGMENT_MASS_TOLERANCE@" min="1" max="100" optional="true" label="Fragment mass tolerance"
                        help="Fragment mass tolerance (window is +/- this value) Default: 20"/>
                </when>
                <when value="Da">
                    <param name="fragment_mass_tolerance" type="float" min="0" max="100" optional="true" label="Fragment mass tolerance"
                        help="Fragment mass tolerance"/>
                </when>
            </conditional>

            <param argument="isotope_error" type="select" optional="true" label="Isotope error">
                <help>
Isotope correction for MS/MS events triggered on isotopic peaks. Should be set to 0 (disabled) for open search or 0/1/2 for correction of narrow window searches. Shifts the precursor mass window to multiples of this value multiplied by the mass of C13-C12.
                </help>
                <option value="0">0 - Disabled (for open search)</option>
                <option value="0/1">0/1 - (Nonspecific)</option>
                <option value="0/1/2">0/1/2 - (Correction for narrow window searches)</option>
                <option value="0/1/2/3">0/1/2/3</option>
                <option value="-1/0/1/2/3">-1/0/1/2/3</option>
            </param>
            <param argument="calibrate_mass" type="select" label="Calibration and Optimization">
                <option value="0">0 - None</option>
                <option value="1">1 - Mass calibration</option>
                <option value="2" selected="true">2 - Mass calibration, parameter optimization</option>
            </param>
        </section>
    </xml>

    <token name="@SEARCH_TOLERANCES@"><![CDATA[
        ## Search Tolerances

        #if $prefix.search_tolerances.precursor.precursor_mass_units == 'Da'
            #set $msfragger_dict['precursor_mass_units'] = 0
        #elif $prefix.search_tolerances.precursor.precursor_mass_units == 'ppm'
            #set $msfragger_dict['precursor_mass_units'] = 1
        #end if
        #if $prefix.search_tolerances.precursor.precursor_mass_units != 'default'
            #if $prefix.search_tolerances.precursor.precursor_mass_lower != ''
                #set $msfragger_dict['precursor_mass_lower'] = $prefix.search_tolerances.precursor.precursor_mass_lower
            #end if
            #if $prefix.search_tolerances.precursor.precursor_mass_upper != ''
                #set $msfragger_dict['precursor_mass_upper'] = $prefix.search_tolerances.precursor.precursor_mass_upper
            #end if
        #end if

        #if $prefix.search_tolerances.precursor_true.precursor_true_units == 'Da'
            #set $msfragger_dict['precursor_true_units'] = 0
        #elif $prefix.search_tolerances.precursor_true.precursor_true_units == 'ppm'
            #set $msfragger_dict['precursor_true_units'] = 1
        #end if
        #if $prefix.search_tolerances.precursor_true.precursor_true_units != 'default'
            #if $prefix.search_tolerances.precursor_true.precursor_true_tolerance != ''
                #set $msfragger_dict['precursor_true_tolerance'] = $prefix.search_tolerances.precursor_true.precursor_true_tolerance
            #end if
        #end if

        #if $prefix.search_tolerances.fragment.fragment_mass_units == 'Da'
            #set $msfragger_dict['fragment_mass_units'] = 0
        #elif $prefix.search_tolerances.fragment.fragment_mass_units == 'ppm'
            #set $msfragger_dict['fragment_mass_units'] = 1
        #end if
        #if $prefix.search_tolerances.fragment.fragment_mass_units != 'default'
            #if $prefix.search_tolerances.fragment.fragment_mass_tolerance != ''
                #set $msfragger_dict['fragment_mass_tolerance'] = $prefix.search_tolerances.fragment.fragment_mass_tolerance
            #end if
        #end if

        #if $prefix.search_tolerances.isotope_error != 'None'
            #set $msfragger_dict['isotope_error'] = $prefix.search_tolerances.isotope_error
        #end if
        #if $prefix.search_tolerances.calibrate_mass != 'None'
            #set $msfragger_dict['calibrate_mass'] = $prefix.search_tolerances.calibrate_mass
        #end if
    ]]></token>

    <xml name="cleavage" token_search_enzyme_name="trypsin" token_cut="KR" token_nocut="P">
            <param name="search_enzyme_name" type="text" value="@SEARCH_ENZYME_NAME@"
                label="Digestion Enzyme" help="Name of enzyme to be written to the pepXML file."/>
            <param name="search_enzyme_cut" type="text" value="@CUT@"
                label="Residues after which the enzyme cuts" help="search_enzyme_cutafter Residues after which the enzyme cuts Default: KR"/>
            <param name="search_enzyme_nocut" type="text" value="@NOCUT@"
                label="Residues that the enzyme will not cut before" help="search_enzyme_butnotafter - (misnomer: should really be called butnotbefore) Default: P"/>
    </xml>
                              <!-- wagnerr here in final param review -->
    <xml name="digest" token_stricttrypsin="true" token_nonspecific="false">
            <conditional name="digest">
                <param name="search_enzyme" type="select" label="Protein Digestion Enzyme">
                    <option value="trypsin">trypsin</option>
                    <option value="stricttrypsin" selected="@STRICTTRYPSIN@">stricttrypsin</option>
                    <option value="argc">argc</option>
                    <option value="chymotrypsin">chymotrypsin</option>
                    <option value="cnbr">cnbr</option>
                    <option value="elastase">elastase</option>
                    <option value="formicacid">formicacid</option>
                    <option value="gluc">gluc</option>
                    <option value="gluc_bicarb">gluc_bicarb</option>
                    <option value="lysc">lysc</option>
                    <option value="lysc-p">lysc-p</option>
                    <option value="nonspecific" selected="@NONSPECIFIC@">nonspecific</option>
                    <option value="custom">custom</option>
                    <option value="trypsin/chymotrypsin">trypsin/chymotrypsin</option>
                    <option value="trypsin/cnbr">trypsin/cnbr</option>
                    <option value="trypsin_gluc">trypsin_gluc</option>
                    <option value="trypsin_k">trypsin_k</option>
                    <option value="trypsin_r">trypsin_r</option>
                </param>
                <when value="trypsin">
                    <expand macro="cleavage" search_enzyme_name="trypsin" cut="KR" nocut="P"/>
                </when>
                <when value="stricttrypsin">
                    <expand macro="cleavage" search_enzyme_name="stricttrypsin" cut="KR" nocut=""/>
                </when>
                <when value="argc">
                    <expand macro="cleavage" search_enzyme_name="argc" cut="R" nocut="P"/>
                </when>
                <when value="chymotrypsin">
                    <expand macro="cleavage" search_enzyme_name="chymotrypsin" cut="FLWY" nocut="P"/>
                </when>
                <when value="cnbr">
                    <expand macro="cleavage" search_enzyme_name="cnbr" cut="M" nocut=""/>
                </when>
                <when value="elastase">
                    <expand macro="cleavage" search_enzyme_name="elastase" cut="AGILV" nocut="P"/>
                </when>
                <when value="formicacid">
                    <expand macro="cleavage" search_enzyme_name="formicacid" cut="D" nocut="P"/>
                </when>
                <when value="gluc">
                    <expand macro="cleavage" search_enzyme_name="gluc" cut="DE" nocut="P"/>
                </when>
                <when value="gluc_bicarb">
                    <expand macro="cleavage" search_enzyme_name="gluc_bicarb" cut="E" nocut="P"/>
                </when>
                <when value="lysc">
                    <expand macro="cleavage" search_enzyme_name="lysc" cut="K" nocut="P"/>
                </when>
                <when value="lysc-p">
                    <expand macro="cleavage" search_enzyme_name="lysc-p" cut="K" nocut=""/>
                </when>
                <when value="nonspecific">
                    <expand macro="cleavage" search_enzyme_name="nonspecific" cut="-" nocut=""/>
                 </when>
                <when value="custom">
                    <expand macro="cleavage" search_enzyme_name="custom" cut="" nocut=""/>
                </when>
                <when value="trypsin/chymotrypsin">
                    <expand macro="cleavage" search_enzyme_name="trypsin/chymotrypsin" cut="FYWLKR" nocut="P"/>
                </when>
                <when value="trypsin/cnbr">
                    <expand macro="cleavage" search_enzyme_name="trypsin/cnbr" cut="KR" nocut="P"/>
                </when>
                <when value="trypsin_gluc">
                    <expand macro="cleavage" search_enzyme_name="trypsin_gluc" cut="DEKR" nocut="P"/>
                </when>
                <when value="trypsin_k">
                    <expand macro="cleavage" search_enzyme_name="trypsin_k" cut="K" nocut="P"/>
                </when>
                <when value="trypsin_r">
                    <expand macro="cleavage" search_enzyme_name="trypsin_r" cut="R" nocut="P"/>
                </when>
            </conditional>
            <param name="allowed_missed_cleavage" type="integer" value="2" min="0" max="5" optional="true"
                label="Allowed number of missed cleavages"/>
            <param name="search_enzyme_sense" type="select" label="Protein Digestion Enzyme">
                <option value="C">C</option>
                <option value="N">N</option>
            </param>
    </xml>

    <xml name="digestion" token_stricttrypsin="true" token_nonspecific="false" token_digest_max_length="50" token_termini_0="false" token_termini_1="false" token_termini_2="true" token_digest_mass_range_min="500.0" token_digest_mass_range_max="5000.0">
        <section name="digestion" expanded="false" title="In-silico Digestion Parameters">
            <expand macro="digest" stricttrypsin="@STRICTTRYPSIN@" nonspecific="@NONSPECIFIC@"/>
            <conditional name="enzyme2">
                <param name="digest2" type="select" label="Second Enzyme Digest">
                    <option value="no">No</option>
                    <option value="yes">Yes</option>
                </param>
                <when value="no"/>
                <when value="yes">
                    <expand macro="digest" stricttrypsin="false" nonspecific="false"/>
                </when>
            </conditional>
            <param name="num_enzyme_termini" type="select" label="Number of enzyme termini">
                <option value="0" selected="@TERMINI_0@">0 - non-enzymatic</option>
                <option value="1" selected="@TERMINI_1@">1 - semi-enzymatic</option>
                <option value="2" selected="@TERMINI_2@">2 - fully-enzymatic</option>
            </param>
            <param name="digest_min_length" type="integer" value="7" min="1" max="30" optional="true"
                label="Minimum length of peptides to be generated during in-silico digestion"/>
            <param name="digest_max_length" type="integer" value="@DIGEST_MAX_LENGTH@" min="10" max="100" optional="true"
                label="Maximum length of peptides to be generated during in-silico digestion"/>
            <param name="digest_mass_range_min" type="float" value="@DIGEST_MASS_RANGE_MIN@" min="0.0" optional="true"
                label="Minimum Mass of peptides to be generated during in-silico digestion in Daltons" />
            <param name="digest_mass_range_max" type="float" value="@DIGEST_MASS_RANGE_MAX@" min="0.0" optional="true"
                label="Maximum Mass of peptides to be generated during in-silico digestion in Daltons" />
        </section>
    </xml>
    <token name="@DIGESTION@"><![CDATA[
        ## digest parameters
        ##enzyme_1
        #set $msfragger_dict['search_enzyme_name_1'] = $prefix.digestion.digest.search_enzyme_name
        #set $msfragger_dict['misc.fragger.enzyme-dropdown-1'] = $prefix.digestion.digest.search_enzyme_name
        #set $msfragger_dict['search_enzyme_cut_1'] = $prefix.digestion.digest.search_enzyme_cut
        #set $msfragger_dict['search_enzyme_nocut_1'] = $prefix.digestion.digest.search_enzyme_nocut
        #if $prefix.digestion.allowed_missed_cleavage != ''
            #set $msfragger_dict['allowed_missed_cleavage_1'] = $prefix.digestion.allowed_missed_cleavage
        #end if
        #if $prefix.digestion.search_enzyme_sense != 'None'
            #set $msfragger_dict['search_enzyme_sense_1'] = $prefix.digestion.search_enzyme_sense
        #end if
        ##enzyme_2
        #if $prefix.digestion.enzyme2.digest2 == 'yes'
            #set $msfragger_dict['search_enzyme_name_2'] = $prefix.digestion.enzyme2.digest.search_enzyme_name
            #set $msfragger_dict['misc.fragger.enzyme-dropdown-2'] = $prefix.digestion.enzyme2.digest.search_enzyme_name
            #set $msfragger_dict['search_enzyme_cut_2'] = $prefix.digestion.enzyme2.digest.search_enzyme_cut
            #set $msfragger_dict['search_enzyme_nocut_2'] = $prefix.digestion.enzyme2.digest.search_enzyme_nocut
            #if $prefix.digestion.enzyme2.allowed_missed_cleavage != ''
                #set $msfragger_dict['allowed_missed_cleavage_2'] = $prefix.digestion.enzyme2.allowed_missed_cleavage
            #end if
            #if $prefix.digestion.enzyme2.search_enzyme_sense != 'None'
                #set $msfragger_dict['search_enzyme_sense_2'] = $prefix.digestion.enzyme2.search_enzyme_sense
            #end if
        #else
            #set $msfragger_dict['search_enzyme_sense_2'] = 'C'
        #end if
        #if $prefix.digestion.num_enzyme_termini != 'None'
            #set $msfragger_dict['num_enzyme_termini'] = $prefix.digestion.num_enzyme_termini
        #end if
        #if $prefix.digestion.digest_min_length != ''
            #set $msfragger_dict['digest_min_length'] = $prefix.digestion.digest_min_length
        #end if
        #if $prefix.digestion.digest_max_length != ''
            #set $msfragger_dict['digest_max_length'] = $prefix.digestion.digest_max_length
        #end if
        #if $prefix.digestion.digest_mass_range_min != ''
            #set $msfragger_dict['misc.fragger.digest-mass-lo'] = $prefix.digestion.digest_mass_range_min
        #end if
        #if $prefix.digestion.digest_mass_range_min != ''
            #set $msfragger_dict['misc.fragger.digest-mass-hi'] = $prefix.digestion.digest_mass_range_max
        #end if
    ]]></token>

    <xml name="variable_modifications">
        <option value="15.99491461956 M 3">Oxidation of M (15.99491461956) modaa</option>
        <option value="42.0105646837 &#91;^ 1">Acetylation of peptide N-term (42.0105646837) modn_peptide</option>
        <option value="79.96633052074999 STY 3">Phosphorylation of STY (79.96633052074999) modaa</option>
        <option value="229.16293213472 n^ 1">TMT 10-plex of peptide N-term (229.16293213472) modn_peptide</option>
        <option value="229.169252 n^ 1">TMT 11-plex of peptide N-term (229.169252) modn_peptide</option>
        <option value="229.16293213472 S 1">TMT 10-plex of S (229.16293213472) modaa</option>
        <option value="229.169252 S 1">TMT 11-plex of S (229.169252) modaa</option>
        <option value="-18.0105646837 nE 1">Pyrolidone from E (-18.0105646837) modnaa_peptide</option>
    </xml>

    <token name="@RE_FLOAT@">[+-]?\d+(\.\d*)?</token>
    <token name="@RE_AA@">([A-Z]+|(c[A-Z*])+|(n[\^A-Z*])+|\[\^|\])</token>
    <token name="@RE_MOD@">@RE_FLOAT@,@RE_AA@,\d</token>
    <token name="@RE_MODS@">@RE_MOD@(;\s*@RE_MOD@)*</token>
    <xml name="variable_modification" token_max_variable_mods_per_peptide="3">
        <section name="variable_modification" expanded="false" title="Variable Modifications">
            <param name="max_variable_mods_per_peptide" type="integer" value="@MAX_VARIABLE_MODS_PER_PEPTIDE@" min="0" max="5" optional="true"
                label="Maximum total number of variable modifications per peptide"/>
            <param name="variable_mods_select" type="select" optional="true" multiple="true" label="Select Variable Modifications">
                <expand macro="variable_modifications"/>
            </param>
            <param name="variable_mods" type="text" area="True" size="120x7" value="" optional="true"
                label="Enter Variable Modifications">
                <help><![CDATA[
Separate variable modifications with semicolons. Each modification has mass_change, residues, and max occurances values separated by commas.
* is used to represent any amino acid
[ is a modifier for protein N-terminal
] is a modifier for protein C-terminal
n is a modifier for peptide N-terminal
c is a modifier for peptide C-terminal
Syntax Examples:
15.9949,M,3 (for oxidation on methionine)
79.66331,STY,1 (for phosphorylation)
-17.0265,nQnC,1 (for pyro-Glu or loss of ammonia at peptide N-terminal)
Example (M oxidation and N-terminal acetylation):
15.9949,M,3;42.0106,[*,1
                ]]></help>
                <validator type="regex">^\s*@RE_MODS@\s*$</validator>
                <sanitizer sanitize="False"/>
            </param>

            <param name="use_all_mods_in_first_search" type="select" optional="true" label="Use all variable modifications in first search">
                <option value="true">Yes</option>
                <option value="false">No</option>
            </param>
            <param name="clip_nTerm_M" type="select" optional="true" label="Trim protein N-terminal methionine as a variable modification">
                <option value="true">Yes</option>
                <option value="false">No</option>
            </param>
            <param name="allow_multiple_variable_mods_on_residue" type="select" optional="true" label="Allow each amino acid to be modified by multiple variable modifications">
                <option value="true">Yes</option>
                <option value="false">No</option>
            </param>

            <param name="max_variable_mods_combinations" type="integer" value="5000" min="0" max="65534" optional="true"
                label="Maximum allowed number of modified variably modified peptides from each peptide sequence"
                help="If a greater number than the maximum is generated, only the unmodified peptide is considered."/>
        </section>
    </xml>
    <token name="@VARIABLE_MODIFICATION@"><![CDATA[
        ## Variable Modification Parameters
        #if $prefix.variable_modification.max_variable_mods_per_peptide != ''
            #set $msfragger_dict['max_variable_mods_per_peptide'] = $prefix.variable_modification.max_variable_mods_per_peptide
        #end if
        ##maximum of 7 mods - amino acid codes, * for any amino acid, [ and ] specifies protein termini, n and c specifies peptide termini
        ##variable_mod_01=15.9949 M
        ##variable_mod_02=42.0106 [*
        ##variable_mod_03=79.96633 STY
        ##variable_mod_03=-17.0265 nQnC
        ##variable_mod_04=-18.0106 nE
        ##
        #if $prefix.variable_modification.use_all_mods_in_first_search != 'None'
            #set $msfragger_dict['use_all_mods_in_first_search'] = $prefix.variable_modification.use_all_mods_in_first_search
        #end if
        #if $prefix.variable_modification.clip_nTerm_M != 'None'
            #set $msfragger_dict['clip_nTerm_M'] = $prefix.variable_modification.clip_nTerm_M
        #end if
        #if $prefix.variable_modification.allow_multiple_variable_mods_on_residue != 'None'
            #set $msfragger_dict['allow_multiple_variable_mods_on_residue'] = $prefix.variable_modification.allow_multiple_variable_mods_on_residue
        #end if
        #if $prefix.variable_modification.max_variable_mods_combinations != "None"
            #set $msfragger_dict['max_variable_mods_combinations'] = $prefix.variable_modification.max_variable_mods_combinations
        #end if
        #set $vmods = []
        #if $prefix.variable_modification.variable_mods_select != 'None'
            #set $vmods = [x.replace(' ',',') for x in str($prefix.variable_modification.variable_mods_select).split(',')]
        #end if
        #if $prefix.variable_modification.variable_mods != ''
            #set $vmods += [x.strip() for x in str($prefix.variable_modification.variable_mods).split(';')]
        #end if
    ]]></token>

    <xml name="static_modification">
        <section name="static_modification" expanded="false" title="Static Modifications">
            <param name="add_Cterm_peptide" type="float" value="" optional="true"
                label="Statically add mass in Da to C-terminal of peptide Default: 0.0" />
            <param name="add_Nterm_peptide" type="float" value="" optional="true"
                label="Statically add mass in Da to N-terminal of peptide Default: 0.0" />
            <param name="add_Cterm_protein" type="float" value="" optional="true"
                label="Statically add mass in Da to C-terminal of protein Default: 0.0" />
            <param name="add_Nterm_protein" type="float" value="" optional="true"
                label="Statically add mass in Da to N-terminal of protein Default: 0.0" />
            <param name="add_A_alanine" type="float" value="" optional="true"
                label="Statically add mass in Da to A (alanine) Default: 0.0" />
            <param name="add_R_arginine" type="float" value="" optional="true"
                label="Statically add mass in Da to R (arginine) Default: 0.0" />
            <param name="add_N_asparagine" type="float" value="" optional="true"
                label="Statically add mass in Da to N (asparagine) Default: 0.0" />
            <param name="add_D_aspartic_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to D (aspartic_acid) Default: 0.0" />
            <param name="add_C_cysteine" type="float" value="" optional="true"
                label="Statically add mass in Da to C (cysteine) Default: 0.0" />
            <param name="add_E_glutamic_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to E (glutamic_acid) Default: 0.0" />
            <param name="add_Q_glutamine" type="float" value="" optional="true"
                label="Statically add mass in Da to Q (glutamine) Default: 0.0" />
            <param name="add_G_glycine" type="float" value="" optional="true"
                label="Statically add mass in Da to G (glycine) Default: 0.0" />
            <param name="add_H_histidine" type="float" value="" optional="true"
                label="Statically add mass in Da to H (histidine) Default: 0.0" />
            <param name="add_I_isoleucine" type="float" value="" optional="true"
                label="Statically add mass in Da to I (isoleucine) Default: 0.0" />
            <param name="add_L_leucine" type="float" value="" optional="true"
                label="Statically add mass in Da to L (leucine) Default: 0.0" />
            <param name="add_K_lysine" type="float" value="" optional="true"
                label="Statically add mass in Da to K (lysine) Default: 0.0" />
            <param name="add_M_methionine" type="float" value="" optional="true"
                label="Statically add mass in Da to M (methionine) Default: 0.0" />
            <param name="add_F_phenylalanine" type="float" value="" optional="true"
                label="Statically add mass in Da to F (phenylalanine) Default: 0.0" />
            <param name="add_P_proline" type="float" value="" optional="true"
                label="Statically add mass in Da to P (proline) Default: 0.0" />
            <param name="add_S_serine" type="float" value="" optional="true"
                label="Statically add mass in Da to S (serine) Default: 0.0" />
            <param name="add_T_threonine" type="float" value="" optional="true"
                label="Statically add mass in Da to T (threonine) Default: 0.0" />
            <param name="add_W_tryptophan" type="float" value="" optional="true"
                label="Statically add mass in Da to W (tryptophan) Default: 0.0" />
            <param name="add_Y_tyrosine" type="float" value="" optional="true"
                label="Statically add mass in Da to Y (tyrosine) Default: 0.0" />
            <param name="add_V_valine" type="float" value="" optional="true"
                label="Statically add mass in Da to V (valine) Default: 0.0" />
            <param name="add_B_user_amino_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to B (iuser_amino_acid) Default: 0.0" />
            <param name="add_J_user_amino_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to J (iuser_amino_acid) Default: 0.0" />
            <param name="add_O_user_amino_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to O (user_amino_acid) Default: 0.0" />
            <param name="add_U_user_amino_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to U (iuser_amino_acid) Default: 0.0" />
            <param name="add_X_user_amino_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to X (iuser_amino_acid) Default: 0.0" />
            <param name="add_Z_user_amino_acid" type="float" value="" optional="true"
                label="Statically add mass in Da to Z (iuser_amino_acid) Default: 0.0" />
        </section>
    </xml>
    <token name="@STATIC_MODIFICATION@"><![CDATA[
        #set $fmods = {}
        #if $prefix.static_modification.add_Cterm_peptide  != ''
            #set $fmods['Cterm_peptide'] = $prefix.static_modification.add_Cterm_peptide
        #end if
        #if $prefix.static_modification.add_Nterm_peptide  != ''
            #set $fmods['Nterm_peptide'] = $prefix.static_modification.add_Nterm_peptide
        #end if
        #if $prefix.static_modification.add_Cterm_protein  != ''
            #set $fmods['Cterm_protein'] = $prefix.static_modification.add_Cterm_protein
        #end if
        #if $prefix.static_modification.add_Nterm_protein  != ''
            #set $fmods['Nterm_protein'] = $prefix.static_modification.add_Nterm_protein
        #end if
        #if $prefix.static_modification.add_G_glycine  != ''
            #set $fmods['G_glycine'] = $prefix.static_modification.add_G_glycine
        #end if
        #if $prefix.static_modification.add_A_alanine  != ''
            #set $fmods['A_alanine'] = $prefix.static_modification.add_A_alanine
        #end if
        #if $prefix.static_modification.add_S_serine  != ''
            #set $fmods['S_serine'] = $prefix.static_modification.add_S_serine
        #end if
        #if $prefix.static_modification.add_P_proline  != ''
            #set $fmods['P_proline'] = $prefix.static_modification.add_P_proline
        #end if
        #if $prefix.static_modification.add_V_valine  != ''
            #set $fmods['V_valine'] = $prefix.static_modification.add_V_valine
        #end if
        #if $prefix.static_modification.add_T_threonine  != ''
            #set $fmods['T_threonine'] = $prefix.static_modification.add_T_threonine
        #end if
        #if $prefix.static_modification.add_C_cysteine  != ''
            #set $fmods['C_cysteine'] = $prefix.static_modification.add_C_cysteine
        #end if
        #if $prefix.static_modification.add_L_leucine  != ''
            #set $fmods['L_leucine'] = $prefix.static_modification.add_L_leucine
        #end if
        #if $prefix.static_modification.add_I_isoleucine  != ''
            #set $fmods['I_isoleucine'] = $prefix.static_modification.add_I_isoleucine
        #end if
        #if $prefix.static_modification.add_N_asparagine  != ''
            #set $fmods['N_asparagine'] = $prefix.static_modification.add_N_asparagine
        #end if
        #if $prefix.static_modification.add_D_aspartic_acid  != ''
            #set $fmods['D_aspartic_acid'] = $prefix.static_modification.add_D_aspartic_acid
        #end if
        #if $prefix.static_modification.add_Q_glutamine  != ''
            #set $fmods['Q_glutamine'] = $prefix.static_modification.add_Q_glutamine
        #end if
        #if $prefix.static_modification.add_K_lysine  != ''
            #set $fmods['K_lysine'] = $prefix.static_modification.add_K_lysine
        #end if
        #if $prefix.static_modification.add_E_glutamic_acid  != ''
            #set $fmods['E_glutamic_acid'] = $prefix.static_modification.add_E_glutamic_acid
        #end if
        #if $prefix.static_modification.add_M_methionine  != ''
            #set $fmods['M_methionine'] = $prefix.static_modification.add_M_methionine
        #end if
        #if $prefix.static_modification.add_H_histidine  != ''
            #set $fmods['H_histidine'] = $prefix.static_modification.add_H_histidine
        #end if
        #if $prefix.static_modification.add_F_phenylalanine  != ''
            #set $fmods['F_phenylalanine'] = $prefix.static_modification.add_F_phenylalanine
        #end if
        #if $prefix.static_modification.add_R_arginine  != ''
            #set $fmods['R_arginine'] = $prefix.static_modification.add_R_arginine
        #end if
        #if $prefix.static_modification.add_Y_tyrosine  != ''
            #set $fmods['Y_tyrosine'] = $prefix.static_modification.add_Y_tyrosine
        #end if
        #if $prefix.static_modification.add_W_tryptophan  != ''
            #set $fmods['W_tryptophan'] = $prefix.static_modification.add_W_tryptophan
        #end if
        #*
        #if $prefix.static_modification.add_B_user_amino_acid  != ''
            #set $fmods['B_user_amino_acid'] = $prefix.static_modification.add_B_user_amino_acid
        #end if
        #if $prefix.static_modification.add_J_user_amino_acid  != ''
            #set $fmods['J_user_amino_acid'] = $prefix.static_modification.add_J_user_amino_acid
        #end if
        #if $prefix.static_modification.add_O_user_amino_acid  != ''
            #set $fmods['O_user_amino_acid'] = $prefix.static_modification.add_O_user_amino_acid
        #end if
        #if $prefix.static_modification.add_U_user_amino_acid  != ''
            #set $fmods['U_user_amino_acid'] = $prefix.static_modification.add_U_user_amino_acid
        #end if
        #if $prefix.static_modification.add_X_user_amino_acid  != ''
            #set $fmods['X_user_amino_acid'] = $prefix.static_modification.add_X_user_amino_acid
        #end if
        #if $prefix.static_modification.add_Z_user_amino_acid  != ''
            #set $fmods['Z_user_amino_acid'] = $prefix.static_modification.add_Z_user_amino_acid
        #end if
        *#
    ]]></token>

    <xml name="spectrum_processing" token_mode_selected="false" token_mode_isolated="false" token_mode_corrected="false" token_override_charge="false" token_rm_peak0="false" token_rm_peak1="true" token_rm_peak2="false" token_clear_mz_range_min="0.0" token_clear_mz_range_max="0.0" token_transform_none="true" token_transform_sqrt="false">
        <section name="spectrum_processing" expanded="false" title="Spectrum Processing">
            <param name="precursor_mass_mode" type="select" optional="true" label="Precursor mass mode">
                <option value="isolated" selected="@MODE_ISOLATED@">isolated</option>
                <option value="selected" selected="@MODE_SELECTED@">selected</option>
                <option value="corrected" selected="@MODE_CORRECTED@">corrected</option>
            </param>
            <param name="minimum_peaks" type="integer" value="" min="0" optional="true"
                label="Minimum number of peaks in experimental spectrum for matching" />
            <param name="use_topN_peaks" type="integer" value="" min="0" optional="true"
                label="Pre-process experimental spectrum to only use top N peaks" />
            <param name="minimum_ratio" type="float" value="" min="0.0" optional="true"
                label="Filter peaks by minimum_ratio of base peak"
                help="Filters out all peaks in experimental spectrum less intense than this multiple of the base peak intensit Default: 0.0" />
            <conditional name="precursor">
                <param name="override_charge" type="select" label="Precursor Charge Override" help="override_charge">
                    <option value="default">Use default</option>
                    <option value="false">Use precursor charge</option>
                    <option value="true" selected="@OVERRIDE_CHARGE@">Ignore precursor charge and set range</option>
                </param>
                <when value="default"/>
                <when value="false"/>
                <when value="true">
                    <param name="precursor_charge_min" type="integer" value="1" min="0" max="6"
                        label="Minimum Potential Precursor Charge" />
                    <param name="precursor_charge_max" type="integer" value="4" min="0" max="8"
                        label="Maximum Potential Precursor Charge" />
                </when>
            </conditional>
            <section name="clear" expanded="false" title="Clear mz range for iTRAQ/TMT experiments">
                <param name="clear_mz_range_min" type="float" value="@CLEAR_MZ_RANGE_MIN@" min="0.0" optional="true" label="Minimum of m/z range to remove" />
                <param name="clear_mz_range_max" type="float" value="@CLEAR_MZ_RANGE_MAX@" min="0.0" optional="true" label="Maximum of m/z range to remove" />
            </section>
            <param name="remove_precursor_peak" type="select" optional="true" label="Remove precursor peak">
                <option value="0" selected="@RM_PEAK0@">do not remove</option>
                <option value="1" selected="@RM_PEAK1@">remove the peak with precursor charge</option>
                <option value="2" selected="@RM_PEAK2@">remove the peaks with all charge states (only for DDA mode)</option>
            </param>
            <param name="remove_precursor_range_min" type="float" value="-1.5" min="-10.0" max="0.0" optional="true" label="Minimum of precursor m/z range to remove" />
            <param name="remove_precursor_range_max" type="float" value="1.5" min="0.0" max="10.0" optional="true" label="Maximum of precursor m/z range to remove" />
            <param name="intensity_transform" type="select" label="Intensity transform">
                <option value="0" selected="@TRANSFORM_NONE@">None, not removed</option>
                <option value="1" selected="@TRANSFORM_SQRT@">Square root</option>
            </param>
            <param name="check_spectral_files" type="boolean" truevalue="true" falsevalue="false" checked="true" label="Check spectral files"/>
            <param name="require_precursor" type="boolean" truevalue="true" falsevalue="false" checked="true" label="Require precursor"/>
            <param name="reuse_dia_fragment_peaks" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Reuse DIA fragment peaks"/>
            <param name="activation_types" type="select" optional="true" label="Activation Type Filter">
                <option value="all" selected="true">all</option>
                <option value="HCD">HCD</option>
                <option value="ETD">ETD</option>
                <option value="CID">CID</option>
                <option value="ECD">ECD</option>
            </param>
        </section>
    </xml>
    <token name="@SPECTRUM_PROCESSING@"><![CDATA[
        ## spectral processing
        #if $prefix.spectrum_processing.precursor_mass_mode != 'None'
            #set $msfragger_dict['precursor_mass_mode'] = $prefix.spectrum_processing.precursor_mass_mode
        #end if
        #if $prefix.spectrum_processing.minimum_peaks != ''
            #set $msfragger_dict['minimum_peaks'] = $prefix.spectrum_processing.minimum_peaks
        #end if
        #if $prefix.spectrum_processing.use_topN_peaks != ''
            #set $msfragger_dict['use_topN_peaks'] = $prefix.spectrum_processing.use_topN_peaks
        #end if
        #if $prefix.spectrum_processing.minimum_ratio != ''
            #set $msfragger_dict['minimum_ratio'] = $prefix.spectrum_processing.minimum_ratio
        #end if
        #if $prefix.spectrum_processing.precursor.override_charge != 'default'
            #set $msfragger_dict['override_charge'] = $prefix.spectrum_processing.precursor.override_charge
        #end if
        #if $prefix.spectrum_processing.precursor.override_charge == 'true'
            #if $prefix.spectrum_processing.precursor.precursor_charge_min != ''
                #set $msfragger_dict['misc.fragger.precursor-charge-lo'] = $prefix.spectrum_processing.precursor.precursor_charge_min
            #end if
            #if $prefix.spectrum_processing.precursor.precursor_charge_max != ''
                #set $msfragger_dict['misc.fragger.precursor-charge-hi'] = $prefix.spectrum_processing.precursor.precursor_charge_max
            #end if
        #end if
        #if $prefix.spectrum_processing.clear.clear_mz_range_min != ''
            #set $msfragger_dict['misc.fragger.clear-mz-lo'] = $prefix.spectrum_processing.clear.clear_mz_range_min
        #end if
        #if $prefix.spectrum_processing.clear.clear_mz_range_max != ''
            #set $msfragger_dict['misc.fragger.clear-mz-hi'] = $prefix.spectrum_processing.clear.clear_mz_range_max
        #end if
        #if $prefix.spectrum_processing.remove_precursor_peak != 'None'
            #set $msfragger_dict['remove_precursor_peak'] = $prefix.spectrum_processing.remove_precursor_peak
        #end if
        #if $prefix.spectrum_processing.remove_precursor_range_min != ''
            #set $msfragger_dict['misc.fragger.remove-precursor-range-lo'] = $prefix.spectrum_processing.remove_precursor_range_min
        #end if
        #if $prefix.spectrum_processing.remove_precursor_range_max != ''
            #set $msfragger_dict['misc.fragger.remove-precursor-range-hi'] = $prefix.spectrum_processing.remove_precursor_range_max
        #end if

        #if $prefix.spectrum_processing.intensity_transform != 'None'
            #set $msfragger_dict['intensity_transform'] = $prefix.spectrum_processing.intensity_transform
        #end if

        #set $msfragger_dict['check_spectral_files'] = $prefix.spectrum_processing.check_spectral_files
        #set $msfragger_dict['require_precursor'] = $prefix.spectrum_processing.require_precursor
        #set $msfragger_dict['reuse_dia_fragment_peaks'] = $prefix.spectrum_processing.reuse_dia_fragment_peaks

        #if $prefix.spectrum_processing.activation_types != 'None'
            #set $msfragger_dict['activation_types'] = $prefix.spectrum_processing.activation_types
        #end if
]]></token>

    <xml name="open_search_options" token_localize="false" token_mass_diff_to_variable_mod0="true" token_mass_diff_to_variable_mod1="false" token_mass_diff_to_variable_mod2="false">
        <section name="open_search" expanded="false" title="Open Search Options">
            <param name="mass_diff_to_variable_mod" type="select" label="Report mass shift as a variable mod">
                <option value="0" selected="@MASS_DIFF_TO_VARIABLE_MOD0@">0 - No</option>
                <option value="1" selected="@MASS_DIFF_TO_VARIABLE_MOD1@">1 - yes and remove delta mass</option>
                <option value="2" selected="@MASS_DIFF_TO_VARIABLE_MOD2@">2 - yes and keep delta mass</option>
            </param>
            <param name="track_zero_topN" type="integer" value="" min="0" optional="true"
                label="Track top N unmodified peptide results" >
                <help>
                    Track top N unmodified peptide results separately from main results internally for boosting features.
                    Should be set to a number greater than output_report_topN if zero bin boosting is desired.
                    Default: 0
                </help>
            </param>
            <param name="zero_bin_accept_expect" type="float" value="" min="0.0" optional="true"
                label="Ranks a zero-bin hit above all non-zero-bin hit if it has expectation less than this value."
                help="Default: 0.0" />
            <param name="zero_bin_mult_expect" type="float" value="" min="0.0" optional="true"
                label="Multiplies expect value of PSMs in the zero-bin during results ordering"
                help="(set to less than 1 for boosting) Default: 1.0" />
            <param name="add_topN_complementary" type="integer" value="" min="0" optional="true"
                label="Insert complementary ions corresponding to the top N most intense fragments in each experimental spectra." >
                <help>
                    Useful for recovery of modified peptides near C-terminal in open search.
                    Should be set to 0 (disabled) otherwise.
                    Default: 0
                </help>
            </param>
            <param name="delta_mass_exclude_ranges_min" type="float" value="-1.5" label="Delta mass exclude range minimum" />
            <param name="delta_mass_exclude_ranges_max" type="float" value="3.5" label="Delta mass exclude range maximum" />
            <param name="localize_delta_mass" type="boolean" truevalue="true" falsevalue="false" checked="@LOCALIZE@"
                 label="Localize mass shift (LOS)"/>
        </section>
    </xml>
    <token name="@OPEN_SEARCH@"><![CDATA[
        ##open search parameters
        #if $prefix.open_search.mass_diff_to_variable_mod != 'None'
            #set $msfragger_dict['mass_diff_to_variable_mod'] = $prefix.open_search.mass_diff_to_variable_mod
        #end if
        #if $prefix.open_search.track_zero_topN != ''
            #set $msfragger_dict['track_zero_topN'] = $prefix.open_search.track_zero_topN
        #end if
        #if $prefix.open_search.zero_bin_accept_expect != ''
            #set $msfragger_dict['zero_bin_accept_expect'] = $prefix.open_search.zero_bin_accept_expect
        #end if
        #if $prefix.open_search.zero_bin_mult_expect != ''
            #set $msfragger_dict['zero_bin_mult_expect'] = $prefix.open_search.zero_bin_mult_expect
        #end if
        #if $prefix.open_search.add_topN_complementary != ''
            #set $msfragger_dict['add_topN_complementary'] = $prefix.open_search.add_topN_complementary
        #end if
        #set $msfragger_dict['localize_delta_mass'] = $prefix.open_search.localize_delta_mass
        #set $msfragger_dict['delta_mass_exclude_ranges'] = '(' + ','.join([str($prefix.open_search.delta_mass_exclude_ranges_min),str($prefix.open_search.delta_mass_exclude_ranges_max)]) + ')'
]]></token>

    <xml name="modeling_output">
        <section name="modeling_output" expanded="false" title="Modeling and Output">
            <param name="min_fragments_modelling" type="integer" min="1" optional="true"
                label="Minimum number of matched peaks in PSM for inclusion in statistical modeling" />
            <param name="min_matched_fragments" type="integer" min="1" optional="true"
                label="Minimum number of matched peaks for PSM to be reported"
                help="recommend a minimum of 4 for narrow window searching and 6 for open searches"/>
            <param name="max_fragment_charge" type="integer" min="1" max="4" optional="true"
                label="Maximum fragment_charge Default:2"
                help="recommend a minimum of 4 for narrow window searching and 6 for open searches"/>
            <param name="deisotope" type="select" label="Deisotope" optional="true">
                <option value="0">0 - No</option>
                <option value="1">1 - yes and assume singleton peaks single charged</option>
                <option value="2">2 - yes and assume singleton peaks single or double charged</option>
            </param>
            <param name="deneutralloss" type="boolean" truevalue="1" falsevalue="0" checked="true"
                 label="Perform deneutrallossing"/>
            <param name="fragment_ion_series" type="select" value="b,y" label="Fragment ion_series" optional="true">
                <option value="b,y">b,y</option>
                <option value="b,y,Y">b,y,Y</option>
                <option value="b,y,c,z">b,y,c,z</option>
                <option value="b,y,c,z,Y">b,y,c,z,Y</option>
                <option value="b,y,b~,y~,Y">b,y,b~,y~,Y</option>
            </param>
        </section>
    </xml>
    <token name="@MODELING_OUTPUT@"><![CDATA[
        ##Peak matching
        #if $prefix.modeling_output.min_fragments_modelling != ''
            #set $msfragger_dict['min_fragments_modelling'] = $prefix.modeling_output.min_fragments_modelling
        #end if
        #if $prefix.modeling_output.min_matched_fragments != ''
            #set $msfragger_dict['min_matched_fragments'] = $prefix.modeling_output.min_matched_fragments
        #end if
        #if $prefix.modeling_output.max_fragment_charge != ''
            #set $msfragger_dict['max_fragment_charge'] = $prefix.modeling_output.max_fragment_charge
        #end if
        #if $prefix.modeling_output.deisotope != 'None'
            #set $msfragger_dict['deisotope'] = $prefix.modeling_output.deisotope
        #end if
        #set $msfragger_dict['deneutralloss'] = $prefix.modeling_output.deneutralloss
        #if $prefix.modeling_output.fragment_ion_series != 'None'
            #set $msfragger_dict['fragment_ion_series'] = $prefix.modeling_output.fragment_ion_series
        #end if
]]></token>

    <!-- Tokens used in the mass_offsets section. -->
    <token name="@MASS_OFFSET_LABILE_ADP-RIBOSYLATION@">0/541.06111</token>
    <token name="@MASS_OFFSET_LABILE_PHOSPHO@">0/79.966331</token>
    <token name="@MASS_OFFSET_MASS-OFFSET-COMMONPTMS@">-105.0248 -89.0299 -33.9877 -32.0085 -30.0106 -18.0106 -17.0265 -2.0157 -1.007825 -0.984 0 0.984 3.9949 12.0 13.9793 14.0157 15.9949 19.9898 21.969392 21.9819 23.95806 26.0157 27.9949 28.0313 28.990164 29.9742 31.972071 31.9898 37.9469 37.955882 42.0106 42.047 43.0058 43.9898 44.985078 47.9847 53.9193 57.02146 58.0055 61.9135 61.921774 68.026215 70.041865 71.0371 79.9568 79.9663 86.000394 100.016 114.042927 119.004099 128.095 146.0579 156.1011 162.0528 173.051 176.0321 178.0477 183.035399 189.046 203.0794 204.1878 210.1984 228.111 229.014009 238.2297 301.9865 340.1006 349.1373 365.1322 365.1322 406.1587 541.06111</token>
    <token name="@XRNAX-MASSOFFSET@">0 306.025302 324.035867 612.051 611.067 630.061 629.077 635.078 651.073 653.088 669.083 151.994 918.076 917.092 936.086 916.108 935.102 934.118 941.103 957.098 940.119 956.114 959.114 975.109 958.13 974.125 964.13 980.125 996.12 982.141 998.136 1014.13</token>
    <token name="@FPOP@">0 15.9949 31.989829 47.984744 13.979265 -43.053433 -22.031969 -23.015984 -10.031969 4.9735 -30.010565 -27.994915 -43.989829 -25.031631 -9.036716</token>
    <token name="@MASS_OFFSET_GLYCO-N@">0 568.21156 892.3172 1038.375109 1054.37002 1095.39657 1200.427929 1216.42284 1241.454479 1257.44939 1298.47594 1362.480749 1378.47566 1387.512388 1403.507299 1419.50221 1444.533849 1460.52876 1501.55531 1524.533569 1533.570297 1540.52848 1548.5448065 1549.565208 1565.560119 1581.55503 1589.5713565 1606.586669 1622.58158 1647.613219 1663.60813 1686.586389 1694.6027155 1695.623117 1702.5813 1704.63468 1710.5976265 1711.618028 1727.612939 1735.6292655 1736.649667 1751.6241765 1752.644578 1768.639489 1784.6344 1793.671128 1809.666039 1825.66095 1848.639209 1850.692589 1856.6555355 1857.675937 1864.63412 1866.6875 1872.6504465 1873.670848 1880.666773 1889.665759 1897.6820855 1898.702487 1907.71405 1913.6769965 1914.697398 1930.692309 1938.7086355 1946.68722 1954.7035465 1955.723948 1971.718859 1987.71377 1996.750498 2010.692029 2012.745409 2018.7083555 2019.728757 2026.68694 2028.74032 2042.719593 2043.7399945 2053.771959 2059.7349055 2060.755307 2069.76687 2075.7298165 2076.750218 2092.745129 2100.7614555 2101.781857 2108.74004 2110.79342 2116.7563665 2117.776768 2133.771679 2141.7880055 2142.808407 2157.7829165 2158.803318 2172.744849 2174.798229 2188.73976 2190.79314 2204.772413 2205.7928145 2206.813216 2215.824779 2221.7877255 2222.808127 2231.81969 2237.7826365 2245.798963 2246.8193645 2254.797949 2256.851329 2262.8142755 2263.834677 2270.79286 2278.8091865 2279.829588 2287.8459145 2313.87279 2320.856138 2334.797669 2336.851049 2350.79258 2350.830322 2352.84596 2352.871125 2366.825233 2391.856872 2393.87251 2407.851783 2408.8721845 2424.8670955 2425.887497 2432.883422 2434.89906 2448.878333 2457.877319 2459.930699 2463.8402655 2465.8936455 2475.92561 2481.8885565 2498.903869 2528.878053 2539.930419 2545.8933655 2553.909692 2555.92533 2569.904603 2570.9250045 2571.945406 2580.956969 2586.9199155 2621.983519 2627.9464655 2643.9413765 2644.961778 2674.935962 2701.983239 2715.962512 2716.9829135 2717.97815 2772.983973 2775.024776 2786.963246 2789.9992855 2791.019687 2798.015612000001 2814.010523 2823.009509 2861.0000195 2864.036059 2871.057149 2878.015332 2880.03097 2896.051046 2919.041882 2935.036793 2937.077596 2966.0313785 2968.0470165 3007.0579285 3009.0735665 3010.119133 3048.0844785 3064.0793895 3081.094702 3083.11034 3083.135505 3138.116163 3140.156966 3147.115149 3153.1158375 3155.1314755 3156.151877 3210.1372985 3226.1322095 3228.1730125 3229.168249 3234.148536000001 3284.174072 3300.168983 3302.209786 3372.1901185 3374.2057565 3405.200342 3407.241145 3447.2472935 3448.24253 3448.267695 3503.248353 3517.227626 3519.268429 3520.2636655 3521.284067 3589.2487615 3591.2643995 3594.300439 3663.285535 3665.301173 3665.326338 3704.312085 3720.306996 3738.34271 3809.343444 3812.3794835 3827.353993 3866.364905 3882.359816 3886.416257 3959.432629</token>
    <token name="@MASS_OFFSET_GLYCO-O@">0 203.0794 365.1322 406.1588 494.1748 511.1901 527.185 568.2116 656.2276 673.2429 714.2695 730.2644 802.2855 818.2804 859.307 860.3274 876.3223 947.323 964.3383 1005.3649 1021.3598 1022.3802 1095.3966 1109.3758 1167.4177 1238.4184 1241.4545 1312.4552 1313.4756 1386.492 1387.5124 1441.4978 1458.5131 609.2382 697.2542 771.291 917.3489 933.3438 1062.3864 1063.4068 1079.4017 1150.4024 1208.4443 1224.4392 1225.4596 1298.476 1370.4971 1444.5339 1515.5346 1516.555 1589.5714 1590.5918 1644.5772 1661.5925 892.3172 1038.3751 1183.4126 1329.4705 1460.5288 1474.508 1532.5499 1603.5506 1606.5867 1677.5874 1678.6078 1751.6242 1752.6446 1806.63 1823.6453 812.3176 900.3336 974.3704 1120.4283 1136.4232 1265.4658 1266.4862 1282.4811 1353.4818 1411.5237 1427.5186 1428.539 1501.5554 1573.5765 1647.6133 1718.614 1719.6344 1792.6508 1793.6712 1847.6566 1864.6719 988.3496 1296.4603 1354.5022 1499.5397 1732.5932 1735.6293 1807.6504 1880.6668 1881.6872 1935.6726 1952.6879 1184.433 1371.5175 1475.5284 1533.5703 1620.5659 1749.6085 1824.6657 1897.6821 1898.7025 1969.7032 1054.37 1200.4279 1257.4494 1345.4654 1403.5073 1491.5233 1548.5448 1549.5652 1622.5816 1636.5608 1694.6027 1765.6034 1768.6395 1839.6402 1840.6606 1913.677 1914.6974 1968.6828 1985.6981 1663.6082 1809.6661 1954.7036 1955.724 2009.7094 2026.7247 1894.646 2042.7196 2043.74 2097.7254 2114.7407 1346.4858 1637.5812 1695.6231 1782.6187 1911.6613 1986.7185 2059.7349 2060.7553 2131.756 1574.5969 1736.6497 2027.7451 2100.7615 2101.7819 2155.7673 2172.7826 1825.661 1971.7189 2116.7564 2117.7768 2171.7622 2188.7775 1604.571 1662.6129 1766.6238 2040.7039 2115.7611 2189.7979 2243.7833 2260.7986 1927.6562 2056.6988 2130.7356 2204.7724 2205.7928 2259.7782 2276.7935 2245.799 2246.8194 2300.8048 2317.8201 1720.6548 1865.6923 1882.7076 2098.7458 2173.803 2247.8398 2301.8252 2318.8405 2262.8143 2263.8347 2334.8354 2185.7414 2333.815 2388.8208 2405.8361 1928.6766 2073.7141 2202.7567 2277.8139 2350.8303 2351.8507 2422.8514 2010.7298 2391.8569 2392.8773 2446.8627 2463.878 2407.8518 2408.8722 2462.8576 2479.8729 2044.7604 2335.8558 2409.8926 2480.8933 2190.7932 2336.8511 2481.8886 2482.909 2536.8944 2553.9097 2218.7516 2347.7942 2421.831 2495.8678 2496.8882 2550.8736 2567.8889 2554.9301 2608.9155 2625.9308 2476.8368 2551.894 2624.9104 2679.9162 2696.9315 2627.9465 2628.9669 2682.9523 2699.9676 2698.9472 2753.953 2770.9683 2626.9512 2700.988 2754.9734 2771.9887 2772.984 2774.0044 2827.9898 2845.0051 2775.0248 2829.0102 2846.0255 2882.9956 2900.0109 2917.0262 1015.397 1103.413 1177.4498 1323.5077 1339.5026 1468.5452 1469.5656 1485.5605 1556.5612 1614.6031 1630.598 1631.6184 1704.6348 1776.6559 1850.6927 1921.6934 1922.7138 1995.7302 1996.7506 2050.736 2067.7513 1191.429 1557.5816 1702.6191 1938.7087 2083.7462 2084.7666 2138.752 1866.6876 2012.7455 2157.783 2158.8034 2212.7888 2229.8041 1777.6763 1939.7291 2230.8245 2303.8409 2304.8613 2358.8467 2375.862 2028.7404 2174.7983 2319.8358 2320.8562 2374.8416 2448.8784 2449.8988 2503.8842 2520.8995 1923.7342 2068.7717 2085.787 2376.8824 2450.9192 2504.9046 2521.9199 2465.8937 2466.9141 2537.9148 2591.9002 2213.8092 2594.9363 2595.9567 2649.9421 2666.9574 2610.9312 2611.9516 2665.937 2538.9352 2612.972 2683.9727 2393.8726 2539.9305 2684.968 2685.9884 2739.9738 2756.9891 2758.0095 2811.9949 2831.0259 2832.0463 2886.0317 2903.047 2902.0266 2957.0324 2974.0477 2830.0306 2904.0674 2958.0528 2975.0681 2976.0634 2977.0838 2978.1042 1419.5022 1565.5601 1710.5976 1856.6555 1987.7138 2001.693 2133.7717 2278.8092 2279.8296 1711.618 2002.7134 2147.7509 2424.8671 2425.8875 2292.7884 2569.9046 2570.925 2641.9257 2293.8088 2438.8463 2642.9461 2715.9625 2716.9829 2787.9836 2555.9254 2701.9833 2847.0208 2848.0412 2919.0419 2583.8838 2712.9264 2786.9632 2861 2862.0204 2916.0058 2933.0211 2920.0623 2991.063 2841.969 2990.0426 2993.0787 2994.0991 2992.0834 1218.4764 1306.4924 1380.5292 1526.5871 1542.582 1671.6246 1672.645 1688.6399 1759.6406 1817.6825 1833.6774 1834.6978 1907.7142 1979.7353 2053.7721 2124.7728 2125.7932 2198.8096 2199.83 2253.8154 2270.8307 1394.5084 1760.661 1905.6985 2141.7881 2286.8256 2287.846 2341.8314 2069.767 2215.8249 2360.8624 2361.8828 2415.8682 2432.8835 1980.7557 2142.8085 2433.9039 2506.9203 2507.9407 2561.9261 2578.9414 2231.8198 2377.8777 2522.9152 2523.9356 2577.921 2651.9578 2652.9782 2706.9636 2723.9789 2126.8136 2271.8511 2288.8664 2579.9618 2653.9986 2707.984 2724.9993 2668.9731 2669.9935 2740.9942 2794.9796 2416.8886 2798.0157 2799.0361 2853.0215 2870.0368 2814.0106 2815.031 2869.0164 2742.0146 2816.0514 2887.0521 2596.952 2743.0099 2888.0474 2889.0678 2943.0532 2960.0685 2961.0889 1482.5244 1790.6351 1848.677 1993.7145 2226.768 2429.8474 2156.7877 2534.8787 2609.9359 2737.9581 2214.8296 2359.8671 2592.9206 2667.9778 2796 2813.0153 2941.0375 2971.0116 1857.6759 2148.7713 2206.8132 2497.9086 2571.9454 2231.8449 2393.8977 2684.9931 2759.0299 2439.8667 2584.9042 2713.9468 2789.004 2863.0408 2934.0415 2555.9505 2847.0459 2921.0827 2729.9417 2858.9843 2988.0269 1581.555 1727.6129 1784.6344 1872.6504 1930.6923 2018.7083 2075.7298 2076.7502 2149.7666 2163.7458 2221.7877 2295.8245 2366.8252 2367.8456 2440.862 2441.8824 2512.8831 1873.6708 2164.7662 2222.8081 2309.8037 2513.9035 2586.9199 2587.9403 2658.941 2352.846 2498.9039 2643.9414 2644.9618 2454.8412 2657.9206 2731.9574 2732.9778 2803.9785 2789.9993 2791.0197 2455.8616 2600.8991 2804.9989 2878.0153 2879.0357 2950.0364 2935.0368 2936.0572 2937.0776 2717.9782 2864.0361 2745.9366 2874.9792 2949.016 2759.0048 2905.0627 2019.7287 2310.8241 2368.866 2659.9614 2733.9982 2601.9195 2746.957 2875.9996 2951.0568 2718.0033 2891.9945 2434.9243 2596.9771 2888.0725 2962.1093 2921.0576 2406.8565 2464.8984 2568.9093 2842.9894 2918.0466 2522.9403 2901.0313 2976.0885 2730.9621 2580.9822 2726.0197 2743.035 2959.0732 2871.0572 2905.0878 2893.0149</token>

    <!-- Tokens used in the glyco_labiles section. -->
    <token name="@Y_TYPE_MASSES_LABILE_ADP-RIBOSYLATION@">0/114.03169/193.99802/291.97492/406.00661</token>
    <token name="@Y_TYPE_MASSES_NONSPECIFIC_HLA_GLYCO@">0 203.07937 406.15874 568.21156 730.26438 892.3172</token>
    <token name="@Y_TYPE_MASSES_GLYCO-N@">0 203.07937 406.15874 568.21156 730.26438 892.3172 349.137279</token>
    <token name="@Y_TYPE_MASSES_GLYCO-O-HCD@">0 203.07937 365.1322</token>
    <token name="@Y_TYPE_MASSES_GLYCO-O-HYBRID@">0 203.07937 365.1322 406.15874 568.21156 730.26438 892.3172 349.137279</token>
    <token name="@Y_TYPE_MASSES_GLYCO-O-OPEN@">0 203.07937 406.15874 568.21156 730.26438 349.137279</token>

<!-- Parameter 'ion_series_definitions' was not supplied. Using default value. -->
    <xml name="mass_offsets">
        <section name="mass_offsets" expanded="false" title="Mass Offsets">
            <param name="mass_offsets" type="select" label="Mass Offsets" help="glyco-N covers glyco-N-HCD, glyco-N-Hybrid, glyco-N-LFQ, glyco-N-TMT. glyco-O covers glyco-O-HCD, glyco-O-Hybrid, glyco-O-Pair">
                <option value="0" selected="true">None</option>
                <option value="@MASS_OFFSET_MASS-OFFSET-COMMONPTMS@">Mass-Offset-CommonPTMs</option>
                <option value="@MASS_OFFSET_LABILE_ADP-RIBOSYLATION@">Labile_ADP-ribosylation: 0/541.06111</option>
                <option value="@MASS_OFFSET_LABILE_PHOSPHO@">Labile_phospho: 0/79.966331</option>
                <option value="@XRNAX-MASSOFFSET@">XRNAX-MassOffset</option>
                <option value="@FPOP@">FPOP</option>
                <option value="@MASS_OFFSET_GLYCO-N@">glyco-N</option>
                <option value="@MASS_OFFSET_GLYCO-O@">glyco-O</option>
            </param>
            <param name="restrict_deltamass_to" type="select" label="Restrict deltamass to">
                <option value="all">All</option>
                <option value="STY">Labile_phospho: STY</option>
                <option value="ST-">glyco-O: ST-</option>
                <option value="SKREDTY">Labile_ADP-ribosylation: SKREDTY</option>
            </param>
        </section>
    </xml>
    <token name="@MASS_OFFSETS@"><![CDATA[
        #set $msfragger_dict['mass_offsets'] = $prefix.mass_offsets.mass_offsets
        #set $msfragger_dict['restrict_deltamass_to'] = $prefix.mass_offsets.restrict_deltamass_to
]]></token>

    <xml name="glyco_labile" token_diagnostic_intensity="0.0" token_min_sequence_matches="2">
        <section name="glyco_labile" expanded="false" title="Glyco/Labile Mods">
            <param name="labile_search_mode" type="select" label="Labile modification search mode">
                <option value="off">off</option>
                <option value="nglycan">nglycan</option>
                <option value="labile">labile</option>
            </param>
            <param name="diagnostic_intensity_filter" type="float" value="@DIAGNOSTIC_INTENSITY@" min="0.0"
                label="Suppresses reporting of PSM if top hit has expectation greater than this threshold" />
            <param name="min_sequence_matches" type="integer" value="@MIN_SEQUENCE_MATCHES@" min="0"
                label="Min Sequence-specific Ions" />
            <param name="Y_type_masses" type="select" label="Y ion masses" help="glyco-N covers glyco-N-HCD, glyco-N-Hybrid, glyco-N-LFQ, glyco-N-TMT, glyco-N-open-HCD, glyco-N-open-Hybrid">
                <option value="" selected="true">None</option>
                <option value="@Y_TYPE_MASSES_LABILE_ADP-RIBOSYLATION@">Labile_ADP-ribosylation</option>
                <option value="@Y_TYPE_MASSES_NONSPECIFIC_HLA_GLYCO@">Nonspecific-HLA-glyco</option>
                <option value="@Y_TYPE_MASSES_GLYCO-N@">glyco-N</option>
                <option value="@Y_TYPE_MASSES_GLYCO-O-HCD@">glyco-O-HCD</option>
                <option value="@Y_TYPE_MASSES_GLYCO-O-HYBRID@">glyco-O-Hybrid</option>
                <option value="@Y_TYPE_MASSES_GLYCO-O-OPEN@">glyco-O-open-HCD,glyco-O-open-Hybrid</option>
            </param>
            <param name="diagnostic_fragments" type="select" label="Diagnostic fragment masses">
                <option value="">None</option>
                <option value="136.06232/250.09401/348.07036/428.03669/584.09018">Labile_ADP-ribosylation: 136.06232/250.09401/348.07036/428.03669/584.09018</option>
            </param>
            <param name="remainder_fragment_masses" type="text" optional="true" label="Remainder fragment masses"/>
        </section>
    </xml>
    <token name="@GLYCO_LABILE@"><![CDATA[
        #set $msfragger_dict['labile_search_mode'] = $prefix.glyco_labile.labile_search_mode
        #if $prefix.glyco_labile.labile_search_mode != 'off'
            #set $msfragger_dict['diagnostic_intensity_filter'] = $prefix.glyco_labile.diagnostic_intensity_filter
            #set $msfragger_dict['min_sequence_matches'] = $prefix.glyco_labile.min_sequence_matches
            #set $msfragger_dict['diagnostic_fragments'] = $prefix.glyco_labile.diagnostic_fragments

        #if $prefix.glyco_labile.remainder_fragment_masses != ''
            #set $msfragger_dict['remainder_fragment_masses'] = $prefix.glyco_labile.remainder_fragment_masses
        #end if
            #set $msfragger_dict['Y_type_masses'] = $prefix.glyco_labile.Y_type_masses
        #end if
  ]]></token>

    <!-- Formatting options for output files. -->
    <xml name="advanced_options">
        <section name="advanced_options" expanded="false" title="Advanced Options">
            <param name="output_format" type="select" multiple="true" label="output format">
                <option value="pepXML">PEPXML</option>
                <option value="tsv">TSV</option>
                <option value="tsv_pepXML">TSV_PEPXML</option>
                <option value="pin">PIN</option>
                <option value="tsv_pin">TSV_PIN</option>
                <option value="pepXML_pin" selected="true">PEPXML_PIN</option>
                <option value="tsv_pepXML_pin">TSV_PEPXML_PIN</option>
            </param>
            <param name="output_report_topN" type="integer" value="1" min="1" optional="true"
                label="Reports top N PSMs per input spectrum  Default:1" />
            <param name="report_alternative_proteins" type="boolean" checked="true"
                 label="Report alternative proteins"/>
            <param name="output_max_expect" type="float" value="50.0" min="0.0" optional="true"
                label="Suppresses reporting of PSM if top hit has expectation greater than this threshold" />

            <param name="write_calibrated_mzml" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Write calibrated mzML"/>
            <param name="write_uncalibrated_mgf" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Write uncalibrated MGF"/>
            <param name="group_variable" type="select" optional="true" label="Group variable">
                <option value="0">None</option>
                <option value="1">Number of enzymatic termini</option>
                <option value="2">Protein evidence from FASTA file</option>
            </param>
        </section>
    </xml>

    <!-- Does not enter into msfragger_dict, instead produces configuration text. -->
    <token name="@MSFRAGGER_ADVANCED_OPTIONS@"><![CDATA[
        #set $msfragger_dict['output_format'] = $prefix.advanced_options.output_format.__str__.replace(',mgf','').replace(',','_')
        #if $prefix.advanced_options.output_report_topN != ''
            #set $msfragger_dict['output_report_topN'] = $prefix.advanced_options.output_report_topN
        #end if
        #set $msfragger_dict['report_alternative_proteins'] = $prefix.advanced_options.report_alternative_proteins
        #if $prefix.advanced_options.output_max_expect != ''
            #set $msfragger_dict['output_max_expect'] = $prefix.advanced_options.output_max_expect
        #end if
        #set $msfragger_dict['write_calibrated_mzml'] = $prefix.advanced_options.write_calibrated_mzml
        #set $msfragger_dict['write_uncalibrated_mgf'] = $prefix.advanced_options.write_uncalibrated_mgf
        #if $prefix.advanced_options.group_variable != 'None'
            #set $msfragger_dict['group_variable'] = $prefix.advanced_options.group_variable
        #end if
    ]]></token>

    <!-- Composes all parameter tokens for generating msfragger_dict for -->
    <token name="@MSFRAGGER_PARAM_DICT@"><![CDATA[
        #import re
        #set $msfragger_dict = {}
        @SEARCH_TOLERANCES@
        ## Variable Modification Parameters sets $vmods
        @VARIABLE_MODIFICATION@
        ## Static Modification Parameters sets $fmods
        @STATIC_MODIFICATION@
        @GLYCO_LABILE@
        @MASS_OFFSETS@
        @SPECTRUM_PROCESSING@
        @OPEN_SEARCH@
        @MODELING_OUTPUT@
        @MSFRAGGER_ADVANCED_OPTIONS@
    ]]></token>
</macros>