Mercurial > repos > bgruening > music_deconvolution
comparison music_deconvolution.xml @ 4:56371b5a2da9 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/music/ commit 8beed1a19fcd9dc59f7746e1dfa735a2d5f29784"
author | bgruening |
---|---|
date | Thu, 10 Feb 2022 12:52:31 +0000 |
parents | |
children | 2ba99a52bd44 |
comparison
equal
deleted
inserted
replaced
3:fd7a16d073c5 | 4:56371b5a2da9 |
---|---|
1 <tool id="music_deconvolution" name="MuSiC Deconvolution" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" | |
2 profile="21.09" license="GPL-3.0-or-later" > | |
3 <description>estimate cell type proportions in bulk RNA-seq data</description> | |
4 <macros> | |
5 <import>macros.xml</import> | |
6 </macros> | |
7 <expand macro="requirements" /> | |
8 <command detect_errors="exit_code" ><![CDATA[ | |
9 mkdir report_data && | |
10 Rscript --vanilla '$__tool_directory__/scripts/${do.method}.R' '$conf' | |
11 ]]></command> | |
12 <configfiles> | |
13 <configfile name="conf" > | |
14 | |
15 null_str_vec = function(gstr){ | |
16 tokens = unlist(as.vector(strsplit(gstr, split=","))) | |
17 if (length(tokens) == 0){ | |
18 return(NULL) | |
19 } | |
20 if (length(tokens) == 1){ | |
21 return(tokens[[1]]) | |
22 } | |
23 return(tokens) | |
24 } | |
25 | |
26 bulk_eset = readRDS('$bulk_eset') | |
27 scrna_eset = readRDS('$scrna_eset') | |
28 use_disease_factor = FALSE | |
29 maxyscale = NA | |
30 | |
31 #if str($do.method) == "estimateprops": | |
32 | |
33 maxyscale = as.numeric('$do.maxyscale') ## yields "NA" if blank | |
34 phenotype_factors = null_str_vec('$do.phenotype_factors') | |
35 phenotype_factors_always_exclude = null_str_vec('$do.phenotype_factors_always_exclude') | |
36 celltypes_label = null_str_vec('$do.celltypes_label') | |
37 samples_label = null_str_vec('$do.samples_label') | |
38 celltypes = null_str_vec('$do.celltypes') | |
39 methods = c(null_str_vec('$do.est_methods')) | |
40 | |
41 #if str($do.disease_factor.use) == "yes": | |
42 use_disease_factor = TRUE | |
43 phenotype_scrna_target = null_str_vec('$do.disease_factor.phenotype_scrna_target') | |
44 phenotype_target = null_str_vec('$do.disease_factor.phenotype_target') | |
45 phenotype_target_threshold = as.numeric('$do.disease_factor.phenotype_target_threshold') | |
46 sample_disease_group = null_str_vec('$do.disease_factor.sample_disease_group') | |
47 sample_disease_group_scale = as.integer('$do.disease_factor.sample_disease_group_scale') | |
48 #end if | |
49 | |
50 outfile_pdf='$out_pdf' | |
51 | |
52 #elif str($do.method) == "dendrogram": | |
53 | |
54 celltypes_label = null_str_vec('$do.celltypes_label') | |
55 clustertype_label = null_str_vec('$do.clustertype_label') | |
56 samples_label = null_str_vec('$do.samples_label') | |
57 celltypes = null_str_vec('$do.celltypes') | |
58 | |
59 data.to.use = list( | |
60 #for $i, $repeat in enumerate( $do.cluster_groups ) | |
61 #if $i == 0: | |
62 $repeat.cluster_id = list(cell.types = null_str_vec('$repeat.celltypes'), | |
63 marker.names = null_str_vec('$repeat.marker_name'), | |
64 marker.list = read_list('$repeat.marker_list')) | |
65 #else | |
66 , $repeat.cluster_id = list(cell.types = null_str_vec('$repeat.celltypes'), | |
67 marker.names = null_str_vec('$repeat.marker_name'), | |
68 marker.list = read_list('$repeat.marker_list')) | |
69 #end if | |
70 #end for | |
71 ) | |
72 | |
73 outfile_pdf='$out_pdf' | |
74 outfile_tab='$out_tab' | |
75 | |
76 #else | |
77 stop("No such option") | |
78 #end if | |
79 | |
80 </configfile> | |
81 </configfiles> | |
82 <inputs> | |
83 <param name="scrna_eset" label="scRNA Dataset" type="data" format="@RDATATYPE@" /> | |
84 <param name="bulk_eset" label="Bulk RNA Dataset" type="data" format="@RDATATYPE@" /> | |
85 <conditional name="do" > | |
86 <param name="method" type="select" label="Purpose" > | |
87 <!-- The values here correspond to script names in the scripts folder | |
88 and must remain so --> | |
89 <option value="estimateprops">Estimate Proportions</option> | |
90 <option value="dendrogram">Compute Dendrogram</option> | |
91 </param> | |
92 <when value="estimateprops" > | |
93 <param name="est_methods" type="select" multiple="true" label="Methods to use" min="1" > | |
94 <option value="MuSiC" selected="true" >MuSiC</option> | |
95 <option value="NNLS" selected="true" >NNLS</option> | |
96 </param> | |
97 <param name="celltypes_label" type="text" value="cellType" | |
98 label="Cell Types Label from scRNA dataset" > | |
99 <expand macro="validator_text" /> | |
100 </param> | |
101 <param name="samples_label" type="text" value="sampleID" | |
102 label="Samples Identifier from scRNA dataset" > | |
103 <expand macro="validator_text" /> | |
104 </param> | |
105 <expand macro="celltypes_macro" /> | |
106 <param name="phenotype_factors" type="text" | |
107 label="Phenotype factors" | |
108 help="List of phenotypes factors to be used in the linear regression. Please make sure that each factor has more than one unique value. Names correspond to column names in the bulk RNA dataset phenotype table. If blank, then treat all bulk phenotype columns as factors." > | |
109 <expand macro="validator_index_identifiers" /> | |
110 </param> | |
111 <param name="phenotype_factors_always_exclude" type="text" | |
112 label="Excluded phenotype factors" | |
113 help="List of phenotype factors to always exclude in the analysis" | |
114 value="sampleID,SubjectName" > | |
115 <expand macro="validator_index_identifiers" /> | |
116 </param> | |
117 <conditional name="disease_factor" > | |
118 <param name="use" type="select" label="Show proportions of a disease factor?" > | |
119 <option value="no" selected="true" >No</option> | |
120 <option value="yes" >Yes</option> | |
121 </param> | |
122 <when value="no" ></when> | |
123 <when value="yes" > | |
124 <param name="phenotype_scrna_target" type="text" label="scRNA Phenotype Cell Target" | |
125 help="The name of a target scRNA cell type to select in the phenotype comparison." > | |
126 <expand macro="validator_text" /> | |
127 </param> | |
128 <param name="phenotype_target" type="text" label="Bulk Phenotype Target" | |
129 help="MUST exist in the bulk RNA datasets phenotype factors as above." > | |
130 <expand macro="validator_text" /> | |
131 </param> | |
132 <param name="phenotype_target_threshold" type="float" label="Bulk Phenotype Target Threshold" | |
133 value="-99" | |
134 help="The (%) threshold at which the phenotype target manifests. Leave at -99 to select all." > | |
135 </param> | |
136 <param name="sample_disease_group" type="text" label="scRNA Sample Disease Group" | |
137 help="Name for target disease group, ideally a value from the scRNA phenotype factor data" > | |
138 <expand macro="validator_text" /> | |
139 </param> | |
140 <param name="sample_disease_group_scale" type="integer" | |
141 label="scRNA Sample Disease Group (Scale)" value="5" | |
142 help="Used to accentutate certain features in the plots. Increase this number to reduce the effect." /> | |
143 </when> | |
144 </conditional> | |
145 <param name="maxyscale" type="float" min="0" value="" optional="true" | |
146 label="Scale all Y-axes to max limit" help="Leave blank to autoscale each plot."/> | |
147 </when> | |
148 <when value="dendrogram" > | |
149 <param name="celltypes_label" type="text" value="cellType" | |
150 label="Cell Types Label from scRNA dataset" > | |
151 <expand macro="validator_text" /> | |
152 </param> | |
153 <param name="clustertype_label" type="text" value="clusterType" | |
154 label="Cluster Types Label from scRNA dataset" > | |
155 <expand macro="validator_text" /> | |
156 </param> | |
157 <param name="samples_label" type="text" value="sampleID" | |
158 label="Samples Identifier from scRNA dataset" > | |
159 <expand macro="validator_text" /> | |
160 </param> | |
161 <expand macro="celltypes_macro" /> | |
162 <repeat name="cluster_groups" title="Cluster Groups" min="0" | |
163 help="Insert cell cluster groups based on a previous clustering." > | |
164 <param name="cluster_id" label="Cluster ID" type="text" value="" | |
165 help="e.g. C1 or Cluster1, etc." /> | |
166 <expand macro="celltypes_macro" /> | |
167 <param name="marker_name" label="Marker Gene Group Name" type="text" | |
168 optional="true" value="" | |
169 help="Name of the list of gene markers used to describe the marker list supplied below." > | |
170 <expand macro="validator_text" /> | |
171 </param> | |
172 <param name="marker_list" label="List of Gene Markers" type="data" format="txt,tabular" | |
173 optional="true" | |
174 help="A single column of marker genes" /> | |
175 </repeat> | |
176 </when> | |
177 </conditional> | |
178 </inputs> | |
179 <outputs> | |
180 <data name="out_pdf" format="pdf" label="${tool.name} on ${on_string}: PDF Plots" /> | |
181 <data name="out_tab" format="tabular" label="${tool.name} on ${on_string}: Cell Proportions by Sample" > | |
182 <filter>do["method"] == "dendrogram" and len(do["cluster_groups"]) >0</filter> | |
183 </data> | |
184 <collection name="props" type="list" label="${tool.name} on ${on_string}: Proportion Matrices" > | |
185 <filter>do["method"] == "estimateprops"</filter> | |
186 <discover_datasets pattern="prop_(?P<designation>.+)\.tabular" format="tabular" directory="report_data" /> | |
187 </collection> | |
188 <collection name="summaries" type="list" label="${tool.name} on ${on_string}: Summaries and Logs"> | |
189 <filter>do["method"] == "estimateprops" and do["disease_factor"]["use"] == "yes"</filter> | |
190 <discover_datasets pattern="summ_(?P<designation>.+)\.txt" format="txt" directory="report_data" /> | |
191 <discover_datasets pattern="varprop_(?P<designation>.+)\.tabular" format="tabular" directory="report_data" /> | |
192 <discover_datasets pattern="rsquared_(?P<designation>.+)\.tabular" format="tabular" directory="report_data" /> | |
193 <discover_datasets pattern="weightgene_(?P<designation>.+)\.tabular" format="tabular" directory="report_data" /> | |
194 </collection> | |
195 </outputs> | |
196 <tests> | |
197 <test expect_num_outputs="1" > | |
198 <!-- Dendrogram test 1 --> | |
199 <param name="bulk_eset" value="Mousebulkeset.rds" /> | |
200 <param name="scrna_eset" value="Mousesubeset.degenesonly2.half.rds" /> | |
201 <conditional name="do" > | |
202 <param name="method" value="dendrogram" /> | |
203 <param name="celltypes_label" value="cellType" /> | |
204 <param name="samples_label" value="sampleID" /> | |
205 <param name="celltypes" value="Endo,Podo,PT,LOH,DCT,CD-PC,CD-IC,Fib,Macro,Neutro,B lymph,T lymph,NK" /> | |
206 </conditional> | |
207 <output name="out_pdf" value="dendro_1.pdf" compare="sim_size" /> | |
208 </test> | |
209 <test expect_num_outputs="2" > | |
210 <!-- Dendrogram test 2 --> | |
211 <param name="bulk_eset" value="Mousebulkeset.rds" /> | |
212 <param name="scrna_eset" value="Mousesubeset.degenesonly2.half.rds" /> | |
213 <conditional name="do" > | |
214 <param name="method" value="dendrogram" /> | |
215 <param name="celltypes_label" value="cellType" /> | |
216 <param name="samples_label" value="sampleID" /> | |
217 <param name="celltypes" value="Endo,Podo,PT,LOH,DCT,CD-PC,CD-IC,Fib,Macro,Neutro,B lymph,T lymph,NK" /> | |
218 <repeat name="cluster_groups" > | |
219 <param name="cluster_id" value="C1" /> | |
220 <param name="celltypes" value="Neutro" /> | |
221 </repeat> | |
222 <repeat name="cluster_groups" > | |
223 <param name="cluster_id" value="C2" /> | |
224 <param name="celltypes" value="Podo" /> | |
225 </repeat> | |
226 <repeat name="cluster_groups" > | |
227 <param name="cluster_id" value="C3" /> | |
228 <param name="celltypes" value="Endo,CD-PC,LOH,CD-IC,DCT,PT" /> | |
229 <param name="marker_name" value="Epithelial" /> | |
230 <param name="marker_list" value="epith.markers" /> | |
231 </repeat> | |
232 <repeat name="cluster_groups" > | |
233 <param name="cluster_id" value="C4" /> | |
234 <param name="celltypes" value="Macro,Fib,B lymph,NK,T lymph" /> | |
235 <param name="marker_name" value="Immune" /> | |
236 <param name="marker_list" value="immune.markers" /> | |
237 </repeat> | |
238 </conditional> | |
239 <output name="out_pdf" value="dendro.pdf" compare="sim_size" /> | |
240 <output name="out_tab"> | |
241 <assert_contents> | |
242 <has_text_matching expression="^\s+Neutro\s+Podo\s+Endo" /> | |
243 <has_text text="APOL1.GNA78M"/> | |
244 </assert_contents> | |
245 </output> | |
246 </test> | |
247 <test expect_num_outputs="2" > | |
248 <!-- Estimate Proportions: no disease factor, no fitting reports, only NNLS --> | |
249 <param name="bulk_eset" value="GSE50244bulkeset.subset.rds" /> | |
250 <param name="scrna_eset" value="EMTABesethealthy.subset.rds" /> | |
251 <conditional name="do" > | |
252 <param name="method" value="estimateprops" /> | |
253 <param name="est_methods" value="NNLS" /> | |
254 <param name="celltypes_label" value="cellType" /> | |
255 <param name="samples_label" value="sampleID" /> | |
256 <param name="disease_factor" value="no" /> | |
257 </conditional> | |
258 <output name="out_pdf" value="default_output_no_disease_nnls.pdf" compare="sim_size" /> | |
259 </test> | |
260 <test expect_num_outputs="2" > | |
261 <!-- Estimate Proportions: no disease factor, no fitting reports --> | |
262 <param name="bulk_eset" value="GSE50244bulkeset.subset.rds" /> | |
263 <param name="scrna_eset" value="EMTABesethealthy.subset.rds" /> | |
264 <conditional name="do" > | |
265 <param name="method" value="estimateprops" /> | |
266 <param name="celltypes_label" value="cellType" /> | |
267 <param name="samples_label" value="sampleID" /> | |
268 <param name="disease_factor" value="no" /> | |
269 </conditional> | |
270 <output name="out_pdf" value="default_output_no_disease.pdf" compare="sim_size" /> | |
271 </test> | |
272 <test expect_num_outputs="3" > | |
273 <!-- Estimate Proportions test --> | |
274 <param name="bulk_eset" value="GSE50244bulkeset.subset.rds" /> | |
275 <param name="scrna_eset" value="EMTABesethealthy.subset.rds" /> | |
276 <conditional name="do" > | |
277 <param name="method" value="estimateprops" /> | |
278 <param name="celltypes_label" value="cellType" /> | |
279 <param name="samples_label" value="sampleID" /> | |
280 <param name="celltypes" value="alpha,beta,delta,gamma,acinar,ductal" /> | |
281 <conditional name="disease_factor" > | |
282 <param name="use" value="yes" /> | |
283 <param name="phenotype_scrna_target" value="beta" /> | |
284 <param name="phenotype_factors" value="age,bmi,hba1c,gender" /> | |
285 <param name="phenotype_target" value="hba1c" /> | |
286 <param name="phenotype_target_threshold" value="6.5" /> | |
287 <param name="sample_disease_group" value="T2D" /> | |
288 <param name="sample_disease_group_scale" value="5" /> | |
289 </conditional> | |
290 </conditional> | |
291 <output name="out_pdf" value="default_output.pdf" compare="sim_size" /> | |
292 <output_collection name="summaries" count="5"> | |
293 <element name="Log of MuSiC fitting" ftype="txt"> | |
294 <assert_contents> | |
295 <has_text text="Residual standard error: 0.1704 on 72 degrees of freedom"/> | |
296 </assert_contents> | |
297 </element> | |
298 <element name="Log of NNLS fitting" ftype="txt"> | |
299 <assert_contents> | |
300 <has_text text="Residual standard error: 0.0645 on 72 degrees of freedom"/> | |
301 </assert_contents> | |
302 </element> | |
303 </output_collection> | |
304 </test> | |
305 </tests> | |
306 <help><![CDATA[ | |
307 MuSiC utilizes cell-type specific gene expression from single-cell RNA sequencing (RNA-seq) data to characterize cell type compositions from bulk RNA-seq data in complex tissues. By appropriate weighting of genes showing cross-subject and cross-cell consistency, MuSiC enables the transfer of cell type-specific gene expression information from one dataset to another. | |
308 | |
309 Solid tissues often contain closely related cell types which leads to collinearity. To deal with collinearity, MuSiC employs a tree-guided procedure that recursively zooms in on closely related cell types. Briefly, we first group similar cell types into the same cluster and estimate cluster proportions, then recursively repeat this procedure within each cluster. | |
310 | |
311 ]]></help> | |
312 <citations> | |
313 <citation type="doi">https://doi.org/10.1038/s41467-018-08023-x</citation> | |
314 </citations> | |
315 </tool> |