view macros.xml @ 0:b17b03126d40 draft

planemo upload commit c64c8aadb942f00c459963110d51558fad83d920-dirty
author galaxyp
date Tue, 04 Dec 2018 17:17:41 -0500
parents
children 47bfbd6597d0
line wrap: on
line source

<macros>
    <token name="@VERSION@">0.99.2</token>
    <xml name="requirements">
        <requirements>
        <requirement type="package" version="@VERSION@">metaquantome</requirement>
            <yield/>
        </requirements>
    </xml>
    <xml name="FUNC_FILE">
        <param argument="--func_file" type="data" format="tabular" label="Functional file"
            help="Tabular file with a peptide sequence column and a functional assignment column for GO-term, EC number, or COG."/>
        <param argument="--pep_colname_func" type="text" label="Peptide column name" 
            help="The column name within the function file that corresponds to the peptide sequences">
            <validator type="empty_field"/>
        </param>
        <param argument="--func_colname" type="text" label="Functional column name" 
            help="The column name within the function file with the functional terms">
            <validator type="empty_field"/>
        </param>
    </xml>
    <xml name="TAX_FILE">
        <param argument="--tax_file" type="data" format="tabular" label="Taxonomy assignments file"/>
        <param argument="--pep_colname_tax" type="text" label="Peptide column name" 
            help="The column name within the taxonomy file that corresponds to the peptide sequences">
            <validator type="empty_field"/>
        </param>
        <param argument="--tax_colname" type="text" label="Taxonomy column name"> 
            <help>
                Name of taxonomy column in taxonomy assignments file. The column must
                be either NCBI taxids (strongly preferred) or taxonomy
                names. Unipept name output is known to function well,
                but other formats may not work.
            </help>
            <validator type="empty_field"/>
        </param>
    </xml>
    <token name="@MAKE_SAMPS_TSV@"><![CDATA[
        ### make samps config file 
        #if $samps_args.samps_src == 'history':
            cat '$samps_args.samps_file' > samp_file.tab &&
        #else:
            #set $samp_header = 'group\tcolnames'
            echo -e '${samp_header}' > samp_file.tab &&
            #for $s in $samps_args.samps
                #set $sample = str($s.group_name) + '\t' + str($s.col_names)
                echo -e '${sample}' >> samp_file.tab &&
            #end for
        #end if
    ]]>
    </token>
    <token name="@DB_DIR@"><![CDATA[
        #if $db_dir.db_loc == 'auto':
            #if $mode_args.mode == 'taxfn'
                --ft_func_data_dir data
                --ft_tax_data_dir  data
            #else
                --data_dir data
            #end if
        ## #elif $db_dir.db_loc == 'cached':
        #end if
    ]]>
    </token>
    <xml name="data_dir">
        <conditional name="db_dir">
            <param argument="db_loc" type="select" label="Taxonomy and Functional Databases">
                <option value="auto">automatcally load databases</option>
                <!-- bioconda recipe would need to install the databases
                <option value="pkg">use default metaquantome databases (not current)</option>
                -->
                <!-- requires a data_manager
                <option value="cached">Use cached databases</option>
                -->
            </param>
            <when value="auto"/>
            <!-- bioconda recipe would need to install the databases
            <when value="pkg"/>
            -->
            <!-- requires a data_manager
            <when value="cached">
            </when>
            -->
        </conditional>
    </xml>
    <token name="@COMMON_PARAMS@"><![CDATA[
            --samps samp_file.tab
            --mode '$mode_args.mode'
            #if $mode_args.mode == 'f'
                --func_file='$mode_args.func_file'
                --func_colname='$mode_args.func_colname'
                --pep_colname_func='$mode_args.pep_colname_func'
                --ontology='$mode_args.ontology_args.ontology'
                #if $mode_args.ontology_args.ontology == 'go'
                    #if $mode_args.ontology_args.slim_down
                        --slim_down
                    #end if
                #end if
            #end if
            #if $mode_args.mode =='t'
                --tax_file='$mode_args.tax_file'
                --tax_colname='$mode_args.tax_colname'
                --pep_colname_tax='$mode_args.pep_colname_tax'
            #end if
            #if $mode_args.mode == 'ft'
                --func_file='$mode_args.func_file'
                --func_colname='$mode_args.func_colname'
                --pep_colname_func='$mode_args.pep_colname_func'
                --ontology=$mode_args.ontology
                --tax_file='$mode_args.tax_file'
                --tax_colname='$mode_args.tax_colname'
                --pep_colname_tax='$mode_args.pep_colname_tax'
                --ft_tar_rank='$mode_args.ft_tar_rank'
            #end if
    ]]>
    </token>
    <xml name="SAMPS">
        <conditional name="samps_args">
            <param argument="samps_src" type="select" label="Samples">
                <option value="history">Use a samples dataset from your history</option>
                <option value="build">Specify samples</option>
            </param>
            <when value="history">
                <param name="samps_file" type="data" format="tabular" label="Samples file">
                </param>
            </when>
            <when value="build">
                <repeat name="samps" title="Samples">
                    <param name="group_name" type="text" label="Group name"/>
                    <param name="col_names" type="text" label="Column names of samples in group"/>
                </repeat>
            </when>
        </conditional>
    </xml>
    <xml name="common_params">
        <conditional name="mode_args">
            <param argument="--mode" type="select" label="Mode">
                <option value="f">Functional analysis</option>
                <option value="t">Taxonomic analysis</option>
                <option value="ft">Functional-taxonomic interaction analysis</option>
            </param>
            <when value="f">
                <expand macro="FUNC_FILE"/>
                <conditional name="ontology_args">
                    <param name="ontology" type="select" label="Ontology">
                        <option value="go">GO Gene Ontology (column named 'go')</option>
                        <option value="ec">EC Enzyme Commission (column named 'ec')</option>
                        <option value="cog">COG (column named 'cog')</option>
                    </param>
                    <when value="go">
                        <param argument="--slim_down" type="boolean" label="Use slim GO"/>
                    </when>
                    <when value="ec">
                        <!-- do nothing -->
                    </when>
                    <when value="cog">
                        <!-- do nothing -->
                    </when>
                </conditional>
            </when>
            <when value="t">
                <expand macro="TAX_FILE"/>
            </when>
            <when value="ft">
                <expand macro="FUNC_FILE"/>
                <expand macro="TAX_FILE"/>
                <param argument="--ft_tar_rank" type="select" label="rank at which to group taxonomy">
                    <option value="species">species</option>
                    <option value="genus" selected="true">genus</option>
                    <option value="family">family</option>
                    <option value="order">order</option>
                    <option value="class">class</option>
                    <option value="phylum">phylum</option>
                    <option value="kingdom">kingdom</option>
                </param>
            </when>
        </conditional>
        <expand macro="SAMPS"/>
    </xml>
    <xml name="output_samples_choice">
        <param name="output_samps" type="boolean" truevalue="yes" falsevalue="no" checked="false" label="Output the samples fiile"/>
    </xml>
    <xml name="output_samples">
        <data format="tabular" name="samples_file" label="${tool.name} on ${on_string} samples" from_work_dir="samp_file.tab">
            <filter>output_samps == True</filter>
        </data>
    </xml>

    <xml name="citations">
        <citations>
            <yield />
        </citations>
    </xml>
</macros>