comparison music_compare.xml @ 0:10bf0f89035f 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:53:49 +0000
parents
children 4447ed460308
comparison
equal deleted inserted replaced
-1:000000000000 0:10bf0f89035f
1 <tool id="music_compare" name="MuSiC Compare" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"
2 profile="21.09" license="GPL-3.0-or-later" >
3 <description>estimate and compare cell type proportions in multiple sets of bulk RNA-seq data</description>
4 <macros>
5 <import>macros.xml</import>
6 <macro name="test_input">
7 <repeat name="scrna_groups">
8 <param name="name" value="One" />
9 <param name="scrna_eset" value="Mousesubeset.degenesonly2.half.rds" />
10 <repeat name="bulk_groups" >
11 <param name="name" value="Two" />
12 <param name="bulk_eset" value="Mousebulkeset.rds" />
13 <param name="factor_group" value="Control" />
14 </repeat>
15 <repeat name="bulk_groups" >
16 <param name="name" value="Three" />
17 <param name="bulk_eset" value="Mousebulkeset.rds" />
18 <param name="factor_group" value="Pheno1" />
19 </repeat>
20 </repeat>
21 <repeat name="scrna_groups">
22 <param name="name" value="A" />
23 <param name="scrna_eset" value="Mousesubeset.degenesonly2.half.rds" />
24 <repeat name="bulk_groups" >
25 <param name="name" value="B" />
26 <param name="bulk_eset" value="Mousebulkeset.rds" />
27 <param name="factor_group" value="Control" />
28 </repeat>
29 </repeat>
30 </macro>
31 </macros>
32 <expand macro="requirements" />
33 <command detect_errors="exit_code" ><![CDATA[
34 mkdir report_data &&
35 Rscript --vanilla '$__tool_directory__/scripts/compare.R' '$conf'
36 ]]></command>
37 <configfiles>
38 <configfile name="conf" >
39 null_str_vec = function(gstr){
40 tokens = unlist(as.vector(strsplit(gstr, split=",")))
41 if (length(tokens) == 0){
42 return(NULL)
43 }
44 if (length(tokens) == 1){
45 return(tokens[[1]])
46 }
47 return(tokens)
48 }
49
50 files = list(
51 #for $s, $scgroup in enumerate($scrna_groups):
52 '$scgroup.name' = list(
53 dataset = '$scgroup.scrna_eset',
54 label_cell = null_str_vec('$scgroup.adv.celltypes_label'),
55 label_sample = null_str_vec('$scgroup.adv.samples_label'),
56 celltype = null_str_vec('$scgroup.adv.celltypes'),
57 bulk = list(
58 #for $b, $bulkgroup in enumerate($scgroup.bulk_groups):
59 '$bulkgroup.name' = list(
60 dataset = null_str_vec('$bulkgroup.bulk_eset'),
61 factor_group = null_str_vec('$bulkgroup.factor_group'),
62 pheno_facts = null_str_vec('$bulkgroup.adv.phenotype_factors'),
63 pheno_excl = null_str_vec('$bulkgroup.adv.phenotype_factors_always_exclude')
64 #if $b &lt; len($scgroup.bulk_groups) - 1:
65 ),
66 #else
67 )
68 #end if
69 #end for
70 #if $s &lt; len($scrna_groups) - 1:
71 )
72 ),
73 #else
74 )
75 )
76 #end if
77 #end for
78 )
79
80 heat_grouped_p = as.logical('$heat_grouped_p')
81 out_filt = list(cells = null_str_vec('$filter.out_list_cells'),
82 facts = null_str_vec('$filter.out_list_facts'))
83 est_method = null_str_vec('$est_method')
84
85 out_heatmulti_pdf = '$out_heatmulti_pdf'
86 out_heatsumm_pdf = '$out_heatsumm_pdf'
87 </configfile>
88 </configfiles>
89 <inputs>
90 <!-- Define single cell groups for sets of bulk datasets -->
91 <repeat name="scrna_groups" title="New scRNA Group" min="1"
92 help="Cell type proportion comparisons are performed between bulk datasets
93 in each scRNA group. A second summary is performed comparing all cell
94 type proportions across all groups." >
95 <!-- Single Cell Options -->
96 <param name="name" label="Name of scRNA Dataset" type="text" value="" />
97 <param name="scrna_eset" label="scRNA Dataset" type="data" format="@RDATATYPE@" />
98 <section name="adv" title="Advanced scRNA Parameters" >
99 <param name="celltypes_label" type="text" value="cellType"
100 label="Cell Types Label from scRNA dataset" >
101 <expand macro="validator_text" />
102 </param>
103 <param name="samples_label" type="text" value="sampleID"
104 label="Samples Identifier from scRNA dataset" >
105 <expand macro="validator_text" />
106 </param>
107 <expand macro="celltypes_macro" />
108 </section>
109 <repeat name="bulk_groups" title="Bulk Datasets in scRNA Group" min="1"
110 help="Choose bulk RNA datasets" >
111 <!-- Bulk Options -->
112 <param name="name" label="Name of Bulk Dataset" type="text" value="" />
113 <param name="bulk_eset" label="Bulk RNA Dataset" type="data" format="@RDATATYPE@" />
114 <param name="factor_group" type="text" label="Factor Name" optional="false"
115 help="Name of column in phenotype data containing factor values. If column does not exist, it is a new factor that is applied to all samples in the dataset. Plots will be coloured by these factors." />
116 <section name="adv" title="Advanced Bulk Parameters" >
117 <param name="phenotype_factors" type="text"
118 label="Phenotype factors"
119 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." >
120 <expand macro="validator_index_identifiers" />
121 </param>
122 <param name="phenotype_factors_always_exclude" type="text"
123 label="Excluded phenotype factors"
124 help="List of phenotype factors to always exclude in the analysis"
125 value="sampleID,SubjectName" >
126 <expand macro="validator_index_identifiers" />
127 </param>
128 </section>
129 </repeat>
130 </repeat>
131 <param name="est_method" type="select" label="Method to use" help="One to compare across all" >
132 <option value="MuSiC" selected="true" >MuSiC</option>
133 <option value="NNLS" selected="true" >NNLS</option>
134 </param>
135 <param name="heat_grouped_p" type="boolean" label="Individual heatmaps grouped by scRNA dataset?" checked="true" />
136 <section name="filter" title="Filter Summary Plots" >
137 <param name="out_list_cells" type="text" label="Show only these cell types (blank for all)"
138 help="Comma-delimited list. Cell types given in the above scRNA datasets are still used for deconvolution (bulk reads are still assigned to discrete cell types), but we merely select the ones we want to show." />
139 <param name="out_list_facts" type="text" label="Show only these factors (blank for all)"
140 help="Comma-delimited list. Factors must exist in those inferred from the above bulk datasets." />
141 </section>
142 </inputs>
143 <outputs>
144 <data name="out_heatmulti_pdf" format="pdf" label="${tool.name} on ${on_string}: Individual Heatmaps (${est_method})" />
145 <data name="out_heatsumm_pdf" format="pdf" label="${tool.name} on ${on_string}: Summarized Plots (${est_method})" />
146 <collection name="dtables" type="list" label="${tool.name} on ${on_string}: Tables (${est_method})" >
147 <discover_datasets pattern="values_(?P&lt;designation&gt;.+)\.tabular" format="tabular" directory="report_data" />
148 </collection>
149 <collection name="stats" type="list" label="${tool.name} on ${on_string}: Stats (${est_method})" >
150 <discover_datasets pattern="stats_(?P&lt;designation&gt;.+)\.tabular" format="tabular" directory="report_data" />
151 </collection>
152 </outputs>
153 <tests>
154 <test expect_num_outputs="4" >
155 <!-- NNLS Test with severe output filtering -->
156 <expand macro="test_input" />
157 <param name="est_method" value="NNLS" />
158 <param name="heat_grouped_p" value="true" />
159 <section name="filter" >
160 <param name="out_list_cells" value="PT,Podo,Fib,Endo" />
161 <param name="out_list_facts" value="APOL1,Pheno1" />
162 </section>
163 <output name="out_heatsumm_pdf" value="out_filt1.pdf" compare="sim_size" />
164 </test>
165 <test expect_num_outputs="4" >
166 <!-- NNLS Test with only factor filtering -->
167 <expand macro="test_input" />
168 <param name="est_method" value="NNLS" />
169 <param name="heat_grouped_p" value="true" />
170 <section name="filter" >
171 <param name="out_list_facts" value="APOL1,Pheno1" />
172 </section>
173 <output name="out_heatmulti_pdf" value="out_heat2.pdf" compare="sim_size" />
174 </test>
175 <test expect_num_outputs="4" >
176 <!-- MuSiC Test with no filtering -->
177 <expand macro="test_input" />
178 <param name="est_method" value="MuSiC" />
179 <param name="heat_grouped_p" value="true" />
180 <output_collection name="dtables" count="3">
181 <element name="Data Table" ftype="tabular" >
182 <assert_contents>
183 <has_text_matching expression="B\:\:APOL1\.G1NF42\s+PT\s+B\s+APOL1\s+0.56\d+\s+19035\d+" />
184 </assert_contents>
185 </element>
186 </output_collection>
187 <output_collection name="stats" count="6">
188 <element name="Three: Read Props" ftype="tabular" >
189 <assert_contents>
190 <has_text_matching expression="T lymph(\s+0)+" />
191 </assert_contents>
192 </element>
193 </output_collection>
194 </test>
195 </tests>
196 <help><![CDATA[
197 MuSiC Compare produces boxplots and heatmaps of cell type proportions within bulk RNA datasets, learned from single-cell RNA datasets.
198
199 To discover the proportion of single-cell cell types within a bulk RNA dataset, create a scRNA group for each scRNA dataset, and the bulk datasets that you wish to discover the types in.
200
201 Phenotype factors can also be specified, either for the entire dataset or for specific samples within a dataset given by a phenotype data column identifier.
202
203 The resulting plots will combine all the bulk datasets and their learned cell type proportions into several summarizing plots.
204 ]]></help>
205 <citations>
206 <citation type="doi">https://doi.org/10.1038/s41467-018-08023-x</citation>
207 </citations>
208 </tool>