view remove_terminal_stop_codons.xml @ 0:0290a7285026 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/remove_terminal_stop_codons commit 0c1c0e260ebecab6beb23fd56322b391e62d12fa
author iuc
date Fri, 05 Dec 2025 23:22:35 +0000
parents
children
line wrap: on
line source

<tool id="remove_terminal_stop_codons" name="Remove terminal stop codons" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>from coding sequences</description>
    <macros>
        <token name="@TOOL_VERSION@">1.0.0</token>
        <token name="@VERSION_SUFFIX@">0</token>
        <token name="@PROFILE@">25.0</token>
    </macros>
    <requirements>
        <requirement type="package" version="1.84">biopython</requirement>
    </requirements>
    <required_files>
        <include path="remove_terminal_stop_codons.py" />
    </required_files>
    <command detect_errors="exit_code"><![CDATA[
        python '$__tool_directory__/remove_terminal_stop_codons.py'
            -i '$input'
            -o '$output'
            #if str($genetic_code) != "1"
                -t '$genetic_code'
            #end if
            $no_check_internal
    ]]></command>
    <inputs>
        <param name="input" type="data" format="fasta" label="Input FASTA file"
            help="FASTA file containing coding sequences (CDS) to process." />
        <param name="genetic_code" type="select" label="Genetic code"
            help="NCBI translation table to use for identifying stop codons. Different organisms use different genetic codes.">
            <option value="1" selected="true">1 - Standard</option>
            <option value="2">2 - Vertebrate Mitochondrial</option>
            <option value="3">3 - Yeast Mitochondrial</option>
            <option value="4">4 - Mold, Protozoan, Coelenterate Mitochondrial and Mycoplasma/Spiroplasma</option>
            <option value="5">5 - Invertebrate Mitochondrial</option>
            <option value="6">6 - Ciliate, Dasycladacean and Hexamita Nuclear</option>
            <option value="9">9 - Echinoderm and Flatworm Mitochondrial</option>
            <option value="10">10 - Euplotid Nuclear</option>
            <option value="11">11 - Bacterial, Archaeal and Plant Plastid</option>
            <option value="12">12 - Alternative Yeast Nuclear</option>
            <option value="13">13 - Ascidian Mitochondrial</option>
            <option value="14">14 - Alternative Flatworm Mitochondrial</option>
            <option value="15">15 - Blepharisma Nuclear</option>
            <option value="16">16 - Chlorophycean Mitochondrial</option>
            <option value="21">21 - Trematode Mitochondrial</option>
            <option value="22">22 - Scenedesmus obliquus Mitochondrial</option>
            <option value="23">23 - Thraustochytrium Mitochondrial</option>
            <option value="24">24 - Rhabdopleuridae Mitochondrial</option>
            <option value="25">25 - Candidate Division SR1 and Gracilibacteria</option>
            <option value="26">26 - Pachysolen tannophilus Nuclear</option>
            <option value="27">27 - Karyorelict Nuclear</option>
            <option value="28">28 - Condylostoma Nuclear</option>
            <option value="29">29 - Mesodinium Nuclear</option>
            <option value="30">30 - Peritrich Nuclear</option>
            <option value="31">31 - Blastocrithidia Nuclear</option>
            <option value="33">33 - Cephalodiscidae Mitochondrial UAA-Tyr</option>
        </param>
        <param argument="--no-check-internal" type="boolean" truevalue="--no-check-internal" falsevalue=""
            checked="false" label="Skip internal stop codon check"
            help="By default, the tool will fail if internal (in-frame) stop codons are found. Enable this to only remove terminal stops without checking for internal ones." />
    </inputs>
    <outputs>
        <data name="output" format="fasta" label="${tool.name} on ${on_string}" />
    </outputs>
    <tests>
        <!-- Test 1: Basic removal of terminal stop codon -->
        <test expect_num_outputs="1">
            <param name="input" value="with_terminal_stop.fasta" ftype="fasta" />
            <param name="genetic_code" value="1" />
            <output name="output" file="without_terminal_stop.fasta" ftype="fasta" />
        </test>
        <!-- Test 2: Sequence without terminal stop (should pass through unchanged) -->
        <test expect_num_outputs="1">
            <param name="input" value="no_terminal_stop.fasta" ftype="fasta" />
            <param name="genetic_code" value="1" />
            <output name="output" file="no_terminal_stop.fasta" ftype="fasta" />
        </test>
        <!-- Test 3: Internal stop codon should fail -->
        <test expect_failure="true">
            <param name="input" value="with_internal_stop.fasta" ftype="fasta" />
            <param name="genetic_code" value="1" />
        </test>
        <!-- Test 4: Internal stop with skip check should pass -->
        <test expect_num_outputs="1">
            <param name="input" value="with_internal_stop.fasta" ftype="fasta" />
            <param name="genetic_code" value="1" />
            <param name="no_check_internal" value="true" />
            <output name="output" file="with_internal_stop_output.fasta" ftype="fasta" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

This tool removes terminal (trailing) stop codons from coding sequences in a FASTA file.
It is designed as a **preprocessing step** for downstream tools like **cawlign** and **HyPhy**
that do not permit stop codons in their input sequences.

**Important**: By default, this tool will **fail with an error** if it detects any internal
(in-frame) stop codons in your sequences. This is intentional, but can be disabled with the
`--no-check-internal` option.

----

**Input**

A FASTA file containing coding sequences (CDS). Sequences should be:

- In the correct reading frame (starting at position 1 of a codon)
- DNA sequences (RNA sequences with U will be converted to T)

----

**Output**

A FASTA file with terminal stop codons removed. The output preserves:

- Sequence identifiers and descriptions
- Sequences that don't end with stop codons (passed through unchanged)
- Partial codons at the end (not removed)

----

**Genetic Codes**

Different organisms use different genetic codes (translation tables) which define
which codons are stop codons:

- **Standard (1)**: TAA, TAG, TGA - used by most organisms
- **Vertebrate Mitochondrial (2)**: TAA, TAG, AGA, AGG - mitochondria of vertebrates
- **Bacterial/Archaeal (11)**: TAA, TAG, TGA - bacteria and archaea

Select the appropriate genetic code for your organism to ensure correct stop codon identification.

----

**Use Cases**

1. **Before cawlign**: Remove terminal stops from sequences before codon-aware alignment
2. **Before HyPhy**: Prepare sequences for selection analysis (HyPhy methods like BUSTED, FEL, MEME)
3. **Quality control**: Identify sequences with internal stop codons that may need review
    ]]></help>
    <citations>
        <citation type="bibtex">
@misc{capheine2025,
    author = {Callan, Danielle and Verdonk, Hannah and Kosakovsky Pond, Sergei L.},
    title = {CAPHEINE: A Comprehensive Automated Pipeline Using HyPhy for Evolutionary Inference with Nextflow},
    year = {2025},
    publisher = {GitHub},
    url = {https://github.com/veg/CAPHEINE},
    note = {Terminal stop-codon removal logic in this Galaxy tool is adapted from the CAPHEINE pipeline.}
}
        </citation>
    </citations>
</tool>