comparison vsnp_statistics.xml @ 0:50f539302bf4 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 92f46d4bb55b582f05ac3c4b094307f114cbf98f"
author iuc
date Fri, 27 Aug 2021 11:46:52 +0000
parents
children b960f47c57a1
comparison
equal deleted inserted replaced
-1:000000000000 0:50f539302bf4
1 <tool id="vsnp_statistics" name="vSNP: statistics" version="@WRAPPER_VERSION@.1+galaxy0" profile="@PROFILE@">
2 <description></description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <requirements>
7 <requirement type="package" version="1.79">biopython</requirement>
8 <requirement type="package" version="1.21.1">numpy</requirement>
9 <requirement type="package" version="3.0.7">openpyxl</requirement>
10 <requirement type="package" version="1.3.0">pandas</requirement>
11 <requirement type="package" version="2.0.1">xlrd</requirement>
12 </requirements>
13 <command detect_errors="exit_code"><![CDATA[
14 #import re
15 #set input_idxstats_dir = 'input_idxstats'
16 #set input_metrics_dir = 'input_metrics'
17 #set input_reads_dir = 'input_reads'
18 mkdir -p $input_idxstats_dir &&
19 mkdir -p $input_metrics_dir &&
20 mkdir -p $input_reads_dir &&
21
22 #if $input_type_cond.input_type == 'single_files':
23 #set read1 = $input_type_cond.read_type_cond.read1
24 #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
25 ln -s '${read1}' '${read1_identifier}' &&
26 #if $input_type_cond.read_type_cond.read_type == 'pair':
27 #set read2 = $input_type_cond.read_type_cond.read2
28 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
29 ln -s '${read2}' '${read2_identifier}' &&
30 #else:
31 #set read2 = None
32 #end if
33 #else:
34 #if $input_type_cond.collection_type_cond.collection_type == 'single':
35 #for $i in $input_type_cond.collection_type_cond.reads_collection:
36 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
37 ln -s '${i.file_name}' '$input_reads_dir/${identifier}' &&
38 #end for
39 #else:
40 #set read1 = $input_type_cond.collection_type_cond.reads_collection['forward']
41 #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.name))
42 ln -s '${read1}' '$input_reads_dir/${read1_identifier}' &&
43 #set read2 = $input_type_cond.collection_type_cond.reads_collection['reverse']
44 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.name))
45 ln -s '${read2}' '$input_reads_dir/${read2_identifier}' &&
46 #end if
47 #for $i in $input_type_cond.samtools_idxstats:
48 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
49 ln -s '${i.file_name}' '$input_idxstats_dir/${identifier}' &&
50 #end for
51 #for $i in $input_type_cond.vsnp_azc:
52 #set identifier = re.sub('[^\s\w\-]', '_', str($i.element_identifier))
53 ln -s '${i.file_name}' '$input_metrics_dir/${identifier}' &&
54 #end for
55 #end if
56
57 python '$__tool_directory__/vsnp_statistics.py'
58 #if $input_type_cond.input_type == 'single_files':
59 --dbkey '$input_type_cond.samtools_idxstats.metadata.dbkey'
60 #if $input_type_cond.read_type_cond.read1.is_of_type('fastqsanger.gz'):
61 --gzipped
62 #end if
63 --read1 '${read1_identifier}'
64 #if $input_type_cond.read_type_cond.read_type == 'pair':
65 --read2 '${read2_identifier}'
66 #end if
67 --samtools_idxstats '$input_type_cond.samtools_idxstats'
68 --vsnp_azc '$input_type_cond.vsnp_azc'
69 #else:
70 --dbkey '$input_type_cond.samtools_idxstats[0].metadata.dbkey'
71 #if $input_type_cond.collection_type_cond.reads_collection[0].is_of_type('fastqsanger.gz'):
72 --gzipped
73 #end if
74 #if $input_type_cond.collection_type_cond.collection_type == 'paired':
75 --list_paired
76 #end if
77 --input_idxstats_dir '$input_idxstats_dir'
78 --input_metrics_dir '$input_metrics_dir'
79 --input_reads_dir '$input_reads_dir'
80 #end if
81 --output '$output'
82 ]]></command>
83 <inputs>
84 <conditional name="input_type_cond">
85 <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
86 <option value="single_files" selected="true">Single files</option>
87 <option value="collections">Collections of files</option>
88 </param>
89 <when value="single_files">
90 <conditional name="read_type_cond">
91 <param name="read_type" type="select" label="Choose the read type">
92 <option value="single" selected="true">Single reads</option>
93 <option value="pair">Paired reads</option>
94 </param>
95 <when value="single">
96 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
97 </when>
98 <when value="pair">
99 <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
100 <param name="read2" type="data" format="fastqsanger.gz,fastqsanger" label="Read2 fastq file"/>
101 </when>
102 </conditional>
103 <param name="samtools_idxstats" type="data" format="tabular" label="Samtools idxstats file"/>
104 <param name="vsnp_azc" type="data" format="tabular" label="vSNP: add zero coverage metrics file"/>
105 </when>
106 <when value="collections">
107 <conditional name="collection_type_cond">
108 <param name="collection_type" type="select" label="Collections of single reads or paired reads?">
109 <option value="single" selected="true">Single reads</option>
110 <option value="paired">Paired reads in separate datasets</option>
111 </param>
112 <when value="single">
113 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="list" label="Collection of fastqsanger files"/>
114 </when>
115 <when value="paired">
116 <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="paired" label="Collection of fastqsanger paired read files"/>
117 </when>
118 </conditional>
119 <param name="samtools_idxstats" type="data_collection" format="tabular" collection_type="list" label="Collection of samtools idxstats files"/>
120 <param name="vsnp_azc" type="data_collection" format="tabular" collection_type="list" label="Collection of vSNP: add zero coverage metrics files"/>
121 </when>
122 </conditional>
123 </inputs>
124 <outputs>
125 <data name="output" format="tabular"/>
126 </outputs>
127 <tests>
128 <!-- A single fastq file -->
129 <test expect_num_outputs="1">
130 <param name="input_type" value="single_files"/>
131 <param name="read_type" value="single"/>
132 <param name="read1" value="Mcap_Deer_DE_SRR650221.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
133 <param name="samtools_idxstats" value="samtools_idxstats1.tabular" ftype="tabular" dbkey="89"/>
134 <param name="vsnp_azc" value="add_zc_metrics1.tabular" ftype="tabular" dbkey="89"/>
135 <output name="output" file="vsnp_statistics1.tabular" ftype="tabular"/>
136 </test>
137 <!-- A set of paired fastq files -->
138 <test expect_num_outputs="1">
139 <param name="input_type" value="single_files"/>
140 <param name="read_type" value="pair"/>
141 <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
142 <param name="read2" value="13-1941-6_S4_L001_R2_600000.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
143 <param name="samtools_idxstats" value="samtools_idxstats2.tabular" ftype="tabular" dbkey="89"/>
144 <param name="vsnp_azc" value="add_zc_metrics2.tabular" ftype="tabular" dbkey="89"/>
145 <output name="output" file="vsnp_statistics2.tabular" ftype="tabular"/>
146 </test>
147 <!-- A collection of SE fastq files -->
148 <test expect_num_outputs="1">
149 <param name="input_type" value="collections"/>
150 <param name="read_type" value="single"/>
151 <param name="reads_collection">
152 <collection type="list">
153 <element name="Mcap_Deer_DE_SRR650221.fastq.gz" value="Mcap_Deer_DE_SRR650221.fastq.gz" dbkey="89"/>
154 <element name="13-1941-6_S4_L001_R1_600000.fastq.gz" value="13-1941-6_S4_L001_R1_600000.fastq.gz" dbkey="89"/>
155 </collection>
156 </param>
157 <param name="samtools_idxstats">
158 <collection type="list">
159 <element name="13-1941-6_S4_L001_R1_600000.fastq.gz" value="samtools_idxstats3.tabular" dbkey="89"/>
160 <element name="Mcap_Deer_DE_SRR650221.fastq.gz" value="samtools_idxstats4.tabular" dbkey="89"/>
161 </collection>
162 </param>
163 <param name="vsnp_azc">
164 <collection type="list">
165 <element name="13-1941-6_S4_L001_R1_600000.fastq.gz" value="add_zc_metrics3.tabular" dbkey="89"/>
166 <element name="Mcap_Deer_DE_SRR650221.fastq.gz" value="add_zc_metrics4.tabular" dbkey="89"/>
167 </collection>
168 </param>
169 <output name="output" file="vsnp_statistics3.tabular" ftype="tabular"/>
170 </test>
171 <!-- A collection of PE fastq files -->
172 <test expect_num_outputs="1">
173 <param name="input_type" value="collections"/>
174 <param name="collection_type" value="paired"/>
175 <param name="reads_collection">
176 <collection type="paired">
177 <element name="forward" value="13-1941-6_S4_L001_R1_600000.fastq.gz" ftype="fastqsanger.gz"/>
178 <element name="reverse" value="13-1941-6_S4_L001_R2_600000.fastq.gz" ftype="fastqsanger.gz"/>
179 </collection>
180 </param>
181 <param name="samtools_idxstats">
182 <collection type="list">
183 <element name="13-1941-6_S4_L001_R1_600000.fastq" value="samtools_idxstats5.tabular" dbkey="89"/>
184 </collection>
185 </param>
186 <param name="vsnp_azc">
187 <collection type="list">
188 <element name="13-1941-6_S4_L001_R1_600000.fastq" value="add_zc_metrics5.tabular" dbkey="89"/>
189 </collection>
190 </param>
191 <output name="output" file="vsnp_statistics4.tabular" ftype="tabular"/>
192 </test>
193 </tests>
194 <help>
195 **What it does**
196
197 Accepts associated fastq files, SAMtools idxstats files and **vSNP: add zero coverage** metrics files and extracts information from them
198 to produce an Excel spreadsheet containing statistics for each sample. The samples can be single or paired reads, and all associated inputs
199 can be either single files or collections of files. The output statistics include reference, file size, mean read length, mean read quality,
200 reads passing Q30, total reads, all mapped reads, unmapped reads, unmapped reads percentage of total, reference with coverage, average depth
201 of coverage and good SNP count.
202 </help>
203 <expand macro="citations"/>
204 </tool>
205