view canu.xml @ 2:c5b7390290b1 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/canu commit ecd77cd558a9b941fd0dfb71c4e534feba3ee7da
author bgruening
date Sun, 26 May 2019 10:52:09 -0400
parents 58346ef3116b
children 5732f959936a
line wrap: on
line source

<tool id="canu" name="Canu assembler" version="1.8">
    <description>Assembler optimized for long error-prone reads such as PacBio, Oxford Nanopore </description>
    <requirements>
        <requirement type="package" version="1.8">canu</requirement>
    </requirements>
    <version_command>canu --version</version_command>
    <command detect_errors="exit_code">
    <![CDATA[

    #for $counter, $input in enumerate($inputs):
        #if $input.ext in ['fastq.gz', 'fasta.gz']
            ## linking does not work
            cp '$input' ./input_${counter}.gz &&
        #end if
    #end for

    canu
        #if $stage != 'all':
            $stage
        #end if
        -p canu
        -d out_dir
        #if $s:
            -s '$s'
        #end if
        genomeSize=$genomeSize
        #if $rawErrorRate:
            rawErrorRate=$rawErrorRate
        #end if
        #if $correctedErrorRate:
            correctedErrorRate=$correctedErrorRate
        #end if
        minReadLength=$minReadLength
        minOverlapLength=$minOverlapLength
        corOutCoverage=$corOutCoverage
        contigFilter='
            ${contigFilter.minReads}
            ${contigFilter.minLength}
            ${contigFilter.singleReadSpan}
            ${contigFilter.lowCovSpan}
            ${contigFilter.lowCovDepth}
        '
        genomeSize=$genomeSize
        minThreads=\${GALAXY_SLOTS:-4}
        maxThreads=\${GALAXY_SLOTS:-4}
        obtovlThreads=\${GALAXY_SLOTS:-4}
        utgovlThreads=\${GALAXY_SLOTS:-4}
        batThreads=\${GALAXY_SLOTS:-4}
        batMemory=\${GALAXY_MEMORY_MB:-4096}M
        cormhapMemory=\${GALAXY_MEMORY_MB:-4096}M
        obtovlMemory=\${GALAXY_MEMORY_MB:-4096}M
        utgovlMemory=\${GALAXY_MEMORY_MB:-4096}M
        gfaThreads=\${GALAXY_SLOTS:-4}
        corThreads=\${GALAXY_SLOTS:-4}
        cnsThreads=\${GALAXY_SLOTS:-4}
        useGrid=false
        $mode
        #for $counter, $input in enumerate($inputs):
            #if $input.ext in ['fastq.gz', 'fasta.gz']
                ./input_${counter}.gz
            #else:
                '$input'
            #end if
        #end for
        2>&1
        &&  
        echo "Check echo"
    ]]>
    </command>
    <inputs>
        <param name="inputs" type="data" format="fasta,fasta.gz,fastq,fastq.gz" multiple="true" label="Input reads" />
        <param name="mode" type="select" label="Mode">
            <option value="-nanopore-raw" selected="true">Nanopore raw</option>
            <option value="-nanopore-corrected">Nanopore corrected</option>
            <option value="-pacbio-raw">PacBio raw</option>
            <option value="-pacbio-corrected">PacBio corrected</option>
        </param>
        <param name="stage" type="select" label="To restrict canu to only a specific stage, use">
            <option value="all" selected="true">all</option>
            <option value="-correct">generate corrected reads</option>
            <option value="-trim">generate trimmed reads</option>
            <option value="-assemble">generate an assembly</option>
            <option value="-trim-assemble">generate trimmed reads and then assemble them</option>
        </param>
        <param argument="genomeSize" type="text" label="Estimated genome size (e.g. 80m, 15k, 2g)">
            <validator type="empty_field" />
        </param>
        <param argument="rawErrorRate" type="float" value="" optional="true" min="0" max="1"
            label="Maximum raw overlap mismatch" help="The defaults are 0.300 for PacBio reads and 0.500 for Nanopore reads." />
        <param argument="correctedErrorRate" type="float" value="" optional="true" min="0" max="1"
            label="Maximum corrected overlap mismatch" help="The allowed difference in an overlap between two corrected reads.  Assemblies of
                low coverage or data with biological differences will benefit from a slight increase
                in this.  Defaults are 0.045 for PacBio reads and 0.144 for Nanopore reads." />
        <param argument="minReadLength" type="integer" value="1000" min="1" label="Minimum read length" />
        <param argument="minOverlapLength" type="integer" value="500" min="1" label="Minimum overlap" />
        <param argument="corOutCoverage" type="integer" value="40" min="1" label="Target coverage for corrected reads" />
        <param argument="-s" type="data" format="txt" optional="true" label="Additonal options" help="Additional specifications provided in a canu spec file." />

        <section name="contigFilter" title="Contig Filters">
            <param argument="minReads" type="integer" value="2" min="0" label="Minimum reads" />
            <param argument="minLength" type="integer" value="0" min="0" label="Minimum length" />
            <param argument="singleReadSpan" type="float" value="1.0" min="0.0" max="1.0" label="Maximum single read span (fraction)" />
            <param argument="lowCovSpan" type="float" value="0.5" min="0.0" max="1.0" label="Low coverage span (fraction)" />
            <param argument="lowCovDepth" type="integer" value="5" min="0" label="Low coverage depth" />
        </section>
    </inputs>
    <outputs>
        <data name="contigs" format="fasta" from_work_dir="out_dir/canu.contigs.fasta" label="${tool.name} on ${on_string} (contigs)">
            <filter>stage == 'all'</filter>
        </data>
        <data name="unassembled" format="fasta" from_work_dir="out_dir/canu.unassembled.fasta" label="${tool.name} on ${on_string} (unassembled)">
            <filter>stage == 'all'</filter>
        </data>
        <data name="unitigs" format="fasta" from_work_dir="out_dir/canu.unitigs.fasta" label="${tool.name} on ${on_string} (unitigs)">
            <filter>stage == 'all'</filter>
        </data>
        <data name="corrected_reads" format="fasta.gz" from_work_dir="out_dir/canu.correctedReads.fasta.gz" label="${tool.name} on ${on_string} (corrected reads)">
            <filter>'-correct' in stage or stage == 'all'</filter>
        </data>
        <data name="trimmed_reads" format="fasta.gz" from_work_dir="out_dir/canu.trimmedReads.fasta.gz" label="${tool.name} on ${on_string} (trimmed reads)">
            <filter>'-trim' in stage or stage == 'all'</filter>
        </data>
    </outputs>
     <tests>
       <test expect_num_outputs="5">
            <param name="inputs" ftype="fasta" value="ecoli-reads.fasta"/>
            <param name="genomeSize" value="4.6m" />
            <param name="minReadLength" value="2000" />
            <output name="contigs" ftype="fasta" file="ecoli_canu_contigs_result1.fa"/>
            <output name="unitigs" ftype="fasta" file="ecoli_canu_unitigs_result1.fa"/>
            <output name="unassembled" ftype="fasta" file="ecoli_canu_unassembled_result1.fa"/>
            <output name="corrected_reads" ftype="fasta.gz" decompress="True" file="ecoli_canu_corrected_reads_result1.fa.gz"/>
            <output name="trimmed_reads" ftype="fasta.gz" decompress="True" file="ecoli_canu_trimmed_reads_result1.fa.gz"/>
        </test>
        <test expect_num_outputs="5">
            <param name="inputs" ftype="fasta" value="ecoli-reads.fasta"/>
            <param name="genomeSize" value="4.6m" />
            <param name="minReadLength" value="2000" />
            <param name="minOverlapLength" value="800" />
            <param name="rawErrorRate" value="0.2" />
            <param name="correctedErrorRate" value="0.05" />
            <param name="corOutCoverage" value="2" />
            <output name="contigs" ftype="fasta" file="ecoli_canu_contigs_result2.fa"/>
            <output name="unitigs" ftype="fasta" file="ecoli_canu_unitigs_result2.fa"/>
            <output name="unassembled" ftype="fasta" file="ecoli_canu_unassembled_result2.fa"/>
            <output name="corrected_reads" ftype="fasta.gz" decompress="True" file="ecoli_canu_corrected_reads_result2.fa.gz"/>
            <output name="trimmed_reads" ftype="fasta.gz" decompress="True" file="ecoli_canu_trimmed_reads_result2.fa.gz"/>
        </test>
        <test expect_num_outputs="1">
            <param name="inputs" ftype="fasta" value="ecoli-reads.fasta"/>
            <param name="stage" value="-correct"/>
            <param name="minReadLength" value="2500" />
            <param name="genomeSize" value="4.6m" />
            <output name="corrected_reads" ftype="fasta.gz" decompress="True" file="ecoli_canu_corrected_reads_result3.fa.gz"/>
        </test> 
        <test expect_num_outputs="1">
            <param name="inputs" ftype="fasta" value="ecoli-reads.fasta"/>
            <param name="stage" value="-trim"/>
            <param name="minReadLength" value="2500" />
            <param name="genomeSize" value="4.6m" />
            <output name="trimmed_reads" ftype="fasta.gz" compare="sim_size" delta="12000" file="ecoli_canu_trimmed_reads_result4.fa.gz"/>
        </test>  
    </tests>
    <help>
    <![CDATA[

        Canu specializes in assembling PacBio or Oxford Nanopore sequences. Canu operates in three phases: correction, trimming and assembly.
        The correction phase will improve the accuracy of bases in reads. The trimming phase will trim reads to the portion that appears to
        be high-quality sequence, removing suspicious regions such as remaining SMRTbell adapter. The assembly phase will order the reads
        into contigs, generate consensus sequences and create graphs of alternate paths.

        For eukaryotic genomes, coverage more than 20x is enough to outperform current hybrid methods, however, between 30x and 60x
        coverage is the recommended minimum. More coverage will let Canu use longer reads for assembly, which will result in better assemblies.

        http://canu.readthedocs.io

    ]]>
    </help>
    <citations>
        <citation type="doi">10.1101/gr.215087.116</citation>
        <citation type="doi">10.1093/bioinformatics/btw753</citation>
        <citation type="doi">10.1038/nbt.3238</citation>
        <citation type="doi">10.1126/science.287.5461.2196</citation>
        <citation type="doi">10.1038/nmeth.4035</citation>
        <citation type="doi">10.1038/nmeth.2474</citation>
    </citations>
</tool>