view pout2mzid.xml @ 3:abed51712ed0 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tools/percolator commit b3873302e7bb7917a43b455875208e6e9fcf8f66
author galaxyp
date Sat, 08 Apr 2017 08:23:12 -0400
parents 86770eea5b09
children
line wrap: on
line source

<tool id="pout2mzid" name="Pout2mzid" version="0.3.03">
    <description>add Percolator scoring to mzIdentML</description>
    <requirements>
	    <requirement type="package" version="0.3.03">pout2mzid</requirement>
    </requirements>
    <stdio>
        <exit_code range="1:"/>
    </stdio>
    <command><![CDATA[
    #if $mzid.multifile == "true"
        mkdir p2m_mzid_in &&
        #set digits = "0" + str(len(str(len($mzid.mzids.keys()))))
        #for $i, $fn in $enumerate($mzid.mzids.keys())
            #set prefixnum = format($i, $digits)
            ln -s '$mzid.mzids[$fn]' 'p2m_mzid_in/$fn' &&
        #end for
        ls p2m_mzid_in > infiles.txt &&
        pout2mzid -p '$percout' -i p2m_mzid_in -f infiles.txt -o p2m_result -c _perco
    
    #else
        ln -s '$mzid.mzidsingle' '$mzid.mzidsingle.display_name' &&
        pout2mzid -p '$percout' -m '$mzid.mzidsingle.display_name'
    #end if
    
    #if $targetdecoy == "decoy"
        -d
    #end if
    #if $schemaskip
        -v
    #end if
    #if $mzid.multifile == "false"
        > '$output_single'
    #end if
    ]]></command>
    <inputs>
	    <param name="percout" type="data" format="percout" label="Percolator output"/>
            <conditional name="mzid">
                <param name="multifile" type="select" display="radio" label="Multiple mzIdentML files?">
                    <option value="true">Yes</option>
                    <option value="false" selected="true">No</option>
                </param>
                <when value="true">
    	            <param name="mzids" type="data_collection" collection_type="list" format="mzid" label="mzIdentML from MSGF+" />
                </when>
                <when value="false">
    	            <param name="mzidsingle" type="data" format="mzid" label="mzIdentML from MSGF+" />
                </when>
            </conditional>
	    <param name="targetdecoy" type="select" display="radio" label="Which features to add to mzIdentML">
		<option value="target" selected="true">Target</option>
		<option value="decoy">Decoy</option>
	    </param>
	    <param name="schemaskip" type="boolean" label="Skip percolator schema validation?" />
    </inputs>
    <outputs>
	    <data name="output_single" format="mzid">
               <filter>mzid['multifile'] == "false"</filter>
            </data>
	    <collection name="output_multi" type="list">
                <filter>mzid['multifile'] == "true"</filter>
                <discover_datasets pattern="__designation__" ext="mzid" directory="p2m_result" />
           </collection>
            
    </outputs>
    <tests>
        <test>
            <param name="percout" value="percolatorOut.xml" />
            <param name="mzid|multifile" value="false" />
            <param name="mzid|mzidsingle" value="dataset_2.mzid" />
            <param name="targetdecoy" value="target" />
            <param name="schemaskip" value="true" />
            <output name="output_single" value="target_ds2_withperco.mzid" />
        </test>
        <test>
            <param name="percout" value="percolatorOut.xml" />
            <param name="mzid|multifile" value="true" />
            <param name="mzid|mzids">
                <collection type="list">
                    <element name="dataset_2.mzid" value="dataset_2.mzid" />
                    <element name="dataset_3.mzid" value="dataset_2.mzid" />
                </collection>
            </param>
            <param name="targetdecoy" value="target" />
            <param name="schemaskip" value="true" />
            <output_collection name="output_multi" type="list">
                <element name="dataset_2_perco.mzid" value="target_ds2_withperco.mzid" />
                <element name="dataset_3_perco.mzid" value="target_ds3_withperco.mzid" />
            </output_collection>
        </test>
    </tests>
    <help>Pout2Mzid extracts statistics from a percolator input file, and writes them to the mzIdentML file(s) that have been used
	  to generate the percolator data. You may either pass multiple mzIdentML files in a list and one percolator file, or a single one.
    </help>
</tool>