Mercurial > repos > iuc > scanpy_remove_confounders
comparison remove_confounders.xml @ 0:9ca360dde8e3 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit 92f85afaed0097d1879317a9f513093fce5481d6
author | iuc |
---|---|
date | Mon, 04 Mar 2019 10:16:47 -0500 |
parents | |
children | a89ee42625ad |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9ca360dde8e3 |
---|---|
1 <tool id="scanpy_remove_confounders" name="Remove confounders with scanpy" version="@version@"> | |
2 <description></description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 <xml name="score_genes_params"> | |
6 <param argument="n_bins" type="integer" value="25" label="Number of expression level bins for sampling" help=""/> | |
7 <param argument="random_state" type="integer" value="0" label="Random seed for sampling" help=""/> | |
8 <expand macro="param_use_raw"/> | |
9 </xml> | |
10 <token name="@CMD_score_genes_inputs@"><![CDATA[ | |
11 n_bins=$method.n_bins, | |
12 random_state=$method.random_state, | |
13 use_raw=$method.use_raw, | |
14 copy=False | |
15 ]]></token> | |
16 </macros> | |
17 <expand macro="requirements"/> | |
18 <command detect_errors="exit_code"><![CDATA[ | |
19 @CMD@ | |
20 ]]></command> | |
21 <configfiles> | |
22 <configfile name="script_file"><![CDATA[ | |
23 @CMD_imports@ | |
24 @CMD_read_inputs@ | |
25 | |
26 #if $method.method == "pp.regress_out" | |
27 sc.pp.regress_out( | |
28 adata=adata, | |
29 keys='$method.reg_keys', | |
30 copy=False) | |
31 #elif $method.method == "tl.score_genes" | |
32 sc.tl.score_genes( | |
33 adata=adata, | |
34 #set $gene_list = [str(x.strip()) for x in str($method.gene_list).split(',')] | |
35 gene_list=$gene_list, | |
36 ctrl_size=$method.ctrl_size, | |
37 score_name='$method.score_name', | |
38 #if $method.gene_pool | |
39 #set $gene_pool = [str(x.strip()) for x in $method.gene_pool.split(',')] | |
40 gene_pool=$gene_pool, | |
41 #end if | |
42 @CMD_score_genes_inputs@) | |
43 adata.obs.to_csv('$obs', sep='\t') | |
44 #elif $method.method == "tl.score_genes_cell_cycle" | |
45 sc.tl.score_genes_cell_cycle( | |
46 adata=adata, | |
47 #set $s_genes = [str(x.strip()) for x in $method.s_genes.split(',')] | |
48 s_genes=$s_genes, | |
49 #set $g2m_genes = [str(x.strip()) for x in $method.g2m_genes.split(',')] | |
50 g2m_genes=$g2m_genes, | |
51 @CMD_score_genes_inputs@) | |
52 adata.obs.to_csv('$obs', sep='\t') | |
53 #end if | |
54 | |
55 @CMD_anndata_write_outputs@ | |
56 ]]></configfile> | |
57 </configfiles> | |
58 <inputs> | |
59 <expand macro="inputs_anndata"/> | |
60 <conditional name="method"> | |
61 <param argument="method" type="select" label="Method used for plotting"> | |
62 <option value="pp.regress_out">Regress out unwanted sources of variation, using `pp.regress_out`</option> | |
63 <!--<option value="pp.mnn_correct">, using `pp.mnn_correct`</option>!--> | |
64 <!--<option value="pp.dca">, using `pp.mnn_correct`</option>!--> | |
65 <!--<option value="pp.magic">, using `pp.magic`</option>!--> | |
66 <!--<option value="tl.sim">, using `tl.sim`</option>!--> | |
67 <!--<option value="pp.calculate_qc_metrics">, using `pp.calculate_qc_metrics`</option>!--> | |
68 <option value="tl.score_genes">Score a set of genes, using `tl.score_genes`</option> | |
69 <option value="tl.score_genes_cell_cycle">Score cell cycle genes, using `tl.score_genes_cell_cycle`</option> | |
70 <!--<option value="tl.cyclone">, using `tl.cyclone`</option>!--> | |
71 <!--<option value="tl.andbag">, using `tl.andbag`</option>!--> | |
72 </param> | |
73 <when value="pp.regress_out"> | |
74 <param argument="reg_keys" type="text" value="" label="Keys for observation annotation on which to regress on" help=""/> | |
75 </when> | |
76 <when value="tl.score_genes"> | |
77 <param argument="gene_list" type="text" value="" label="The list of gene names used for score calculation" help="Genes separated by a comma"/> | |
78 <param argument="ctrl_size" type="integer" value="50" label="Number of reference genes to be sampled" | |
79 help="If `len(gene_list)` is not too low, you can set `ctrl_size=len(gene_list)`."/> | |
80 <param argument="gene_pool" type="text" value="" optional="true" label="Genes for sampling the reference set" | |
81 help="Default is all genes. Genes separated by a comma"/> | |
82 <expand macro="score_genes_params"/> | |
83 <param argument="score_name" type="text" value="score" label="Name of the field to be added in `.obs`" help=""/> | |
84 </when> | |
85 <when value="tl.score_genes_cell_cycle"> | |
86 <param name="s_genes" type="text" value="" label="List of genes associated with S phase" help="Genes separated by a comma"/> | |
87 <param name="g2m_genes" type="text" value="" label="List of genes associated with G2M phase" help="Genes separated by a comma"/> | |
88 <expand macro="score_genes_params"/> | |
89 </when> | |
90 </conditional> | |
91 <expand macro="anndata_output_format"/> | |
92 </inputs> | |
93 <outputs> | |
94 <expand macro="anndata_outputs"/> | |
95 <data name="obs" format="tabular" label="${tool.name} on ${on_string}: Observations annotation"> | |
96 <filter>method['method'] == 'tl.score_genes' or method['method'] == 'tl.score_genes_cell_cycle'</filter> | |
97 </data> | |
98 </outputs> | |
99 <tests> | |
100 <test> | |
101 <conditional name="input"> | |
102 <param name="format" value="h5ad" /> | |
103 <param name="adata" value="krumsiek11.h5ad" /> | |
104 </conditional> | |
105 <conditional name="method"> | |
106 <param name="method" value="pp.regress_out"/> | |
107 <param name="reg_keys" value="cell_type"/> | |
108 </conditional> | |
109 <param name="anndata_output_format" value="h5ad" /> | |
110 <assert_stdout> | |
111 <has_text_matching expression="sc.pp.regress_out"/> | |
112 <has_text_matching expression="keys='cell_type'"/> | |
113 </assert_stdout> | |
114 <output name="anndata_out_h5ad" file="pp.regress_out.krumsiek11.h5ad" ftype="h5" compare="sim_size"/> | |
115 </test> | |
116 <test> | |
117 <conditional name="input"> | |
118 <param name="format" value="h5ad" /> | |
119 <param name="adata" value="krumsiek11.h5ad" /> | |
120 </conditional> | |
121 <conditional name="method"> | |
122 <param name="method" value="tl.score_genes"/> | |
123 <param name="gene_list" value="Gata2, Fog1"/> | |
124 <param name="ctrl_size" value="2"/> | |
125 <param name="n_bins" value="2"/> | |
126 <param name="random_state" value="2"/> | |
127 <param name="use_raw" value="False"/> | |
128 <param name="score_name" value="score"/> | |
129 </conditional> | |
130 <param name="anndata_output_format" value="h5ad"/> | |
131 <assert_stdout> | |
132 <has_text_matching expression="sc.tl.score_genes" /> | |
133 <has_text_matching expression="gene_list=\['Gata2', 'Fog1'\]" /> | |
134 <has_text_matching expression="ctrl_size=2" /> | |
135 <has_text_matching expression="score_name='score'" /> | |
136 <has_text_matching expression="n_bins=2" /> | |
137 <has_text_matching expression="random_state=2" /> | |
138 <has_text_matching expression="use_raw=False" /> | |
139 <has_text_matching expression="copy=False" /> | |
140 </assert_stdout> | |
141 <output name="anndata_out_h5ad" file="tl.score_genes.krumsiek11.h5ad" ftype="h5" compare="sim_size"/> | |
142 <output name="obs" file="tl.score_genes.krumsiek11.obs.tabular" ftype="tabular" compare="sim_size"/> | |
143 </test> | |
144 <test> | |
145 <conditional name="input"> | |
146 <param name="format" value="h5ad" /> | |
147 <param name="adata" value="krumsiek11.h5ad" /> | |
148 </conditional> | |
149 <conditional name="method"> | |
150 <param name="method" value="tl.score_genes_cell_cycle"/> | |
151 <param name="s_genes" value="Gata2, Fog1, EgrNab"/> | |
152 <param name="g2m_genes" value="Gata2, Fog1, EgrNab"/> | |
153 <param name="n_bins" value="2"/> | |
154 <param name="random_state" value="1"/> | |
155 <param name="use_raw" value="False"/> | |
156 </conditional> | |
157 <param name="anndata_output_format" value="h5ad"/> | |
158 <assert_stdout> | |
159 <has_text_matching expression="sc.tl.score_genes_cell_cycle"/> | |
160 <has_text_matching expression="s_genes=\['Gata2', 'Fog1', 'EgrNab'\]"/> | |
161 <has_text_matching expression="g2m_genes=\['Gata2', 'Fog1', 'EgrNab'\]"/> | |
162 <has_text_matching expression="n_bins=2"/> | |
163 <has_text_matching expression="random_state=1"/> | |
164 <has_text_matching expression="use_raw=False"/> | |
165 </assert_stdout> | |
166 <output name="anndata_out_h5ad" file="tl.score_genes_cell_cycle.krumsiek11.h5ad" ftype="h5" compare="sim_size"/> | |
167 <output name="obs" file="tl.score_genes_cell_cycle.krumsiek11.obs.tabular" ftype="tabular" compare="sim_size"/> | |
168 </test> | |
169 </tests> | |
170 <help><![CDATA[ | |
171 Regress out unwanted sources of variation, using `pp.regress_out` | |
172 ================================================================= | |
173 | |
174 Regress out unwanted sources of variation, using simple linear regression. This is | |
175 inspired by Seurat's `regressOut` function in R. | |
176 | |
177 More details on the `scanpy documentation | |
178 <https://scanpy.readthedocs.io/en/latest/api/scanpy.api.pp.regress_out.html#scanpy.api.pp.regress_out>`__ | |
179 | |
180 Score a set of genes, using `tl.score_genes` | |
181 ============================================ | |
182 | |
183 The score is the average expression of a set of genes subtracted with the | |
184 average expression of a reference set of genes. The reference set is | |
185 randomly sampled from the `gene_pool` for each binned expression value. | |
186 | |
187 This reproduces the approach in Seurat (Satija et al, 2015) and has been implemented | |
188 for Scanpy by Davide Cittaro. | |
189 | |
190 More details on the `scanpy documentation | |
191 <https://scanpy.readthedocs.io/en/latest/api/scanpy.api.tl.score_genes.html#scanpy.api.tl.score_genes>`__ | |
192 | |
193 Score cell cycle genes, using `tl.score_genes_cell_cycle` | |
194 ========================================================= | |
195 | |
196 Given two lists of genes associated to S phase and G2M phase, calculates | |
197 scores and assigns a cell cycle phase (G1, S or G2M). See | |
198 `score_genes` for more explanation. | |
199 | |
200 More details on the `scanpy documentation | |
201 <https://scanpy.readthedocs.io/en/latest/api/scanpy.api.tl.score_genes_cell_cycle.html#scanpy.api.tl.score_genes_cell_cycle>`__ | |
202 ]]></help> | |
203 <expand macro="citations"/> | |
204 </tool> |