comparison dada2_plotQualityProfile.xml @ 9:d908015e5889 draft

planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/topic/dada2/tools/dada2 commit a54770771e567c7ad8a9dd75cc4689c3935ef11c
author matthias
date Tue, 28 May 2019 12:15:38 -0400
parents 7970dfbedde3
children 36224cf72a7b
comparison
equal deleted inserted replaced
8:7970dfbedde3 9:d908015e5889
6 <expand macro="requirements"/> 6 <expand macro="requirements"/>
7 <expand macro="version_command"/> 7 <expand macro="version_command"/>
8 <command detect_errors="exit_code"><![CDATA[ 8 <command detect_errors="exit_code"><![CDATA[
9 ##name files by linking 9 ##name files by linking
10 #import re 10 #import re
11 #if "batch" in str($paired_cond.paired_select) 11 mkdir forward &&
12 #set elid = re.sub('[^\w\-\.]', '_', str($paired_cond.fl.element_identifier)) 12 #if $batch_cond.paired_cond.paired_select != "single"
13 #if "single" in str($paired_cond.paired_select) 13 mkdir reverse &&
14 ln -s '$paired_cond.fl' '$elid' && 14 #end if
15 #else 15
16 ln -s '$paired_cond.fl.forward' '$elid'_forward && 16 #if $batch_cond.batch_select == "batch":
17 ln -s '$paired_cond.fl.reverse' '$elid'_reverse && 17 #set elid = re.sub('[^\w\-\.]', '_', str($batch_cond.paired_cond.reads.element_identifier))
18 #end if 18 #if $batch_cond.paired_cond.paired_select != "paired"
19 ln -s '$batch_cond.paired_cond.reads' forward/'$elid' &&
20 #else
21 ln -s '$batch_cond.paired_cond.reads.forward' forward/'$elid' &&
22 ln -s '$batch_cond.paired_cond.reads.reverse' reverse/'$elid' &&
23 #end if
24 #if $batch_cond.paired_cond.paired_select == "separate"
25 ln -s '$batch_cond.paired_cond.sdaer' reverse/'$elid' &&
26 #end if
19 #else 27 #else
20 #for $read in $paired_cond.fl: 28 #for $read in $batch_cond.paired_cond.reads:
21 #set elid = re.sub('[^\w\-\.]', '_', str($read.element_identifier)) 29 #set elid = re.sub('[^\w\-\.]', '_', str($read.element_identifier))
22 #if "single" in str($paired_cond.paired_select) 30 #if $batch_cond.paired_cond.paired_select != "paired"
23 ln -s '$read' '$elid' && 31 ln -s '$read' forward/'$elid' &&
24 #else 32 #else
25 ln -s '$read.forward' '$elid'_forward && 33 ln -s '$read.forward' forward/'$elid' &&
26 ln -s '$read.reverse' '$elid'_reverse && 34 ln -s '$read.reverse' reverse/'$elid' &&
35 #end if
36 #end for
37 #if $batch_cond.paired_cond.paired_select == "separate"
38 #for $read in $batch_cond.paired_cond.sdaer:
39 #set elid = re.sub('[^\w\-\.]', '_', str($read.element_identifier))
40 ln -s '$read' reverse/'$elid' &&
41 #end for
27 #end if 42 #end if
28 #end for
29 #end if 43 #end if
30 44
31 Rscript --slave '$dada2_script' 45 Rscript --slave '$dada2_script'
32 ]]></command> 46 ]]></command>
33 <configfiles> 47 <configfiles>
34 <configfile name="dada2_script"><![CDATA[ 48 <configfile name="dada2_script"><![CDATA[
35 #import re 49 #import re
36 fwd_files = c() 50 library(ggplot2, quietly=T)
37 rev_files = c() 51 library(dada2, quietly=T)
38 #if "batch" in str($paired_cond.paired_select)
39 #set elid = re.sub('[^\w\-\.]', '_', str($paired_cond.fl.element_identifier))
40 #if "single" in str($paired_cond.paired_select)
41 fwd_files = c(fwd_files, '$elid')
42 #else
43 fwd_files = c(fwd_files, paste('$elid', 'forward', sep = "_"))
44 rev_files = c(rev_files, paste('$elid', 'reverse', sep = "_"))
45 #end if
46 #else
47 #for $read in $paired_cond.fl:
48 #set elid = re.sub('[^\w\-\.]', '_', str($read.element_identifier))
49 #if "single" in str($paired_cond.paired_select)
50 fwd_files = c(fwd_files, '$elid')
51 #else
52 fwd_files = c(fwd_files, paste('$elid', 'forward', sep = "_"))
53 rev_files = c(rev_files, paste('$elid', 'reverse', sep = "_"))
54 #end if
55 #end for
56 #end if
57 52
58 #if not "batch" in str($paired_cond.paired_select) 53 #if $batch_cond.batch_select != "batch"
59 agg = $paired_cond.aggregate 54 agg = $batch_cond.aggregate
60 #else 55 #else
61 agg = FALSE 56 agg = FALSE
62 #end if 57 #end if
63 58
64 library(ggplot2, quietly=T) 59 fwd_files = list.files("forward", full.names=T)
65 library(dada2, quietly=T) 60 qp <- plotQualityProfile(fwd_files, n=$n, aggregate = agg)
66
67 qp <- plotQualityProfile(fwd_files,
68 #if str($n) != ""
69 n=$n,
70 #end if
71 aggregate = agg)
72 ggsave('output.pdf', qp, width = 20,height = 15,units = c("cm")) 61 ggsave('output.pdf', qp, width = 20,height = 15,units = c("cm"))
73 62
74 #if "paired" in str($paired_cond.paired_select) 63 #if $batch_cond.paired_cond.paired_select != "single"
75 qp <- plotQualityProfile(rev_files, 64 rev_files = list.files("reverse", full.names=T)
76 #if str($n) != "" 65 qp <- plotQualityProfile(rev_files, n=$n, aggregate = agg)
77 n=$n,
78 #end if
79 aggregate = agg)
80 ggsave('output_rev.pdf', qp, width = 20,height = 15,units = c("cm")) 66 ggsave('output_rev.pdf', qp, width = 20,height = 15,units = c("cm"))
81 #end if 67 #end if
82 ]]></configfile> 68 ]]></configfile>
83 </configfiles> 69 </configfiles>
84 <inputs> 70 <inputs>
85 <conditional name="paired_cond"> 71 <conditional name="batch_cond">
86 <param name="paired_select" type="select" label="Input data organisation and processing mode" help="Select if data is organized in a paired collection or not (note that the pairing of the data sets is not used by the tool); batch will create a separate pdf for each input data set or data set pair; non-batch will create one pdf containing a plot for each data set"> 72 <param name="batch_select" type="select" label="Processing mode" help="Joint processing processes all reads at once in a single job creating a single output (two in the case of paired data). Batch processes the samples in separate jobs and creates separate output for each">
87 <option value="paired">paired - non batch</option> 73 <option value="joint">Joint</option>
88 <option value="single">single - non batch</option> 74 <option value="batch">Batch</option>
89 <option value="paired_batch">paired - batch</option>
90 <option value="single_batch">single - batch</option>
91 </param> 75 </param>
92 <when value="paired"> 76 <when value="joint">
93 <param argument="fl" type="data_collection" collection_type="list:paired" format="fastq,fastq.gz" label="Short read data"/> 77 <expand macro="fastq_input" multiple="True" collection_type="list:paired" argument_fwd="fl" argument_rev="fl"/>
94 <param argument="aggregate" type="boolean" label="Aggregate data" checked="True" truevalue="TRUE" falsevalue="FALSE" help="Create a single plot for all data sets (default) or a separate plot for each data set"/> 78 <param argument="aggregate" type="boolean" label="Aggregate data" checked="True" truevalue="TRUE" falsevalue="FALSE" help="Create a single plot for all data sets (default) or a separate plot for each data set"/>
95 </when> 79 </when>
96 <when value="single"> 80 <when value="batch">
97 <param argument="fl" type="data" multiple="true" format="fastq,fastq.gz" label="Short read data"/> 81 <expand macro="fastq_input" multiple="False" collection_type="paired" argument_fwd="fl" argument_rev="fl"/>
98 <param argument="aggregate" type="boolean" label="Aggregate data" checked="True" truevalue="TRUE" falsevalue="FALSE" help="Create a single plot for all data sets (default) or a separate plot for each data set"/>
99 </when>
100 <when value="paired_batch">
101 <param argument="fl" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Short read data"/>
102 </when>
103 <when value="single_batch">
104 <param argument="fl" type="data" format="fastq,fastq.gz" label="Short read data"/>
105 </when> 82 </when>
106 </conditional> 83 </conditional>
107 <param argument="n" type="integer" value="500000" label="sample number" help="number of records to sample from the fastq file"/> 84 <param argument="n" type="integer" value="500000" label="sample number" help="number of records to sample from the fastq file"/>
108 </inputs> 85 </inputs>
109 <outputs> 86 <outputs>
110 <data name="output" format="pdf" from_work_dir="output.pdf"> 87 <data name="output" format="pdf" from_work_dir="output.pdf">
111 <filter>"single" in paired_cond['paired_select']</filter> 88 <filter>batch_cond['paired_cond']['paired_select'] == "single"</filter>
112 </data>
113 <data name="output_fwd" format="pdf" from_work_dir="output.pdf" label="${tool.name} on ${on_string}: forward reads">
114 <filter>"paired" in paired_cond['paired_select']</filter>
115 </data> 89 </data>
116 <data name="output_rev" format="pdf" from_work_dir="output_rev.pdf" label="${tool.name} on ${on_string}: reverse reads"> 90 <data name="output_fwd" format="pdf" from_work_dir="output.pdf" label="${tool.name} on ${on_string}: forward reads">
117 <filter>"paired" in paired_cond['paired_select']</filter> 91 <filter>batch_cond['paired_cond']['paired_select'] != "single"</filter>
92 </data>
93 <data name="output_rev" format="pdf" from_work_dir="output_rev.pdf" label="${tool.name} on ${on_string}: reverse reads">
94 <filter>batch_cond['paired_cond']['paired_select'] != "single"</filter>
118 </data> 95 </data>
119 </outputs> 96 </outputs>
120 <tests> 97 <tests>
121 <!-- paired non-batch, aggregate --> 98 <!-- paired joint, no-aggregate -->
122 <test> 99 <test expect_num_outputs="2">
123 <param name="paired_cond|paired_select" value="paired"/> 100 <param name="batch_cond|batch_select" value="joint"/>
124 <param name="paired_cond|aggregate" value="TRUE"/> 101 <param name="batch_cond|paired_cond|paired_select" value="paired"/>
125 <param name="paired_cond|fl"> 102 <param name="batch_cond|paired_cond|reads">
126 <collection type="list:paired"> 103 <collection type="list:paired">
127 <element name="F3D0_S188_L001"> 104 <element name="F3D0_S188_L001">
128 <collection type="paired"> 105 <collection type="paired">
129 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/> 106 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/>
130 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> 107 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
131 </collection> 108 </collection>
132 </element> 109 </element>
133 </collection> 110 </collection>
134 </param> 111 </param>
112 <param name="batch_cond|aggregate" value="FALSE"/>
135 <output name="output_fwd" value="qualityProfileMultiple.pdf" ftype="pdf"/> 113 <output name="output_fwd" value="qualityProfileMultiple.pdf" ftype="pdf"/>
136 <output name="output_rev" value="qualityProfileMultiple_rev.pdf" ftype="pdf"/> 114 <output name="output_rev" value="qualityProfileMultiple_rev.pdf" ftype="pdf"/>
137 </test> 115 </test>
138 <!-- paired, batch, no aggregate--> 116 <!-- paired-separate joint, no-aggregate (sim_size because element ids differ) -->
139 <test> 117 <test expect_num_outputs="2">
140 <param name="paired_cond|paired_select" value="paired_batch"/> 118 <param name="batch_cond|batch_select" value="joint"/>
141 <param name="paired_cond|fl"> 119 <param name="batch_cond|paired_cond|paired_select" value="separate"/>
120 <param name="batch_cond|paired_cond|reads" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/>
121 <param name="batch_cond|paired_cond|sdaer" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
122 <param name="batch_cond|aggregate" value="FALSE"/>
123 <output name="output_fwd" value="qualityProfileMultiple.pdf" ftype="pdf" compare="sim_size"/>
124 <output name="output_rev" value="qualityProfileMultiple_rev.pdf" ftype="pdf" compare="sim_size"/>
125 </test>
126 <!-- single, non-batch, aggregate, small sample -->
127 <test expect_num_outputs="1">
128 <param name="batch_cond|batch_select" value="joint"/>
129 <param name="batch_cond|paired_cond|paired_select" value="single"/>
130 <param name="batch_cond|paired_cond|reads" value="F3D0_S188_L001_R1_001.fastq.gz,F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
131 <param name="n" value="10000"/>
132 <param name="batch_cond|aggregate" value="TRUE"/>
133 <output name="output" value="qualityProfileSmallSample.pdf" ftype="pdf"/>
134 </test>
135
136 <!-- paired, batch -->
137 <test expect_num_outputs="2">
138 <param name="batch_cond|batch_select" value="batch"/>
139 <param name="batch_cond|paired_cond|paired_select" value="paired"/>
140 <param name="batch_cond|paired_cond|reads">
142 <collection type="paired"> 141 <collection type="paired">
143 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/> 142 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/>
144 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> 143 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
145 </collection> 144 </collection>
146 </param> 145 </param>
147 <output name="output_fwd" value="qualityProfile.pdf" ftype="pdf"/> 146 <output name="output_fwd" value="qualityProfile.pdf" ftype="pdf"/>
148 <output name="output_rev" value="qualityProfile_rev.pdf" ftype="pdf"/> 147 <output name="output_rev" value="qualityProfile_rev.pdf" ftype="pdf"/>
149 </test> 148 </test>
150 <!-- single, non-batch, aggregate --> 149 <!-- paired-separate batch (sim_size because element ids differ)-->
151 <test> 150 <test expect_num_outputs="2">
152 <param name="paired_cond|paired_select" value="single"/> 151 <param name="batch_cond|batch_select" value="batch"/>
153 <param name="paired_cond|aggregate" value="TRUE"/> 152 <param name="batch_cond|paired_cond|paired_select" value="separate"/>
154 <param name="paired_cond|fl" value="F3D0_S188_L001_R1_001.fastq.gz,F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> 153 <param name="batch_cond|paired_cond|reads" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/>
155 <param name="n" value="10000"/> 154 <param name="batch_cond|paired_cond|sdaer" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/>
156 <output name="output" value="qualityProfileSmallSample.pdf" ftype="pdf"/> 155 <output name="output_fwd" value="qualityProfile.pdf" ftype="pdf" compare="sim_size"/>
156 <output name="output_rev" value="qualityProfile_rev.pdf" ftype="pdf" compare="sim_size"/>
157 </test> 157 </test>
158 <!-- single, batch, no aggregate --> 158 <!-- single, batch -->
159 <test> 159 <test expect_num_outputs="1">
160 <param name="aggregate" value="FALSE"/> 160 <param name="batch_cond|batch_select" value="batch"/>
161 <param name="paired_cond|paired_select" value="single_batch"/> 161 <param name="batch_cond|paired_cond|paired_select" value="single"/>
162 <param name="paired_cond|fl" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/> 162 <param name="batch_cond|paired_cond|reads" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/>
163 <param name="n" value="10000"/> 163 <param name="n" value="10000"/>
164 <output name="output" value="qualityProfileSmallSample.pdf" ftype="pdf" compare="sim_size"/> 164 <output name="output" value="qualityProfileSmallSample.pdf" ftype="pdf" compare="sim_size"/>
165 </test> </tests> 165 </test>
166 </tests>
166 <help><![CDATA[ 167 <help><![CDATA[
167 Summary 168 Summary
168 ....... 169 .......
169 170
170 This function plots a visual summary of the distribution of quality scores as a function of sequence position for the input fastq datasets. 171 This function plots a visual summary of the distribution of quality scores as a function of sequence position for the input fastq datasets.
172 Details 173 Details
173 ....... 174 .......
174 175
175 The distribution of quality scores at each position is shown as a grey-scale heat map, with dark colors corresponding to higher frequency. The plotted lines show positional summary statistics: green is the mean, orange is the median, and the dashed orange lines are the 25th and 75th quantiles. If the sequences vary in length, a red line will be plotted showing the percentage of reads that extend 176 The distribution of quality scores at each position is shown as a grey-scale heat map, with dark colors corresponding to higher frequency. The plotted lines show positional summary statistics: green is the mean, orange is the median, and the dashed orange lines are the 25th and 75th quantiles. If the sequences vary in length, a red line will be plotted showing the percentage of reads that extend
176 to at least that position. 177 to at least that position.
177
178 Note this tool ignores the pairing of the reads, but the data is just processed as list.
179 ]]></help> 178 ]]></help>
180 <expand macro="citations"/> 179 <expand macro="citations"/>
181 </tool> 180 </tool>