0
|
1 <tool id="vsnp_statistics" name="vSNP: statistics" version="1.0.0">
|
|
2 <description></description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="1.16.5">numpy</requirement>
|
|
5 <requirement type="package" version="0.25.3">pandas</requirement>
|
1
|
6 <requirement type="package" version="1.2.0">xlrd</requirement>
|
|
7 <requirement type="package" version="1.2.8">xlsxwriter</requirement>
|
0
|
8 </requirements>
|
|
9 <command detect_errors="exit_code"><![CDATA[
|
|
10 #import os
|
|
11 #import re
|
|
12 #set gzipped = 'false'
|
|
13 #set input_type = $input_type_cond.input_type
|
|
14 #set input_idxstats_dir = 'input_idxstats'
|
|
15 #set input_metrics_dir = 'input_metrics'
|
|
16 #set input_reads_dir = 'input_reads'
|
|
17 mkdir -p $input_idxstats_dir &&
|
|
18 mkdir -p $input_metrics_dir &&
|
|
19 mkdir -p $input_reads_dir &&
|
|
20 #if str($input_type) == "single":
|
|
21 #set read_type_cond = $input_type_cond.read_type_cond
|
|
22 #set read1 = $read_type_cond.read1
|
|
23 #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
|
|
24 #if str($read_type_cond.read_type) == "single":
|
|
25 ln -s '${read1}' '${read1_identifier}' &&
|
|
26 #if $read1.is_of_type('fastqsanger.gz'):
|
|
27 #set gzipped = 'true'
|
|
28 #end if
|
|
29 #else:
|
|
30 #set read2 = $read_type_cond.read2
|
|
31 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
|
|
32 ln -s '${read1}' '${read1_identifier}' &&
|
|
33 ln -s '${read2}' '${read2_identifier}' &&
|
|
34 #if $read1.is_of_type('fastqsanger.gz') and $read2.is_of_type('fastqsanger.gz'):
|
|
35 #set gzipped = 'true'
|
|
36 #end if
|
|
37 #end if
|
|
38 #set dbkey = $input_type_cond.vsnp_azc.metadata.dbkey
|
|
39 #else:
|
|
40 #for $i in $input_type_cond.reads_collection:
|
|
41 #if $i.is_of_type('fastqsanger.gz'):
|
|
42 #set gzipped = 'true'
|
|
43 #end if
|
|
44 #set filename = $i.file_name
|
|
45 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
|
1
|
46 ln -s '$filename' '$input_reads_dir/$identifier' &&
|
0
|
47 #end for
|
|
48 #for $i in $input_type_cond.samtools_idxstats_collection:
|
|
49 #set filename = $i.file_name
|
|
50 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
|
1
|
51 ln -s '$filename' '$input_idxstats_dir/$identifier' &&
|
0
|
52 #end for
|
|
53 #for $i in $input_type_cond.azc_metrics_collection:
|
|
54 #set dbkey = $i.metadata.dbkey
|
|
55 #set filename = $i.file_name
|
|
56 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
|
1
|
57 ln -s '$filename' '$input_metrics_dir/$identifier' &&
|
0
|
58 #end for
|
|
59 #end if
|
|
60 python '$__tool_directory__/vsnp_statistics.py'
|
|
61 --dbkey '$dbkey'
|
|
62 --gzipped '$gzipped'
|
|
63 #if str($input_type) == "single":
|
|
64 #if str($read_type_cond.read_type) == "single":
|
|
65 --read1 '${read1_identifier}'
|
|
66 #else:
|
|
67 --read1 '${read1_identifier}'
|
|
68 --read2 '${read2_identifier}'
|
|
69 #end if
|
|
70 --samtools_idxstats '$samtools_idxstats'
|
|
71 --vsnp_azc '$vsnp_azc'
|
|
72 #end if
|
1
|
73 --output '$output'
|
0
|
74 ]]></command>
|
|
75 <inputs>
|
|
76 <conditional name="input_type_cond">
|
|
77 <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
|
|
78 <option value="single" selected="true">Single files</option>
|
|
79 <option value="collection">Collections of files</option>
|
|
80 </param>
|
|
81 <when value="single">
|
|
82 <conditional name="read_type_cond">
|
|
83 <param name="read_type" type="select" label="Choose the read type">
|
|
84 <option value="paired" selected="true">Paired</option>
|
|
85 <option value="single">Single</option>
|
|
86 </param>
|
|
87 <when value="paired">
|
|
88 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
|
|
89 <param name="read2" type="data" format="fastqsanger.gz,fastqsanger" label="Read2 fastq file"/>
|
|
90 </when>
|
|
91 <when value="single">
|
|
92 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
|
|
93 </when>
|
|
94 </conditional>
|
|
95 <param name="samtools_idxstats" type="data" format="tabular" label="Samtools idxstats file">
|
|
96 <validator type="unspecified_build"/>
|
|
97 </param>
|
|
98 <param name="vsnp_azc" type="data" format="tabular" label="vSNP zero coverage metrics file">
|
|
99 <validator type="unspecified_build"/>
|
|
100 </param>
|
|
101 </when>
|
|
102 <when value="collection">
|
|
103 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="list" label="Collection of fastqsanger files"/>
|
|
104 <param name="samtools_idxstats_collection" type="data_collection" format="tabular" collection_type="list" label="Collection of samtools idxstats files"/>
|
|
105 <param name="azc_metrics_collection" type="data_collection" format="tabular" collection_type="list" label="Collection of vSNP zero-coverage metrics files"/>
|
|
106 </when>
|
|
107 </conditional>
|
|
108 </inputs>
|
|
109 <outputs>
|
1
|
110 <data name="output" format="xlsx"/>
|
0
|
111 </outputs>
|
|
112 <tests>
|
|
113 <test>
|
|
114 <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
|
|
115 <param name="read2" value="13-1941-6_S4_L001_R2_600000.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
|
|
116 <param name="samtools_idxstats" value="samtools_idxstats.tabular" ftype="tabular" dbkey="89"/>
|
|
117 <param name="vsnp_azc" value="add_zc_metrics.tabular" ftype="tabular" dbkey="89"/>
|
1
|
118 <output name="output" file="vsnp_statistics.xlsx" ftype="xlsx" compare="sim_size"/>
|
0
|
119 </test>
|
|
120 </tests>
|
|
121 <help>
|
|
122 **What it does**
|
|
123
|
2
|
124 Accepts a single fastqsanger sample, a set of paired read samples, or a collections of samples along with associated
|
|
125 SAMtools idxstats and vSNP zero coverage metrics files and extracts information from them to produce an Excel
|
|
126 spreadsheet containing statistics for each sample. Statistics include reference, file size, mean read length, mean
|
|
127 read quality, reads passing Q30, total reads, all mapped reads, unmapped reads, unmapped reads percentage of total,
|
|
128 reference with coverage, average depth of coverage and good SNP count.
|
0
|
129
|
|
130 **Required options**
|
|
131
|
|
132 * **Choose the type for files to be analyzed** - select "Single files" or "Collections of files", then select the appropriate history items (single or paired fastqsanger reads or collections of fastqsanger reads and associated idxstats and vSNP zero coverage metrics files) based on the selected option..
|
|
133 </help>
|
|
134 <citations>
|
|
135 <citation type="bibtex">
|
|
136 @misc{None,
|
|
137 journal = {None},
|
|
138 author = {1. Stuber T},
|
|
139 title = {Manuscript in preparation},
|
|
140 year = {None},
|
|
141 url = {https://github.com/USDA-VS/vSNP},}
|
|
142 </citation>
|
|
143 </citations>
|
|
144 </tool>
|
|
145
|