Mercurial > repos > matthias > dada2_plotqualityprofile
comparison dada2_plotQualityProfile.xml @ 8:7970dfbedde3 draft
planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/topic/dada2/tools/dada2 commit 977f22125c9ad5c3c5560de8946017305c5633c1
author | matthias |
---|---|
date | Mon, 27 May 2019 13:23:01 -0400 |
parents | ec0479593908 |
children | d908015e5889 |
comparison
equal
deleted
inserted
replaced
7:ec0479593908 | 8:7970dfbedde3 |
---|---|
31 Rscript --slave '$dada2_script' | 31 Rscript --slave '$dada2_script' |
32 ]]></command> | 32 ]]></command> |
33 <configfiles> | 33 <configfiles> |
34 <configfile name="dada2_script"><![CDATA[ | 34 <configfile name="dada2_script"><![CDATA[ |
35 #import re | 35 #import re |
36 files = c() | 36 fwd_files = c() |
37 rev_files = c() | |
37 #if "batch" in str($paired_cond.paired_select) | 38 #if "batch" in str($paired_cond.paired_select) |
38 #set elid = re.sub('[^\w\-\.]', '_', str($paired_cond.fl.element_identifier)) | 39 #set elid = re.sub('[^\w\-\.]', '_', str($paired_cond.fl.element_identifier)) |
39 #if "single" in str($paired_cond.paired_select) | 40 #if "single" in str($paired_cond.paired_select) |
40 files = c(files, '$elid') | 41 fwd_files = c(fwd_files, '$elid') |
41 #else | 42 #else |
42 files = c(files, paste('$elid', 'forward', sep = "_")) | 43 fwd_files = c(fwd_files, paste('$elid', 'forward', sep = "_")) |
43 files = c(files, paste('$elid', 'reverse', sep = "_")) | 44 rev_files = c(rev_files, paste('$elid', 'reverse', sep = "_")) |
44 #end if | 45 #end if |
45 #else | 46 #else |
46 #for $read in $paired_cond.fl: | 47 #for $read in $paired_cond.fl: |
47 #set elid = re.sub('[^\w\-\.]', '_', str($read.element_identifier)) | 48 #set elid = re.sub('[^\w\-\.]', '_', str($read.element_identifier)) |
48 #if "single" in str($paired_cond.paired_select) | 49 #if "single" in str($paired_cond.paired_select) |
49 files = c(files, '$elid') | 50 fwd_files = c(fwd_files, '$elid') |
50 #else | 51 #else |
51 files = c(files, paste('$elid', 'forward', sep = "_")) | 52 fwd_files = c(fwd_files, paste('$elid', 'forward', sep = "_")) |
52 files = c(files, paste('$elid', 'reverse', sep = "_")) | 53 rev_files = c(rev_files, paste('$elid', 'reverse', sep = "_")) |
53 #end if | 54 #end if |
54 #end for | 55 #end for |
56 #end if | |
57 | |
58 #if not "batch" in str($paired_cond.paired_select) | |
59 agg = $paired_cond.aggregate | |
60 #else | |
61 agg = FALSE | |
55 #end if | 62 #end if |
56 | 63 |
57 library(ggplot2, quietly=T) | 64 library(ggplot2, quietly=T) |
58 library(dada2, quietly=T) | 65 library(dada2, quietly=T) |
59 | 66 |
60 qp <- plotQualityProfile(files, | 67 qp <- plotQualityProfile(fwd_files, |
61 #if str($n) != "" | 68 #if str($n) != "" |
62 n=$n, | 69 n=$n, |
63 #end if | 70 #end if |
64 aggregate = $aggregate) | 71 aggregate = agg) |
72 ggsave('output.pdf', qp, width = 20,height = 15,units = c("cm")) | |
65 | 73 |
66 ggsave('output.pdf', qp, width = 20,height = 15,units = c("cm")) | 74 #if "paired" in str($paired_cond.paired_select) |
75 qp <- plotQualityProfile(rev_files, | |
76 #if str($n) != "" | |
77 n=$n, | |
78 #end if | |
79 aggregate = agg) | |
80 ggsave('output_rev.pdf', qp, width = 20,height = 15,units = c("cm")) | |
81 #end if | |
67 ]]></configfile> | 82 ]]></configfile> |
68 </configfiles> | 83 </configfiles> |
69 <inputs> | 84 <inputs> |
70 <conditional name="paired_cond"> | 85 <conditional name="paired_cond"> |
71 <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"> | 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"> |
74 <option value="paired_batch">paired - batch</option> | 89 <option value="paired_batch">paired - batch</option> |
75 <option value="single_batch">single - batch</option> | 90 <option value="single_batch">single - batch</option> |
76 </param> | 91 </param> |
77 <when value="paired"> | 92 <when value="paired"> |
78 <param argument="fl" type="data_collection" collection_type="list:paired" format="fastq,fastq.gz" label="Short read data"/> | 93 <param argument="fl" type="data_collection" collection_type="list:paired" format="fastq,fastq.gz" label="Short read data"/> |
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"/> | |
79 </when> | 95 </when> |
80 <when value="single"> | 96 <when value="single"> |
81 <param argument="fl" type="data" multiple="true" format="fastq,fastq.gz" label="Short read data"/> | 97 <param argument="fl" type="data" multiple="true" format="fastq,fastq.gz" label="Short read data"/> |
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"/> | |
82 </when> | 99 </when> |
83 <when value="paired_batch"> | 100 <when value="paired_batch"> |
84 <param argument="fl" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Short read data"/> | 101 <param argument="fl" type="data_collection" collection_type="paired" format="fastq,fastq.gz" label="Short read data"/> |
85 </when> | 102 </when> |
86 <when value="single_batch"> | 103 <when value="single_batch"> |
87 <param argument="fl" type="data" format="fastq,fastq.gz" label="Short read data"/> | 104 <param argument="fl" type="data" format="fastq,fastq.gz" label="Short read data"/> |
88 </when> | 105 </when> |
89 </conditional> | 106 </conditional> |
90 <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"/> | |
91 <param argument="n" type="integer" value="500000" label="sample number" help="number of records to sample from the fastq file"/> | 107 <param argument="n" type="integer" value="500000" label="sample number" help="number of records to sample from the fastq file"/> |
92 </inputs> | 108 </inputs> |
93 <outputs> | 109 <outputs> |
94 <data name="output" format="pdf" from_work_dir="output.pdf"/> | 110 <data name="output" format="pdf" from_work_dir="output.pdf"> |
111 <filter>"single" in paired_cond['paired_select']</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> | |
116 <data name="output_rev" format="pdf" from_work_dir="output_rev.pdf" label="${tool.name} on ${on_string}: reverse reads"> | |
117 <filter>"paired" in paired_cond['paired_select']</filter> | |
118 </data> | |
95 </outputs> | 119 </outputs> |
96 <tests> | 120 <tests> |
97 <!-- paired non-batch, aggregate --> | 121 <!-- paired non-batch, aggregate --> |
98 <test> | 122 <test> |
99 <param name="aggregate" value="TRUE"/> | |
100 <param name="paired_cond|paired_select" value="paired"/> | 123 <param name="paired_cond|paired_select" value="paired"/> |
124 <param name="paired_cond|aggregate" value="TRUE"/> | |
101 <param name="paired_cond|fl"> | 125 <param name="paired_cond|fl"> |
102 <collection type="list:paired"> | 126 <collection type="list:paired"> |
103 <element name="F3D0_S188_L001"> | 127 <element name="F3D0_S188_L001"> |
104 <collection type="paired"> | 128 <collection type="paired"> |
105 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/> | 129 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/> |
106 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> | 130 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> |
107 </collection> | 131 </collection> |
108 </element> | 132 </element> |
109 </collection> | 133 </collection> |
110 </param> | 134 </param> |
111 <output name="output" value="qualityProfileMultiple.pdf" ftype="pdf"/> | 135 <output name="output_fwd" value="qualityProfileMultiple.pdf" ftype="pdf"/> |
136 <output name="output_rev" value="qualityProfileMultiple_rev.pdf" ftype="pdf"/> | |
112 </test> | 137 </test> |
113 <!-- paired, batch, no aggregate--> | 138 <!-- paired, batch, no aggregate--> |
114 <test> | 139 <test> |
115 <param name="aggregate" value="FALSE"/> | |
116 <param name="paired_cond|paired_select" value="paired_batch"/> | 140 <param name="paired_cond|paired_select" value="paired_batch"/> |
117 <param name="paired_cond|fl"> | 141 <param name="paired_cond|fl"> |
118 <collection type="paired"> | 142 <collection type="paired"> |
119 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/> | 143 <element name="forward" value="F3D0_S188_L001_R1_001.fastq.gz" ftype="fastqsanger.gz"/> |
120 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> | 144 <element name="reverse" value="F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> |
121 </collection> | 145 </collection> |
122 </param> | 146 </param> |
123 <output name="output" value="qualityProfile.pdf" ftype="pdf"/> | 147 <output name="output_fwd" value="qualityProfile.pdf" ftype="pdf"/> |
148 <output name="output_rev" value="qualityProfile_rev.pdf" ftype="pdf"/> | |
124 </test> | 149 </test> |
125 <!-- single, non-batch, aggregate --> | 150 <!-- single, non-batch, aggregate --> |
126 <test> | 151 <test> |
127 <param name="aggregate" value="TRUE"/> | |
128 <param name="paired_cond|paired_select" value="single"/> | 152 <param name="paired_cond|paired_select" value="single"/> |
153 <param name="paired_cond|aggregate" value="TRUE"/> | |
129 <param name="paired_cond|fl" value="F3D0_S188_L001_R1_001.fastq.gz,F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> | 154 <param name="paired_cond|fl" value="F3D0_S188_L001_R1_001.fastq.gz,F3D0_S188_L001_R2_001.fastq.gz" ftype="fastqsanger.gz"/> |
130 <param name="n" value="10000"/> | 155 <param name="n" value="10000"/> |
131 <output name="output" value="qualityProfileSmallSample.pdf" ftype="pdf"/> | 156 <output name="output" value="qualityProfileSmallSample.pdf" ftype="pdf"/> |
132 </test> | 157 </test> |
133 <!-- single, batch, no aggregate --> | 158 <!-- single, batch, no aggregate --> |