Source code

Download source archive ↓

upstream-extended/iuc/tools/fasta_stats/fasta-stats.xml

1<tool id="fasta-stats" name="Fasta Statistics" version="2.0" profile="20.05">
2    <description>display summary statistics for a FASTA file</description>
3    <requirements>
4        <requirement type="package" version="1.21.4">numpy</requirement>
5        <requirement type="package" version="1.79">biopython</requirement>
6    </requirements>
7    <command detect_errors="exit_code"><![CDATA[
8        python '${__tool_directory__}/fasta-stats.py'
9        --fasta '$fasta'
10        --stats_output '$stats_output'
11        #if $gaps_option
12            --gaps_output '$gaps_output'
13        #end if
14        #if $genome_size
15            --genome_size $genome_size
16        #end if
17        ]]>
18    </command>
19    <inputs>
20        <param argument="--fasta" type="data" format="fasta" label="FASTA or Multi-FASTA file" help="FASTA dataset to get statistics."/>
21        <param argument="--genome_size" type="integer" min="0" optional="true" label="Estimated genome size" help="This parameter is optional. If provided, it will be used for calculating the NG50 statistic." />
22        <param argument="--gaps_option" type="boolean" truevalue="true" falsevalue="false" label="Generate gap stats"/>
23    </inputs>
24    <outputs>
25        <data name="stats_output" format="tabular" label="${tool.name} on ${on_string}: summary stats"/>
26        <data name="gaps_output" format="bed" label="${tool.name} on ${on_string}: Gap stats">
27            <filter>gaps_option</filter>
28        </data>
29    </outputs>
30    <tests>
31        <test expect_num_outputs="1">
32            <param name="fasta" value="test.fasta" ftype="fasta"/>
33            <output name="stats_output" file="test_01.tab" ftype="tabular"/>
34        </test>
35        <!--Test gap options and NG50-->
36        <test expect_num_outputs="2">
37            <param name="fasta" value="ng50_input.fasta" ftype="fasta"/>
38            <param name="gaps_option" value="true"/>
39            <param name="genome_size" value="4000"/>
40            <output name="stats_output" file="test_02.tab" ftype="tabular"/>
41            <output name="gaps_output" file="test_02.bed" ftype="bed"/>
42        </test>
43        <!--Compare outputs with QUAST-->
44        <test expect_num_outputs="1">
45            <param name="fasta" value="test_long_sequence.fasta" ftype="fasta"/>
46            <output name="stats_output" ftype="tabular">
47                <assert_contents>
48                    <has_text text="8353"/>
49                    <has_text text="303889"/>
50                    <has_text text="22107"/>
51                </assert_contents>  
52            </output>
53        </test>
54    </tests>
55    <help><![CDATA[
56
57 .. class:: infomark
58
59**Purpose**
60
61Displays the summary statistics for a FASTA file.
62
63------
64
65 .. class:: infomark
66
67**Outputs**
68
69This tool generates two outputs: a general summary and an optional gap stats file.
70
71The general summary includes the following information:
72
73- Lengths: n50, min, max, median and average
74- Number of base pairs: A, C, G, T, N, Total and Total_not_N
75- Number of sequences
76- GC content
77
78In addition the optional gap stats BED file includes the information about gaps localization.
79    ]]>
80    </help>
81    <citations>
82        <citation type="bibtex">
83            @UNPUBLISHED{Anmol_Kyran2021,
84                author = {Anmol Kyran},
85                title = {Fasta Statistics: Display summary statistics for a fasta file.},
86                year = {2021},
87                url = {https://github.com/galaxyproject/tools-iuc},
88            }
89        </citation>
90    </citations>
91</tool>