comparison autospill.xml @ 0:315be37a7ac9 draft

"planemo upload for repository https://github.com/AstraZeneca-Omics/immport-galaxy-tools/tree/master/flowtools/autospill commit 386fcc6286d3e2d2769ac9856a653b04d5c6b0ad"
author azomics
date Tue, 25 May 2021 00:07:20 +0000
parents
children 7f5bf24d5aeb
comparison
equal deleted inserted replaced
-1:000000000000 0:315be37a7ac9
1 <tool id="autospill" name="Autospill" version="0.1.0+galaxy0" profile="19.01" python_template_version="3.5">
2 <description>
3 calculates spillover coefficients with robust linear models and then refines spillover coefficients iteratively
4 </description>
5 <requirements>
6 <requirement type="package" version="0.1.0">r-autospill</requirement>
7 </requirements>
8 <command detect_errors="exit_code"><![CDATA[
9 mkdir input_dir;
10 #for $fcs in $fcs_list:
11 ln -s '$fcs' input_dir/'$fcs.element_identifier';
12 #end for
13
14 ## TODO Check that tabular file has the same number of lines that the collection of fcs files.
15 ## Check that files given in the tabular file exist in the inputs directory.
16
17 Rscript '$auto_spill_calculate_compensate' input_dir '$fcs_metadata' \${GALAXY_SLOTS:-1};
18
19 #if $get_figure_scatter:
20 mkdir all_scatter;
21 for suffix in \$(ls | grep figure_scatter | sed 's/figure_scatter_//'); do
22 for plot in \$(ls figure_scatter_\$suffix); do
23 mv figure_scatter_\$suffix/\$plot all_scatter/\${suffix}__\${plot};
24 done;
25 done;
26 #end if
27 ]]></command>
28 <configfiles>
29 <configfile name="auto_spill_calculate_compensate"><![CDATA[
30 ## calculate_compensation_paper.r
31 ##
32 ## Copyright (c) 2020 VIB (Belgium) and Babraham Institute (United Kingdom)
33 ##
34 ## Software written by Carlos P. Roca, as research funded by the European Union.
35 ##
36 ## This software may be modified and distributed under the terms of the MIT
37 ## license. See the LICENSE file for details.
38 ## Runs a calculation of compensation with autospill, creating all figures and
39 ## tables used in autospill paper.
40 ##
41 ## Requires being called as a batch script with the following two arguments:
42 ## control.dir directory with the set of single-color controls
43 ## control.def.file csv file defining the names and channels of the
44 ## single-color controls
45
46
47 library( autospill )
48
49
50 ## get directory and csv file with definition of control dataset
51
52 args <- commandArgs( TRUE )
53
54 if ( length( args ) != 3 ) {
55 cat( "ERROR: no arguments with directory, csv file with definition of control dataset and parameter set",
56 file = stderr() )
57 stop()
58 }
59
60
61 control.dir <- args[[ 1 ]]
62 control.def.file <- args[[ 2 ]]
63
64 asp <- get.autospill.param()
65
66 #if $get_figure_scatter or $get_gates:
67 ## Reduced resolution of plots
68 asp\$figure.width <- 3.25
69 asp\$figure.height <- 2.60
70 asp\$figure.margin <- 1.0
71
72 asp\$figure.panel.line.size <- 0.5
73
74 asp\$figure.axis.text.size <- 7.0
75 asp\$figure.axis.title.size <- 7.0
76
77 asp\$figure.convergence.point.size <- 1.0
78 asp\$figure.convergence.line.size <- 0.4
79
80 asp\$figure.density.line.size <- 0.4
81
82 asp\$figure.gate.scale.expand <- 0.01
83 asp\$figure.gate.point.size <- 0.4
84 asp\$figure.gate.line.size <- 0.3
85 asp\$figure.gate.bar.width <- 0.3
86 asp\$figure.gate.bar.height <- 10.0
87 asp\$figure.gate.bar.margin <- 0.0
88
89 asp\$figure.matrix.point.size <- 1.2
90 asp\$figure.matrix.line.size <- 0.4
91
92 asp\$figure.scatter.alpha.gate.in <- 0.8
93 asp\$figure.scatter.alpha.gate.out <- 0.2
94 asp\$figure.scatter.point.size <- 0.6
95 asp\$figure.scatter.line.size <- 0.5
96 asp\$figure.scatter.error.label.size <- 3.0
97 asp\$figure.scatter.error.label.pos.x <- 0.85
98 asp\$figure.scatter.error.label.pos.y <- 0.05
99 asp\$figure.scatter.axis.text.size <- 9.0
100 asp\$figure.scatter.axis.title.size <- 9.0
101 ## Reduced resolution
102 #end if
103
104 #if $get_figure_scatter:
105 ## triggers generation of compensation plots between pair of channels
106 asp\$figure.scatter.dir.base <- "figure_scatter"
107 #end if
108
109 #if $get_gates:
110 ## triggers generation of gate figures
111 asp\$figure.gate.dir <- "figure_gate"
112 #end if
113
114 ## triggers generation of a figure with a summary of convergence
115 asp\$figure.convergence.dir <- "figure_convergence"
116 asp\$table.spillover.dir <- "table_spillover"
117
118 ## Set workers through GALAXY_SLOTS
119 asp\$worker.process.n<-args[[3]]
120
121 flow.control <- read.flow.control( control.dir, control.def.file, asp )
122
123 ## gate events before calculating spillover
124
125 flow.gate <- gate.flow.data( flow.control, asp )
126
127
128 ## get initial spillover matrices from untransformed data
129
130 marker.spillover.unco.untr <- get.marker.spillover( TRUE, flow.gate,
131 flow.control, asp )
132 #if $get_figure_scatter:
133 marker.spillover.unco.tran <- get.marker.spillover( FALSE, flow.gate,
134 flow.control, asp )
135 #else:
136 marker.spillover.unco.tran <- NULL
137 #end if
138
139
140 ## refine spillover matrix iteratively
141
142 refine.spillover.result <- refine.spillover( marker.spillover.unco.untr,
143 marker.spillover.unco.tran, flow.gate, flow.control, asp )
144
145 ## Write outputs
146 write.table(refine.spillover.result\$spillover, file = "spillover.txt", sep="\t", col.names = NA, quote=FALSE)
147 write.table(refine.spillover.result\$compensation, file = "compensation.txt", sep="\t", col.names = NA, quote=FALSE)
148 write.table(refine.spillover.result\$convergence, file = "convergence.txt", sep="\t", row.names=FALSE, quote=FALSE)
149
150 #if $get_error:
151 write.table(refine.spillover.result\$error\$inte, file = "error_inte.txt", sep="\t", col.names=NA, quote=FALSE)
152 write.table(refine.spillover.result\$error\$coef, file = "error_coef.txt", sep="\t", col.names=NA, quote=FALSE)
153 write.table(refine.spillover.result\$error\$slop, file = "error_slop.txt", sep="\t", col.names=NA, quote=FALSE)
154 write.table(refine.spillover.result\$error\$skew, file = "error_skew.txt", sep="\t", col.names=NA, quote=FALSE)
155 #end if
156
157 ]]></configfile>
158 </configfiles>
159
160 <inputs>
161 <param type="data" name="fcs_list" format="fcs" multiple="true" label="Collection of control FCS files" />
162 <param type="data" name="fcs_metadata" format="csv" label="Auxiliary control file" help="Contains metadata for control list. It has to match original names of FCS files uploaded, and those files need to be present in the Collection of control FCS files given." />
163 <!-- <param name="param_set" type="select" label="Parameter set" help="Predefined auto-spill parameters set, choose from 'Minimal', 'Final step', 'Paper', or 'Website'">
164 <option value="minimal" selected="true">Minimal - no plot generation</option>
165 <option value="final.step">Final step - plot generation</option>
166 <option value="paper">Paper</option>
167 <option value="website">Website</option>
168 </param> -->
169 <param type="boolean" name="get_figure_scatter" label="Get scatter" help="If turned On, the tool will produce scatter plots between setups" checked="true"/>
170 <param type="boolean" name="get_error" label="Get error matrices/tables" help="If turned On, the tool will produce error matrices for intercepts, coefficients, slope and skewness" checked="false"/>
171 <param type="boolean" name="get_gates" label="Get gating information" help="If turned On, gating parameters information will be produced" checked="true"/>
172 </inputs>
173 <outputs>
174 <data name="spillover_matrix" format="tabular" from_work_dir="spillover.txt" label="${tool.name} spillover matrix on ${on_string}"/>
175 <data name="compensation_matrix" format="tabular" from_work_dir="compensation.txt" label="${tool.name} compensation matrix on ${on_string}"/>
176 <data name="convergence_matrix" format="tabular" from_work_dir="convergence.txt" label="${tool.name} convergence table on ${on_string}"/>
177 <data name="convergence_plot" format="png" from_work_dir="figure_convergence/autospill_convergence.png" label="${tool.name} convergence plot on ${on_string}"/>
178 <data name="error_inte_matrix" format="tabular" from_work_dir="error_inte.txt" label="${tool.name} error intercepts matrix on ${on_string}">
179 <filter>get_error</filter>
180 </data>
181 <data name="error_coef_matrix" format="tabular" from_work_dir="error_coef.txt" label="${tool.name} error coefficients matrix on ${on_string}">
182 <filter>get_error</filter>
183 </data>
184 <data name="error_slop_matrix" format="tabular" from_work_dir="error_slop.txt" label="${tool.name} error slope matrix on ${on_string}">
185 <filter>get_error</filter>
186 </data>
187 <data name="error_skew_matrix" format="tabular" from_work_dir="error_skew.txt" label="${tool.name} error skewness matrix on ${on_string}">
188 <filter>get_error</filter>
189 </data>
190 <!--
191 <collection name="spillover_plots" label="${tool.name} spillover plots on ${on_string}">
192 <discover_datasets pattern="__designation_and_ext__" format="png" directory="figure_spillover" visible="true" />
193 </collection> -->
194 <collection name="gate_plots" label="${tool.name} gate plots on ${on_string}" type="list">
195 <discover_datasets pattern="__designation_and_ext__" format="png" directory="figure_gate" />
196 <filter>get_gates</filter>
197 </collection>
198 <collection name="scatter_plots" label="${tool.name} scatter plots on ${on_string}" type="list">
199 <discover_datasets pattern="__designation_and_ext__" format="png" directory="all_scatter" />
200 <filter>get_figure_scatter</filter>
201 </collection>
202
203 <!--
204 <collection name="compensation_plots" label="${tool.name} compensation plots on ${on_string}">
205 <discover_datasets pattern="__designation_and_ext__" format="png" directory="figure_compensation" visible="true" />
206 </collection> -->
207 </outputs>
208 <help><![CDATA[
209 Autospill: a principled framework that simplifies the analysis of multichromatic flow cytometry data
210 ----------------------------------------------------------------------------------------------------
211
212 Calculates spillover coefficients with robust linear models and then refines spillover coefficients iteratively.
213
214 **Inputs**
215
216 - Collection of control FCS files
217 - Auxiliary control file: Contains metadata for control list. It has to match original names of FCS files uploaded, and those files need to be present in the Collection of control FCS files given. ​
218
219
220 **Output**
221
222 - Spillover matrix
223 - Compensation matrix
224 - convergence matrix
225 - convergence plot
226 - Gate plots
227 - Scatter plots between channels
228
229 ]]></help>
230 <citations>
231 <citation type="bibtex">
232 @misc{githubautospill,
233 author = {Roca, Carlos},
234 year = {2020},
235 title = {autospill algorithm for calculating spillover coefficients, used to compensate or unmix flow cytometry data.},
236 publisher = {GitHub},
237 journal = {GitHub repository},
238 url = {https://github.com/carlosproca/autospill},
239 }</citation>
240 <citation type="doi">10.1038/s41467-021-23126-8</citation>
241 </citations>
242 </tool>