view frameshift_deletions_checks.xml @ 1:029d90b0c4f6 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/smallgenomeutilities commit e702dcdbc7c3235ef3c4ee8998c7247d1af49465
author iuc
date Fri, 14 Jul 2023 22:07:22 +0000
parents f079716f598c
children e8971ca74398
line wrap: on
line source

<tool id="smgu_frameshift_deletions_checks" name="Frameshift Deletions Checks" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>reports on frameshifting indels in consensus sequence</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="xrefs"/>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">smallgenomeutilities</requirement>
    </requirements>
    <!-- once we have version-from-git-tag in 0.4.0: <version_command>frameshift_deletion_checks &#x002D&#x002Dversion</version_command> -->
    <command detect_errors="exit_code">
    <![CDATA[
#if $input.is_of_type("cram"):
ln -s '$input' input.cram &&
ln -s '$input.metadata.cram_index' input.cram.crai &&
#elif $input.is_of_type("bam"):
ln -s '$input' input.bam &&
ln -s '$input.metadata.bam_index' input.bam.bai &&
#else:
# raise TypeError('Unknown input alignment type ${input.ext}')
#end if
ln -s '$consensus' consensus.fasta &&
#if str($ref_data.choice) == 'custom':
ln -s '$reference' reference.fa &&
#else:
ln -s '$__tool_directory__/ref_NC_045512.2.fasta' reference.fa &&
#end if

frameshift_deletions_checks 
    --input=input.${input.ext}
    --consensus=consensus.fasta
    --reference=reference.fa
#if str($ref_data.choice) == 'standard':
    --genes='$__tool_directory__'/annotations_NC_045512.2.gff3
    --orf1ab='cds-YP_009724389.1'
#else:
    --genes='$ref_data.genes'
    --orf1ab='$ref_data.orf1ab'
#end if
    $out_options.english
    $out_options.zero_based
    --output=report.tsv &&
python '$__tool_directory__/frameshift_deletions_report_fixer.py' report.tsv '$report'
]]>
    <!-- ##cores \${GALAXY_SLOTS:-4} -->
    </command>
    <inputs>
        <param argument="--consensus" type="data" format="fasta" label="Consensus" help="Fasta file containing the sample's consensus sequence (majority, with indels)" />
        <param argument="--input" type="data" format="bam,cram" label="Input BAM" help="Input BAM file with sample's sequencing reads, aligned against the reference" />
        <conditional name="ref_data">
            <param name="choice" type="select" label="Reference data selection" help="Select built-in genome files to base reported positions and annotations on the SARS-CoV-2 reference sequence NC_045512.2. If you have mapped to a different reference, select custom genome files and provide the reference sequence and genomic feature annotations for it in fasta and gff format, repsectively.">
                <option value="standard">Use built-in genome files</option>
                <option value="custom">Provide custom genome files</option>
            </param>
            <when value="standard" />
            <when value="custom">
                <param argument="--reference" type="data" format="fasta" label="Reference" help="Fasta input containing the reference sequence (used during alignment) to compare against" />
                <param argument="--genes" type="data" format="gff" label="Genes GFF" help="GFF input listing genes positions on the reference sequence" />
                <param argument="--orf1ab" type="text" value="cds-YP_009724389.1" optional="false" label="Coding sequence containing ribosomal slippage site" help="ID of the full CDS comprising the ribosomal slippage site as it appears in the GFF input. In the GFF this CDS should consist of 2 entries with the same CDS ID due to the partial overlap caused by the ribosomal shift at translation time. Hint: To use the tool with genomes that do not have a ribosomal slippage site, enter an ID that is not present in the GFF.">
                    <validator type="expression">value.strip()</validator>
                </param>
            </when>
        </conditional>
        <section name="out_options" title="Output format options" expanded="true">
            <param argument="--english" type="boolean" truevalue="--english" falsevalue="--no-english" checked="true" label="Write Summary Diagnosis?" help="If checked writes english summary diagnosis." />
            <param argument="--zero-based" type="boolean" truevalue="--zero-based" falsevalue="" checked="false" optional="true" label="Use 0-based Sequence Positions?" help="Use 0-based instead of 1-based genome positions" />
        </section>
    </inputs>
    <outputs>
        <data name="report" format="tabular">
            <actions>
                <conditional name="out_options.english">
                    <!-- The "english" flag removes certain numerical columns and collapses them into new text columns -->
                    <when value="--english">
                        <action name="column_names" type="metadata" default="ref_id,start_position,length,VARIANT,gene_region,reads_all,reads_fwd,reads_rev,deletions,freq_del,freq_del_fwd,freq_del_rev,deletions_fwd,deletions_rev,insertions,freq_insert,freq_insert_fwd,freq_insert_rev,insertions_fwd,insertions_rev,stops,freq_stop,freq_stop_fwd,freq_stop_rev,stops_fwd,stops_rev,matches_ref,pos_critical_inserts,pos_critical_dels,homopolymeric,ref_base,cons_id,variant_position_english,variant_diagnosis" />
                    </when>
                    <when value="--no-english">
                        <action name="column_names" type="metadata" default="ref_id,start_position,length,VARIANT,gene_region,aa_position,stop_mismatches,stoploss_nt,reads_all,reads_fwd,reads_rev,deletions,freq_del,freq_del_fwd,freq_del_rev,deletions_fwd,deletions_rev,insertions,freq_insert,freq_insert_fwd,freq_insert_rev,insertions_fwd,insertions_rev,stops,freq_stop,freq_stop_fwd,freq_stop_rev,stops_fwd,stops_rev,matches_ref,pos_critical_inserts,pos_critical_dels,homopolymeric,ref_base,cons_id" />
                    </when>
                </conditional>
            </actions>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="consensus" value="consensus.bcftools.fasta.gz" />
            <param name="input" value="REF_aln_trim.cram" />
            <conditional name="ref_data">
                <param name="choice" value="standard" />
            </conditional>
            <output name="report" value="frameshift_deletions_check.tsv" />
        </test>
        <test>
            <param name="consensus" value="consensus.bcftools.fasta.gz" />
            <param name="input" value="REF_aln_trim.cram" />
            <conditional name="ref_data">
                <param name="choice" value="standard" />
            </conditional>
            <section name="out_options">
                <param name="english" value="false" />
            </section>
            <output name="report" value="frameshift_deletions_check_no_english.tsv" />
        </test>
        <test>
            <param name="consensus" value="consensus.bcftools.fasta.gz" />
            <param name="input" value="REF_aln_trim.cram" />
            <conditional name="ref_data">
                <param name="choice" value="custom" />
                <param name="reference" value="NC_045512.2.fasta" />
                <param name="genes" value="Genes_NC_045512.2.GFF3" />
            </conditional>
            <output name="report" value="frameshift_deletions_check.tsv" />
        </test>
    </tests>
    <help>
    <![CDATA[
Produces a report about frameshifting indels in a consensus sequences.

Developed as part of the `V-pipe workflow for analysing NGS data of short viral genomes <https://github.com/cbg-ethz/V-pipe>`_.

Columns signification:
----------------------

* *gene_region*: Gene in which the deletion is found according to ``--genes`` argument;
* *reads_all*: Total number of reads covering the indel;
* *reads_fwd*: Total number of forward reads covering the indel;
* *reads_rev*: Total number of reverse reads covering the indel;
* *deletions/insertions*: Number of reads supporting the deletion/insertion;
* *freq_del/freq_insert*: Fraction of reads supporting the deletion/insertion;
* *matches_ref*: number of reads that matche with the reference base;
* *pos_critical_inserts*: Start positions of insertions in the same gene_region that occur in > 40% of reads;
* *pos_critical_dels*: Start positions of deletions in the same gene_region that occur in > 40% of reads;
* *homopolymeric*: True if either around the start or end position of the deletion three bases are the same, which may have caused the polymerase to skip during reverse transcription of viral RNA to cDNA, e.g. AATAG;
* *ref_base*: base in the reference genome;
* *indel_position_english*: english sentence describing the indel;
* *indel_diagnosis*: english sentence with the indel diagnosis;
* *orf1ab*: CDS ID for the full Orf1ab CDS, comprising the ribosomal shift. In the GFF this CDS should consist of 2 entries with the same CDS ID due to the parital overlap caused by the ribosomal shift at translation time
]]>
    </help>
    <expand macro="citations"/>
</tool>