view trycycler_consensus.xml @ 4:43af166bc01e draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/trycycler commit e093c3f4fa599c1cb5cfc6f98e11ff1070ce440f"
author iuc
date Mon, 13 Dec 2021 21:17:36 +0000
parents e59bee4565b3
children 9ded6109434a
line wrap: on
line source

<tool id='trycycler_consensus' name='Trycycler consensus' version='@TOOL_VERSION@' profile='20.01'>
    <description>generate a consensus contig sequence for each cluster</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro='edam_ontology' />
    <expand macro='requirements' />
    <version_command>trycycler --version</version_command>
    <command detect_errors='exit_code'><![CDATA[
        mkdir -p 'selected_cluster' &&
        ln -s '${cluster_all_seqs}' 'selected_cluster/2_all_seqs.fasta' &&
        ln -s '${reconcile_msa}' 'selected_cluster/3_msa.fasta' &&
        ln -s '${partition_reads}' 'selected_cluster/4_reads.fastq' &&
        trycycler consensus --cluster_dir 'selected_cluster'
            #if $linear
                --linear
            #end if
            --min_aligned_len $min_aligned_len
            --min_read_cov $min_read_cov
            --threads \${GALAXY_SLOTS:-2} &&
            mv 'selected_cluster/7_final_consensus.fasta' $consensus
    ]]>    </command>
    <inputs>
        <param name='cluster_all_seqs' type='data' format='fasta' label='Reconciled cluster' help='Reconciled sequences file' />
        <param name='reconcile_msa' type='data' format='fasta' label='Reconcile msa' help='Multiple sequence alignment file' />
        <param name='partition_reads' type='data' format='fastq' label='Partition reads' help='Partitioned reads' />
        <param name='reads' type='data' format='fastq,fastq.gz' label='Long-read datasets' help='Long reads (FASTQ format) used to generate the assemblies' />
        <param argument='--linear' type='boolean' truevalue='--linear' falsevalue='' label='Input contigs are not circular' help='Use this option if your input contigs are not circular. It will disable the circularisation-correction steps in Trycycler reconcile.' />
        <param argument='--min_aligned_len' type='integer' min='500' max='3500' value='1000' label='Min bases aligned' help='Reads with less than this many bases aligned (default = 1000) will be ignored.' />
        <param argument='--min_read_cov' type='integer' min='0' max='100' value='90' label='Min read length covered by alignments' help='Reads with less than this percentage of their length covered by alignments (default = 90.0) will be ignored.' />
    </inputs>
    <outputs>
        <data name='consensus' format='fasta' label='${tool.name} on ${on_string}' />
    </outputs>
    <tests>
        <test>
            <param name='cluster_all_seqs' value='reconciled_cluster_01.fasta' />
            <param name='reconcile_msa' value='aligned_cluster_01.fasta' />
            <param name='partition_reads' value='partition_01.fastq' />
            <param name='reads' value='reads.fastq.gz' />
            <param name='min_aligned_len' value='1200' />
            <param name='min_read_cov' value='95' />
            <output name='consensus' file='consensus_sequence_01.fasta' />
        </test>
        <test>
            <param name='cluster_all_seqs' value='reconciled_cluster_02.fasta' />
            <param name='reconcile_msa' value='aligned_cluster_02.fasta' />
            <param name='partition_reads' value='partition_01.fastq' />
            <param name='reads' value='reads.fastq.gz' />
            <param name='min_aligned_len' value='1100' />
            <param name='min_read_cov' value='90' />
            <output name='consensus' file='consensus_sequence_02.fasta' />
        </test>
        <test>
            <param name='cluster_all_seqs' value='reconciled_cluster_03.fasta' />
            <param name='reconcile_msa' value='aligned_cluster_03.fasta' />
            <param name='partition_reads' value='partition_01.fastq' />
            <param name='reads' value='reads.fastq.gz' />
            <param name='min_aligned_len' value='1300' />
            <param name='min_read_cov' value='97' />
            <output name='consensus' file='consensus_sequence_03.fasta' />
        </test>
        <test>
            <param name='cluster_all_seqs' value='reconciled_cluster_03.fasta' />
            <param name='reconcile_msa' value='aligned_cluster_03.fasta' />
            <param name='partition_reads' value='partition_01.fastq' />
            <param name='reads' value='reads.fastq.gz' />
            <param name='min_aligned_len' value='1000' />
            <param name='min_read_cov' value='87' />
            <output name='consensus' file='consensus_sequence_04.fasta' />
        </test>
    </tests>
    <help><![CDATA[

.. class:: infomark

**Purpose**

**Trycycler consensus** generate a consensus contig sequence for each cluster. It does this by converting the MSA into a graph form. When there is a tie between options, Trycycler aligns the reads to the alternative sequences and chooses the option with the best read alignment scores.

    ::

        GGAGGAGCTTTT-CGCCGCAGTCAACGAA-TAGCGTCTGAAAACGTGTATCAT
        GGAGGAGCTTTTTCGCCGCAGTCAAC--A-TAGCGTCTGAAAACGTGTATCAT
        GGAGGAGCTTTTTCGCCGCAGTCAAC--ATTAGCGTCTGAAAACGTGTATCAT
        GGAGGAGCTTTTTCGCCGCAGTCAAC--A-TAGCGTCTGAAAACGTGTATCAT
        GGAGGAGCTTTT-CGCCGCAGTCAAC--A-TAGCGTCTGAAAACGTGTATCAT

From the hypothetical MSA, Trycycler generates a variation graph:

    ::

                     ↗ - ↘               ↗ GAA- ↘
                     ↗ T ↘               ↗ --A- ↘
        GGAGGAGCTTTT → T → CGCCGCAGTCAAC → --AT → TAGCGTCTGAAAACGTGTATCAT
                     ↘ T ↗               ↘ --A- ↗
                     ↘ - ↗               ↘ --A- ↗



The first thing Trycycler uses to choose variants is minimum total Hamming distance to the other variants. In cases of a minimum total Hamming distance tie, Trycycler will align the reads to each possibility and choose the option with the highest total read alignment score. Read alignment scores are calculated using a simple scheme: match score = 1, mismatch penalty = 1, gap open/extension penalty = 1. More information in the `documentation <https://github.com/rrwick/Trycycler/wiki/How-variants-are-chosen-for-the-consensus-sequence/>`_.



----
                    
.. class:: infomark
                    
**Input**

This tool requires the output generated by **Trycylcler reconcile**, **Trycycler msa** and **Trycycler partition**.


----
                    
.. class:: infomark
                    
**Output**
                    
It generates a fasta file with the consesus sequence the cluster.


----                                                                                                    
                                                                                                        
.. class:: infomark

@PIPELINE@
    ]]>    </help>
    <expand macro='citations' />
</tool>