view sra_pileup.xml @ 8:1920e0508831 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sra-tools commit 39ca11da7daeb3fa030fcb28e8987f8d7f24aec3
author iuc
date Mon, 03 Jul 2017 06:30:15 -0400
parents c7620aa7e1f0
children 6c60903f70ac
line wrap: on
line source

<tool id="sra_pileup" name="Generate pileup format" version="@VERSION@.2">
    <description>from NCBI sra</description>
    <macros>
        <import>sra_macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <version_command>sra-pileup --version</version_command>
    <command detect_errors="exit_code">
        <![CDATA[

        #if $input.input_select=="accession_number":
            acc="${input.accession}" &&
        #end if

        ## Need to set the home directory to the current working directory,
        ## else the tool tries to write to home/.ncbi and fails when used
        ## with a cluster manager.
        export HOME=\$PWD &&
        vdb-config --restore-defaults &&
        vdb-config -s "/repository/user/main/public/root=\$PWD" &&
        #if ( str( $adv.region ) == "" ):
            ASCP_PATH=`command -v ascp` &&
            ASCP_KEY=`dirname \$ASCP_PATH`/asperaweb_id_dsa.openssh || true &&
            prefetch -X 200G --ascp-path "\$ASCP_PATH|\$ASCP_KEY" "\$acc" &&
            ## Duplicate vdb-config, in case settings changed between prefetch and
            ## sra-pileup command.
            vdb-config -s "/repository/user/main/public/root=\$PWD" &&
        #end if
        sra-pileup --log-level fatal
        #if str( $adv.region ) != "":
            --aligned-region "$adv.region"
        #end if
        #if str( $adv.minMapq ) != "":
            --minmapq "$adv.minMapq"
        #end if
        #if $input.input_select == "file":
            "$input.file" > "$output_file"
        #elif $input.input_select == "accession_number":
            "\$acc" > "$output_accession"
        #elif $input.input_select == "text":
            `cat "$input.text"` > "$output_text"
        #end if
        ]]>
    </command>
    <inputs>
        <conditional name="input">
            <param name="input_select" type="select" label="select input type">
                <option value="accession_number">SRR accession</option>
                <option value="file">SRA archive in current history</option>
                <option value="text">text file containing SRR accession</option>
            </param>
            <when value="file">
                <param format="sra" name="file" type="data" label="sra archive"/>
            </when>
            <when value="accession_number">
                <param format="text" name="accession" type="text" label="SRR accession" help="Must start with SRR, e.g. SRR925743">
                    <sanitizer>
                        <valid initial="string.printable">
                            <remove value=" "/>
                        </valid>
                        <mapping initial="none">
                            <add source=" " target=""/>
                        </mapping>
                    </sanitizer>
                </param>
            </when>
            <when value="text">
                <param format="txt" name="text" type="data" label="text file"/>
            </when>
        </conditional>
        <section name="adv" title="Advanced Options" expanded="False">
            <expand macro="region"/>
          <expand macro="minMapq"/>
        </section>
    </inputs>
    <outputs>
        <data format="pileup" name="output_accession" label="${input.accession} (sra-pileup)">
            <filter>input['input_select'] == "accession_number"</filter>
        </data>
        <data format="pileup" name="output_file" label="${input.file.name} (sra-pileup)">
            <filter>input['input_select'] == "file"</filter>
        </data>
        <data format="pileup" name="output_text" label="${input.text.name} (sra-pileup)">
            <filter>input['input_select'] == "text"</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input_select" value="accession_number"/>
            <param name="accession" value="SRR925743"/>
            <param name="region" value="17:41243452-41277500"/>
            <output name="output_accession" file="sra_pileup_result.pileup" compare="contains" ftype="pileup"/>
        </test>
    </tests>
    <help>
 <![CDATA[

This tool produces pileup format from sra archives using sra-pileup.
The sra-pileup program is developed at NCBI, and is available at
http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software.
@SRATOOLS_ATTRRIBUTION@

]]>
    </help>
    <expand macro="citation"/>
</tool>