comparison integrate.xml @ 0:4341b8ff2a46 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat_v5 commit a9214c07b0cc929a51fd92a369bb89c675b6c88d
author iuc
date Wed, 11 Sep 2024 10:20:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4341b8ff2a46
1 <tool id="seurat_integrate" name="Seurat Integrate" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description> and manipulate layers </description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="requirements"/>
7 <expand macro="version_command"/>
8 <command detect_errors="exit_code"><![CDATA[
9 @CMD@
10 ]]></command>
11 <configfiles>
12 <configfile name="script_file"><![CDATA[
13 @CMD_imports@
14 @CMD_read_inputs@
15
16 #if $method.method == 'SplitLayers'
17 seurat_obj[['$method.assay']]<-split(
18 seurat_obj[['$method.assay']],
19 f = seurat_obj[['$method.factor', drop = TRUE]]
20 )
21
22 #else if $method.method == 'IntegrateLayers'
23
24 #if $method.features
25 features_list<-paste(readLines('$method.features'), collapse=",")
26 #end if
27
28 seurat_obj<-IntegrateLayers(
29 seurat_obj,
30 method = $method.integration.integration_method,
31 #if $method.integration.integration_method == 'CCAIntegration'
32 #if $method.integration.adv.k_filter
33 k.filter = $method.integration.adv.k_filter,
34 #else
35 k.filter = NA,
36 #end if
37 dims = 1:$method.integration.adv.dims,
38 #if $method.integration.adv.dims_to_integrate
39 dims.to.integrate = $method.integration.adv.dims_to_integrate,
40 #end if
41 k.weight = $method.integration.adv.k_weight,
42 #if $method.integration.adv.weight_reduction != ''
43 weight.reduction = c(unlist(strsplit(gsub(" ", "", '$method.integration.adv.weight_reduction'), ","))),
44 #end if
45 sd.weight = $method.integration.adv.sd_weight,
46 preserve.order = $method.integration.adv.preserve_order,
47 #else if $method.integration.integration_method == 'HarmonyIntegration'
48 npcs = $method.integration.adv.npcs,
49 key = '$method.integration.adv.key',
50 #if $method.integration.adv.theta
51 theta = $method.integration.adv.theta,
52 #end if
53 #if $method.integration.adv.lambda
54 lambda = $method.integration.adv.lambda,
55 #end if
56 sigma = $method.integration.adv.sigma,
57 #if $method.integration.adv.nclust
58 nclust = $method.integration.adv.nclust,
59 #end if
60 max_iter = $method.integration.adv.max_iter,
61 #else if $method.integration.integration_method == 'JointPCAIntegration'
62 k.anchor = $method.integration.adv.k_anchor,
63 dims = 1:$method.integration.adv.dims,
64 #if $method.integration.adv.dims_to_integrate
65 dims.to.integrate = $method.integration.adv.dims_to_integrate,
66 #end if
67 k.weight = $method.integration.adv.k_weight,
68 #if $method.integration.adv.weight_reduction != ''
69 weight.reduction = c(unlist(strsplit(gsub(" ", "", '$method.integration.adv.weight_reduction'), ","))),
70 #end if
71 sd.weight = $method.integration.adv.sd_weight,
72 preserve.order = $method.integration.adv.preserve_order,
73 #else if $method.integration.integration_method == 'RPCAIntegration'
74 #if $method.integration.adv.k_filter
75 k.filter = $method.integration.adv.k_filter,
76 #else
77 k.filter = NA,
78 #end if
79 dims = 1:$method.integration.adv.dims,
80 #if $method.integration.adv.dims_to_integrate
81 dims.to.integrate = $method.integration.adv.dims_to_integrate,
82 #end if
83 k.weight = $method.integration.adv.k_weight,
84 #if $method.integration.adv.weight_reduction != ''
85 weight.reduction = c(unlist(strsplit(gsub(" ", "", '$method.integration.adv.weight_reduction'), ","))),
86 #end if
87 sd.weight = $method.integration.adv.sd_weight,
88 preserve.order = $method.integration.adv.preserve_order,
89 #end if
90 orig.reduction = '$method.orig_reduction',
91 new.reduction = '$method.new_reduction',
92 #if $method.assay != ''
93 assay = '$method.assay',
94 #end if
95 #if $method.features
96 features = c(unlist(strsplit(features_list, ","))),
97 #end if
98 #if $method.layers != ''
99 layers = c(unlist(strsplit(gsub(" ", "", '$method.layers'), ","))),
100 #end if
101 #if $method.scale_layers != ''
102 scale_layers = c(unlist(strsplit(gsub(" ", "", '$method.scale_layers'), ","))),
103 #end if
104 #if $method.normalization_method == 'true'
105 normalization.method = 'SCT'
106 #end if
107 )
108
109 #else if $method.method == 'JoinLayers'
110 seurat_obj[['$method.assay']]<-JoinLayers(
111 seurat_obj[['$method.assay']]
112 )
113
114 #else if $method.method == 'PrepSCTFindMarkers'
115 seurat_obj<-PrepSCTFindMarkers(
116 seurat_obj,
117 assay = '$method.assay'
118 )
119
120 #end if
121
122 @CMD_rds_write_outputs@
123
124 ]]></configfile>
125 </configfiles>
126 <inputs>
127 <expand macro="input_rds"/>
128 <conditional name="method">
129 <param name="method" type="select" label="Method used">
130 <option value="SplitLayers">Split data into layers using 'split'</option>
131 <option value="IntegrateLayers" selected="true">Apply integration methods with 'IntegrateLayers'</option>
132 <option value="JoinLayers">Join layers with 'JoinLayers'</option>
133 <option value="PrepSCTFindMarkers">Prepare to run DE on SCT Assay with 'PrepSCTFindMarkers'</option>
134 </param>
135 <when value="SplitLayers">
136 <param argument="assay" type="text" value="RNA" label="Name of assay to use">
137 <expand macro="valid_name"/>
138 </param>
139 <param name="factor" type="text" value="" label="Factor or group to use to split data" help="(f)">
140 <expand macro="valid_name"/>
141 </param>
142 </when>
143 <when value="IntegrateLayers">
144 <conditional name="integration">
145 <param name="integration_method" type="select" label="Integration method to use" help="(method)">
146 <option value="CCAIntegration">CCA Integration</option>
147 <option value="HarmonyIntegration">Harmony Integration</option>
148 <option value="JointPCAIntegration">Joint PCA Integration</option>
149 <option value="RPCAIntegration">RPCA Integration</option>
150 </param>
151 <when value="CCAIntegration">
152 <section name="adv" title="Advanced Options">
153 <param name="k_filter" type="integer" optional="true" value="" label="Number of anchors to filter" help="leave blank to use all (k.filter)"/>
154 <expand macro="integration_inputs"/>
155 </section>
156 </when>
157 <when value="HarmonyIntegration">
158 <section name="adv" title="Advanced Options">
159 <param argument="npcs" type="integer" optional="true" value="50" label="Number of PCs to compute if doing PCA on input matrix"/>
160 <param argument="key" type="text" value="harmony_" label="Dimensional reduction key" help="specifies the string before the number for the dimension names (reduction.key)">
161 <expand macro="valid_reduction_key"/>
162 </param>
163 <param argument="theta" type="float" optional="true" value="" label="Diversity clustering penalty parameter"/>
164 <param argument="lambda" type="float" optional="true" value="" label="Ridge regression penalty parameter"/>
165 <param argument="sigma" type="float" value="0.1" label="Width of soft kmeans clusters"/>
166 <param argument="nclust" type="integer" optional="true" value="" label="Number of clusters in model"/>
167 <param argument="max_iter" type="integer" value="10" label="Maximum number of rounds to run Harmony"/>
168 </section>
169 </when>
170 <when value="JointPCAIntegration">
171 <section name="adv" title="Advanced Options">
172 <param name="k_anchor" type="integer" value="20" label="How many neighbors (k) to use when picking anchors"/>
173 <expand macro="integration_inputs"/>
174 </section>
175 </when>
176 <when value="RPCAIntegration">
177 <section name="adv" title="Advanced Options">
178 <param name="k_filter" type="integer" optional="true" value="" label="Number of anchors to filter" help="leave blank to use all (k.filter)"/>
179 <expand macro="integration_inputs"/>
180 </section>
181 </when>
182 </conditional>
183 <param name="orig_reduction" type="text" value="pca" label="Dimensional reduction to use for correction" help="(orig.reduction)">
184 <expand macro="valid_name"/>
185 </param>
186 <param name="new_reduction" type="text" value="integrated.dr" label="Name for new dimensional reduction" help="(new.reduction)">
187 <expand macro="valid_name"/>
188 </param>
189 <expand macro="select_assay"/>
190 <param argument="features" type="data" format="txt,tabular" optional="true" label="List of features to use for integration" help="text file with one feature on each line"/>
191 <param argument="layers" type="text" optional="true" value="" label="Names of normalized layer(s) in assay">
192 <expand macro="valid_list"/>
193 </param>
194 <param name="scale_layers" type="text" optional="true" value="" label="Names of scaled layer(s) in assay" help="(scale.layer)">
195 <expand macro="valid_list"/>
196 </param>
197 <param name="normalization_method" type="boolean" truevalue="true" falsevalue="false" label="Use SCT as Normalization Method" help="after using SCTransform (normalization.method)"/>
198 </when>
199 <when value="JoinLayers">
200 <param argument="assay" type="text" value="RNA" label="Name of assay to join">
201 <expand macro="valid_name"/>
202 </param>
203 </when>
204 <when value="PrepSCTFindMarkers">
205 <param argument="assay" type="text" value="SCT" label="Name of Assay where SCT objects are stored">
206 <expand macro="valid_name"/>
207 </param>
208 </when>
209 </conditional>
210 <expand macro="inputs_common_advanced"/>
211 </inputs>
212 <outputs>
213 <expand macro="seurat_outputs"/>
214 </outputs>
215 <tests>
216 <test expect_num_outputs="2">
217 <!-- test1: SplitLayers -->
218 <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/added_metadata.rds"/>
219 <conditional name="method">
220 <param name="method" value="SplitLayers"/>
221 <param name="assay" value="RNA"/>
222 <param name="factor" value="Group"/>
223 </conditional>
224 <section name="advanced_common">
225 <param name="show_log" value="true"/>
226 </section>
227 <output name="hidden_output">
228 <assert_contents>
229 <has_text_matching expression="split"/>
230 </assert_contents>
231 </output>
232 <output name="rds_out" location="https://zenodo.org/records/13732784/files/splitdata.rds" ftype="rds"/>
233 </test>
234 <test expect_num_outputs="2">
235 <!-- test2: IntegrateLayers-->
236 <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/unintegrated_umap.rds"/>
237 <conditional name="method">
238 <param name="method" value="IntegrateLayers"/>
239 <conditional name="integration">
240 <param name="integration_method" value="CCAIntegration"/>
241 </conditional>
242 <param name="orig_reduction" value="pca"/>
243 <param name="new_reduction" value="integrated.cca"/>
244 </conditional>
245 <section name="advanced_common">
246 <param name="show_log" value="true"/>
247 </section>
248 <output name="hidden_output">
249 <assert_contents>
250 <has_text_matching expression="IntegrateLayers"/>
251 </assert_contents>
252 </output>
253 <output name="rds_out" location="https://zenodo.org/records/13732784/files/cca_integrated.rds" ftype="rds"/>
254 </test>
255 <test expect_num_outputs="2">
256 <!-- test3: IntegrateLayers - Harmony Installed-->
257 <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/unintegrated_umap.rds"/>
258 <conditional name="method">
259 <param name="method" value="IntegrateLayers"/>
260 <conditional name="integration">
261 <param name="integration_method" value="HarmonyIntegration"/>
262 </conditional>
263 <param name="orig_reduction" value="pca"/>
264 <param name="new_reduction" value="integrated.harm"/>
265 </conditional>
266 <section name="advanced_common">
267 <param name="show_log" value="true"/>
268 </section>
269 <output name="hidden_output">
270 <assert_contents>
271 <has_text_matching expression="IntegrateLayers"/>
272 </assert_contents>
273 </output>
274 <output name="rds_out" location="https://zenodo.org/records/13732784/files/harm_integrated.rds" ftype="rds" compare="sim_size"/>
275 </test>
276 <test expect_num_outputs="2">
277 <!-- test4: JoinLayers-->
278 <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/integrated_umap.rds"/>
279 <conditional name="method">
280 <param name="method" value="JoinLayers"/>
281 </conditional>
282 <section name="advanced_common">
283 <param name="show_log" value="true"/>
284 </section>
285 <output name="hidden_output">
286 <assert_contents>
287 <has_text_matching expression="JoinLayers"/>
288 </assert_contents>
289 </output>
290 <output name="rds_out" location="https://zenodo.org/records/13732784/files/joined.rds" ftype="rds"/>
291 </test>
292 <test expect_num_outputs="2">
293 <!-- test5: PrepSCTFindMarkers-->
294 <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/SCT_integrated_umap.rds"/>
295 <conditional name="method">
296 <param name="method" value="PrepSCTFindMarkers"/>
297 </conditional>
298 <section name="advanced_common">
299 <param name="show_log" value="true"/>
300 </section>
301 <output name="hidden_output">
302 <assert_contents>
303 <has_text_matching expression="PrepSCTFindMarkers"/>
304 </assert_contents>
305 </output>
306 <output name="rds_out" location="https://zenodo.org/records/13732784/files/PrepSCTFindMarkers.rds" ftype="rds"/>
307 </test>
308 </tests>
309 <help><![CDATA[
310 Seurat
311 ======
312
313 Seurat is an R package designed for QC, analysis, and exploration of single-cell RNA-seq data.
314
315 Seurat aims to enable users to identify and interpret sources of heterogeneity from single-cell transcriptomic measurements, and to integrate diverse types of single-cell data.
316
317
318 Split
319 =====
320
321 The split function is used here to split the data into separate layers based on the groups defined by f. Each group becomes its own layer in the Seurat Object.
322
323 More details on the `R documentation
324 <https://rdrr.io/r/base/split.html>`__
325
326
327 Integrate
328 =========
329
330 Multiple layers are integrated to enable them to be analysed together.
331
332 Available methods are: CCA, Harmony, JointPCA, RPCA, FastMNN and scVI.
333
334 More details on the `seurat documentation
335 <https://satijalab.github.io/seurat-object/reference/CreateSeuratObject.html>`__
336
337 JoinLayers
338 ==========
339
340 Multiple layers (e.g. those created using the split function) can be joined together in a single layer. No integration is performed by this function.
341
342 More details on the `seurat documentation
343 <https://satijalab.github.io/seurat-object/reference/SplitLayers.html>`__
344
345 PrepSCTFindMarkers
346 ==================
347
348 Given a merged object with multiple SCT models, this function uses minimum of the median UMI (calculated using the raw UMI counts) of individual objects to reverse the individual SCT regression model using minimum of median UMI as the sequencing depth covariate.
349 The counts slot of the SCT assay is replaced with recorrected counts and the data slot is replaced with log1p of recorrected counts.
350
351 More details on the `seurat documentation
352 <https://satijalab.org/seurat/reference/prepsctfindmarkers>`__
353
354 ]]></help>
355 <expand macro="citations"/>
356 </tool>