view seq_form_db.xml @ 0:1769c133986b draft default tip

planemo upload for repository https://github.com/brsynth/galaxytools/tree/main/tools commit 3401816c949b538bd9c67e61cbe92badff6a4007-dirty
author tduigou
date Wed, 11 Jun 2025 09:42:52 +0000
parents
children
line wrap: on
line source

<tool id="seq_form_db" name="Get sequences Data From DB" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.09">
    <description>Import fragment's data from an accessible DB and export it as .gb files</description>
    <macros>
        <token name="@VERSION_SUFFIX@">0</token>
        <token name="@TOOL_VERSION@">0.1.0</token>
    </macros>
    <requirements>
        <requirement type="package" version="2.2.3">pandas</requirement>
        <requirement type="package" version="2.0.40">sqlalchemy</requirement>
        <requirement type="package" version="2.9.9">psycopg2</requirement>
        <requirement type="package" version="1.85">biopython</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        mkdir 'outdir' &&
        python '$__tool_directory__/get_db_info.py'
            --input '$input' 
            --sequence_column '$sequence_column'
            --annotation_columns '$annotation_columns'
            --db_uri '$db_uri' 
            --table '$table' 
            --fragment_column '$fragment_column'
            --output 'outdir'
    ]]></command>
    <inputs> 
        <param name="input" type="data" format="csv" label="Input CSV File" />
        <param name="table" type="text" label="DB Table Name" optional="false" />
        <param name="sequence_column" type="text" label="DB Column Contains Sequence For ganbank File" optional="false" />
        <param name="annotation_columns" type="text" label="DB Column Contains Annotation For Ganbank File" optional="false" />
        <param name="fragment_column" type="text" label="DB IDs Column Name" optional="false" />
        <param name="db_uri" type="text" label="DB Connection URI" help="postgresql://container_name:password@host:port/path/to/database" optional="false" />
    </inputs>    
    <outputs>
        <collection name="output_gb" type="list" label="GenBank Files collection" >
            <discover_datasets pattern="(?P&lt;name&gt;.*).gb" format="genbank" directory="outdir" />
        </collection>
    </outputs>
    <tests>
    <!--python get_db_info.py -input 'test-data/test_input.csv' -sequence_column 'sequence' -annotation_column 'annotation' -db_uri 'postgresql://postgres:RK17@localhost:5432/test_fragments_db' -table 'sample' -fragment_column 'fragment' -output 'test-data/output'-->
        <test> 
            <param name="input" value="2-step-golden_gate_plan.csv" />
            <param name="table" value="sample" />
            <param name="sequence_column" value="sequence" />
            <param name="annotation_columns" value="annotation" />
            <param name="fragment_column" value="fragment" />
            <param name="db_uri" value="postgresql://postgres:RK17@localhost:5432/test_fragments_db" />
            <output_collection name="output_gb" type="list" count="12">
                <element name="part_A">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_B">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_C">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_D">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_E">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_F">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_G">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_H">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_I">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_J">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_K">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
                <element name="part_L">
                    <assert_contents>
                     <has_n_lines min="10" />
                    </assert_contents>
                </element>
            </output_collection>
        </test>
    </tests>
    
    <help><![CDATA[
Get sequences Data From DB
==========================

Implemented a system to generate GenBank (.gb) files for ADN fragments in CSV input, based on data retrieved from an accessible database via URI requests.

**Parameters**:
---------------
* **Input CSV File**: Assembly csv contains construct IDs in the first column and their corresponding fragments in the following columns. (Without Header)
* **DB Table Name**: Name of the target table in the database.
* **DB Column Contains Sequence For ganbank File**: Column storing sequence data, expected to start with "ORIGIN". 
* **DB Column Contains Annotation For Ganbank File**: Column containing annotation data, starting with "FEATURES" and including "LOCUS" information. Other metadata is optional.
* **DB IDs Column Name**: Column holding the unique fragment IDs.
* **DB Connection URI**: URI used to connect to the database (e.g., postgresql://postgres:pass@localhost:5432/test_fragments_db).
    ]]></help>
    <citations>
        <citation type="bibtex">
            @unpublished{seq_form_db
                author = {Ramiz Khaled},
                title = {{seq_form_db}},
                url = {https://github.com/brsynth/},
            }
        </citation>
    </citations>
</tool>