comparison scanpy-integrate-mnn.xml @ 0:873449082a29 draft

"planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/tree/develop/tools/tertiary-analysis/scanpy commit 62f47287c7e8449c59a1f1f454852ddc669b1b1e-dirty"
author ebi-gxa
date Mon, 07 Sep 2020 13:10:40 +0000
parents
children 7ae183da3f07
comparison
equal deleted inserted replaced
-1:000000000000 0:873449082a29
1 <?xml version="1.0" encoding="utf-8"?>
2 <tool id="scanpy_integrate_mnn" name="Scanpy MNN" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
3 <description>correct batch effects by matching mutual nearest neighbors</description>
4 <macros>
5 <import>scanpy_macros2.xml</import>
6 </macros>
7 <expand macro="requirements"/>
8 <command detect_errors="exit_code"><![CDATA[
9 #if $batch_key
10 ln -s '${input_obj_file}' input.h5 &&
11 PYTHONIOENCODING=utf-8 scanpy-integrate mnn
12 --batch-key '${batch_key}'
13 #if $batch_layer
14 --batch-layer '${batch_layer}'
15 #end if
16 #if $key_added
17 --key-added '${key_added}'
18 #end if
19 #if $var_subset
20 #set var_subsets = ' '.join(["--var-subset '{name}' '{values}'".format(**$v) for $v in $var_subset])
21 ${var_subsets}
22 #if $settings.default == "false"
23 #if $settings.n_neighbors
24 --n-neighbors '${settings.n_neighbors}'
25 #end if
26 #if $settings.sigma
27 --sigma '${settings.sigma}'
28 #end if
29 #if not $settings.cos_norm_in
30 ${settings.cos_norm_in}
31 #end if
32 #if $settings.svd_dim
33 --svd-dim '${settings.svd_dim}'
34 #end if
35 #if not $settings.var_adj
36 ${settings.var_adj}
37 #end if
38 #if $settings.compute_angle
39 ${settings.compute_angle}
40 #end if
41 #if $settings.svd_mode
42 --svd-mode '${settings.svd_mode}'
43 #end if
44 #end if
45 #end if
46 @INPUT_OPTS@
47 @OUTPUT_OPTS@
48 #else
49 echo "No batch variables passed, simply passing original input as output unchanged.";
50 cp '${input_obj_file}' '${output_h5}'
51 #end if
52 ]]></command>
53
54 <inputs>
55 <expand macro="input_object_params"/>
56 <expand macro="output_object_params"/>
57 <param name="batch_key" type="text" argument="--batch-key" label="The name of the column in adata.obs that differentiates among experiments/batches.">
58 <sanitizer>
59 <valid initial="string.printable"/>
60 </sanitizer>
61 </param>
62 <param name="batch_layer" type="text" argument="--batch-layer" label="Layer to batch correct. By default corrects the contents of .X.">
63 <sanitizer>
64 <valid initial="string.printable"/>
65 </sanitizer>
66 </param>
67 <param name="key_added" argument="--key-added" type="text" optional="true" label="Key under which to add the computed results." help="By default a new layer will be created called 'mnn', 'mnn_{layer}' or 'mnn_{layer}_{key_added}' where those parameters were specified. A value of 'X' causes batch-corrected values to overwrite the original content of .X."/>
68 <repeat name="var_subset" title="The subset of vars (list of str) to be used when performing MNN correction" min="0">
69 <param name="name" type="text" value="" label="Name of the categorical variable to filter on" help="e.g. 'highly_variable'"/>
70 <param name="values" type="text" value="" label="Category or comma-separated list of categories" help="e.g. 'True'"/>
71 </repeat>
72 <conditional name="settings">
73 <param name="default" type="boolean" checked="true" label="Use programme defaults"/>
74 <when value="true"/>
75 <when value="false">
76 <param name="n_neighbors" argument="--n-neighbors" type="integer" value="20" label="Number of mutual nearest neighbors."/>
77 <param name="sigma" argument="--sigma" type="float" value="1.0" label="Sigma" help="The bandwidth of the Gaussian smoothing kernel used to compute the correction vectors." />
78 <param name="cos_norm_in" argument="--no-cos-norm-in" type="boolean" truevalue="" falsevalue="--no-cos-norm-in" checked="True"
79 label="Perform cosine normalization prior to computing corrected expression values?" />
80 <param name="svd_dim" argument="--svd-dim" type="integer" optional="true" label="Number of dimensions to use for summarizing biological substructure within each batch." help="If not set, biological components will not be removed from the correction vectors."/>
81 <param name="var_adj" argument="--no-var-adj" type="boolean" truevalue="" falsevalue="--no-var-adj" checked="True"
82 label="Adjust variance of the correction vectors?" help="Note this step takes most computing time." />
83 <param name="compute_angle" argument="--compute-angle" type="boolean" truevalue="--compute-angle" falsevalue="" checked="False"
84 label="Compute the angle between each cell’s correction vector and the biological subspace of the reference batch?" />
85 <param name="svd_mode" argument="--svd-mode" type="select" label="SVD mode" help="'svd' computes SVD using a non-randomized SVD-via-ID algorithm, while 'rsvd' uses a randomized version. 'irlb' performs truncated SVD by implicitly restarted Lanczos bidiagonalization (forked from https://github.com/airysen/irlbpy)." >
86 <option value="rsvd" selected="true">rsvd</option>
87 <option value="svd">svd</option>
88 <option value="irlb">irlb</option>
89 </param>
90 </when>
91 </conditional>
92 </inputs>
93
94 <outputs>
95 <expand macro="output_data_obj" description="Batch-corrected for ${batch_key}"/>
96 </outputs>
97
98 <tests>
99 <test>
100 <param name="input_obj_file" value="find_cluster.h5"/>
101 <param name="input_format" value="anndata"/>
102 <param name="output_format" value="anndata"/>
103 <param name="batch_key" value="louvain"/>
104 <output name="output_h5" file="mnn.h5" ftype="h5" compare="sim_size"/>
105 </test>
106 </tests>
107
108 <help><![CDATA[
109 .. class:: infomark
110
111 **What it does**
112
113 Corrects for batch effects by fitting linear models, gains statistical power via an EB framework where information is borrowed across genes.
114
115 @HELP@
116
117 @VERSION_HISTORY@
118 ]]></help>
119 <expand macro="citations"/>
120 </tool>