view 1_map_reads.xml @ 2:66ca2fd8592a

planemo upload commit b'7f6183b769772449fbcee903686b8d5ec5b7439f\n'-dirty
author jpayne
date Wed, 24 Jan 2018 15:07:00 -0500
parents eefdd97a6749
children 62191abf5426
line wrap: on
line source
<tool id="map_reads" name="1. Map Reads" version="1.0.1" profile="16.10">
    <description>to index, or lookup cached alignment</description>
    <requirements>
        <requirement type="package" version="2.3.4">bowtie2</requirement>
        <requirement type="package" version="1.5.11">boto3</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        #if $reads.reads_select == 'collection'
            export files="$reads.coll.forward $reads.coll.reverse"          &&
            export params="-1 $reads.coll.forward -2 $reads.coll.reverse"   &&
        #else
            export files="$forward $reverse"                    &&
            export params="-1 $forward -2 $reverse"             &&
        #end if
        ${__tool_directory__}/snp-cache.py snp_mapped_reads 
            "\$(md5sum  $reference
                        \$files 
                        | cut -c -32 | md5sum | cut -c -32)"
            -c "
                cp $reference ./reference.fasta
                && bowtie2-build ./reference.fasta --quiet --threads \${GALAXY_SLOTS:-4} ./reference
                && bowtie2 -q -x ./reference \$params  -p \${GALAXY_SLOTS:-4} --reorder -X 1000
                "
        #if $reads.reads_select == 'collection'
            -o ${align_from_collection}
        #else
            -o ${align_from_history}
        #end if
            -l $cache_log
        && cat $cache_log
        #if $source.source_select == 'curated'
        && cp $reference $ref_out
        #end if
    ]]></command>
    <inputs>
        <!-- <conditional name="source">
            <param name="source_select" type="select" label="Use the reference associated with a provided BioProject, a curated GalaxyTrakr reference, or a reference from your history">
                <option value="bioproject">Provide a BioProject</option>
                <option value="curated">Use a GalaxyTrakr reference</option>
                <option value="history">Use a reference from your history</option>
            </param>
            <when value="bioproject">
                <param type="data" name="bioproject" format="text" />
            </when>
            <when value="curated">
    			<param name="input" type="select" label="Select reference fasta">
    				<options from_data_table="all_fasta">
    				    <filter type="sort_by" column="2"/>
        				<validator type="no_options" message="No assemblies are available for the selected input dataset"/>
    				</options>
    			</param>
    		</when>
            <when value="history">
                <param type="data" name="input" format="fasta" label="Select reference FASTA"/>
            </when>
        </conditional> -->
        <conditional name="source">
            <param name="source_select" type="select" label="Use a curated GalaxyTrakr reference or a reference from your history">
                <option value="curated">Use a GalaxyTrakr reference</option>
                <option value="history">Use a reference from your history</option>
            </param>
            <when value="curated">
    			<param name="reference" type="select" label="Select reference fasta">
    				<options from_data_table="all_fasta">
    				    <filter type="sort_by" column="2"/>
        				<validator type="no_options" message="No assemblies are available for the selected input dataset"/>
    				</options>
    			</param>
    		</when>
            <when value="history">
                <param type="data" name="reference" format="fasta" label="Select reference FASTA"/>
            </when>
        </conditional>
        <conditional name="reads">
            <param name="reads_select" type="select" label="Paired-end collection, or two datasets from your history">
                <option value="collection">Paired collection from your history</option>
                <option value="history">Two FASTQ datasets from your history</option>
            </param>
            <when value="collection">
                <param label="Paired reads" name="coll" type="data_collection" format="fastq,fastqsanger" collection_type="paired" />
            </when>
            <when value="history">
                <param label="Forward reads" type="data" name="forward" format="fastq,fastqsanger" />
                <param label="Reverse reads" type="data" name="reverse" format="fastq,fastqsanger" />
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data label="${reads.coll.name} alignment" name="align_from_collection" format="sam">
            <filter>reads['reads_select'] == 'collection'</filter>
        </data>
        <data label="${reads.forward.name.split('_')[0]} alignment" name="align_from_history" format="sam">
            <filter>reads['reads_select'] == 'history'</filter>
        </data>
        <data label="S3 Cache log" name="cache_log" format="txt" hidden="true" />
        <data label="Reference" name="ref_out" format="fasta" hidden="true">
            <filter>source['source_select'] == curated</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="source_select" value="history" />
            <param name="reference" value="reference/lambda_virus.fasta" ftype="fasta" />
            <param name="reads_select" value="history" />
            <param name="forward" value="samples/sample1/sample1_1.fastq" ftype="fastqsanger" />
            <param name="reverse" value="samples/sample1/sample1_2.fastq" ftype="fastqsanger" />
            <output name="align_from_history" value="samples/sample1/reads.sam" lines_diff="3" />
        </test>
        <test>
            <param name="source_select" value="history" />
            <param name="reference" value="reference/lambda_virus.fasta" ftype="fasta" />
            <param name="reads_select" value="collection" />
            <param name="coll">
                <collection type="paired">
                    <element name="forward" value="samples/sample1/sample1_1.fastq" ftype="fastqsanger" />
                    <element name="reverse" value="samples/sample1/sample1_2.fastq" ftype="fastqsanger" />
                </collection>
            </param>
            <output name="align_from_collection" value="samples/sample1/reads.sam" lines_diff="3" />
        </test>
    </tests>
    <help><![CDATA[
       <a href="http://snp-pipeline.readthedocs.io/en/latest/index.html">http://snp-pipeline.readthedocs.io/en/latest/index.html</a>
    ]]></help>
    <citations>
        <citation type="doi">10.7717/peerj-cs.20</citation>
        <!-- <citation type="bibtex">
@misc{cfsan-snp-pipeline,
  author = {Steve Davis and James Pettengill and Yan Luo and Justin Payne and Albert Shpuntoff and Rugh Rand and Errol Strain},
  year = {2015},
  title = {CFSAN SNP Pipeline: an automated method for constructing SNP matrices from next-generation sequence data},
  url = {https://doi.org/10.7717/peerj-cs.20},
  journal = {PeerJ Computer Science},
}</citation> -->
    </citations>
</tool>