<tool id="bam_to_sqlite" name="BAM to Sqlite" version="1.4">
    <description>Convert BAM file to SQLITE for Trips-Viz</description>
    <requirements>
        <requirement type="package" version="0.19.0">pysam</requirement>
        <requirement type="package" version="1.7.0">sqlitedict</requirement>
        <requirement type="package" version="3.37.1">sqlite</requirement>
        <requirement type="package" version="1.15.1">samtools</requirement>

    </requirements>
    <command><![CDATA[
        python $__tool_directory__/bam_to_sqlite.py $input1 $input2 $input3 $output1
    ]]></command>
    <inputs>
        <param name="input1" type="data" format="bam" label="Sorted (samtools -n) BAM file" />
        <param name="input2" type="data" format="sqlite" label="Path to organism SQLITE annotation file" />
        <param name="input3" type="text" label="Description of this sample" />
    </inputs>
    <outputs>
       <data name="output1" format="sqlite"/>
    </outputs>
    <tests>
        <test>
            <param name="input1" value="test_n_sorted.bam" ftype="bam"/>
            <param name="input2" value="test_org.sqlite" ftype="sqlite"/>
            <param name="input3" value="TEST DESCRIPTION"/>
            <output name="output1" file="test_n_sorted.bamv2.sqlite" ftype="sqlite" lines_diff="4" />
        </test>
    </tests>
    <help>
        **What it does**

        Process your transcriptome read alignments for TRIPS-Viz 

        Prerequisites: 
        - name-sorted bam file (samtools sort -n)
        - TRIPS-Viz annotation file in SQLITE format.
    </help>
    <citations/>
</tool>
