diff music-deconvolution.xml @ 3:064056f47ff2 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/music/ commit 20f8561478535013e111d982b99639f48f1bea79"
author bgruening
date Sat, 29 Jan 2022 12:49:59 +0000
parents 1eb4f2f83579
children
line wrap: on
line diff
--- a/music-deconvolution.xml	Tue Nov 30 13:05:47 2021 +0000
+++ b/music-deconvolution.xml	Sat Jan 29 12:49:59 2022 +0000
@@ -1,5 +1,5 @@
 <tool id="music_deconvolution" name="MuSiC" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"
-      profile="20.09" license="GPL-3.0-or-later" >
+      profile="21.09" license="GPL-3.0-or-later" >
     <description>estimate cell type proportions in bulk RNA-seq data</description>
     <macros>
         <import>macros.xml</import>
@@ -25,20 +25,27 @@
 
 bulk_eset = readRDS('$bulk_eset')
 scrna_eset = readRDS('$scrna_eset')
+use_disease_factor = FALSE
+maxyscale = NA
 
 #if str($do.method) == "estimateprops":
 
+maxyscale = as.numeric('$do.maxyscale')  ## yields "NA" if blank
 phenotype_factors = null_str_vec('$do.phenotype_factors')
 phenotype_factors_always_exclude = null_str_vec('$do.phenotype_factors_always_exclude')
 celltypes_label = null_str_vec('$do.celltypes_label')
 samples_label = null_str_vec('$do.samples_label')
 celltypes = null_str_vec('$do.celltypes')
 methods = c("MuSiC", "NNLS")
-phenotype_target = null_str_vec('$do.phenotype_target')
-phenotype_target_threshold = as.numeric('$do.phenotype_target_threshold')
-sample_disease_group = null_str_vec('$do.sample_disease_group')
-sample_disease_group_scale = as.integer('$do.sample_disease_group_scale')
-compare_title = null_str_vec('$do.compare_title')
+
+    #if str($do.disease_factor.use) == "yes":
+use_disease_factor = TRUE
+phenotype_scrna_target = null_str_vec('$do.disease_factor.phenotype_scrna_target')
+phenotype_target = null_str_vec('$do.disease_factor.phenotype_target')
+phenotype_target_threshold = as.numeric('$do.disease_factor.phenotype_target_threshold')
+sample_disease_group = null_str_vec('$do.disease_factor.sample_disease_group')
+sample_disease_group_scale = as.integer('$do.disease_factor.sample_disease_group_scale')
+    #end if
 
 outfile_pdf='$out_pdf'
 
@@ -54,11 +61,11 @@
         #if $i == 0:
         $repeat.cluster_id = list(cell.types = null_str_vec('$repeat.celltypes'),
             marker.names = null_str_vec('$repeat.marker_name'),
-                     marker.list = read_list('$repeat.marker_list'))
+            marker.list = read_list('$repeat.marker_list'))
         #else
         , $repeat.cluster_id = list(cell.types = null_str_vec('$repeat.celltypes'),
-                     marker.names = null_str_vec('$repeat.marker_name'),
-                     marker.list = read_list('$repeat.marker_list'))
+            marker.names = null_str_vec('$repeat.marker_name'),
+            marker.list = read_list('$repeat.marker_list'))
         #end if
     #end for
 )
@@ -73,8 +80,8 @@
         </configfile>
     </configfiles>
     <inputs>
-        <param name="scrna_eset" label="scRNA Dataset" type="data" format="rdata.eset" />
-        <param name="bulk_eset" label="Bulk RNA Dataset" type="data" format="rdata.eset" />
+        <param name="scrna_eset" label="scRNA Dataset" type="data" format="@RDATATYPE@" />
+        <param name="bulk_eset" label="Bulk RNA Dataset" type="data" format="@RDATATYPE@" />
         <conditional name="do" >
             <param name="method" type="select" label="Purpose" >
                 <!-- The values here correspond to script names in the scripts folder
@@ -103,24 +110,36 @@
                        value="sampleID,SubjectName" >
                     <expand macro="validator_index_identifiers" />
                 </param>
-                <param name="phenotype_target" type="text" label="Phenotype Target"
-                       help="MUST exist in the bulk RNA datasets phenotype factors, as above." >
-                    <expand macro="validator_text" />
-                </param>
-                <param name="phenotype_target_threshold" type="float" label="Phenotype Target Threshold"
-                       value="-99"
-                       help="The (%) threshold at which the phenotype target manifests. Leave at -99 to select all." >
-                </param>
-                <param name="sample_disease_group" type="text" label="Sample Disease Group"
-                       help="MUST exist in the sample_groups above." >
-                    <expand macro="validator_text" />
-                </param>
-                <param name="sample_disease_group_scale" type="integer"
-                       label="Sample Disease Group (Scale)" value="5"
-                       help="Used to accentutate certain features in the plots. Increase this number to reduce the effect." />
-                <param name="compare_title" type="text" label="Plot Title" >
-                    <expand macro="validator_text" />
-                </param>
+                <conditional name="disease_factor" >
+                    <param name="use" type="select" label="Show proportions of a disease factor?" >
+                        <option value="no" selected="true" >No</option>
+                        <option value="yes" >Yes</option>
+                    </param>
+                    <when value="no" ></when>
+                    <when value="yes" >
+                        <param name="phenotype_scrna_target" type="text" label="scRNA Phenotype Cell Target"
+                               help="The name of a target scRNA cell type to select in the phenotype comparison." >
+                            <expand macro="validator_text" />
+                        </param>
+                        <param name="phenotype_target" type="text" label="Bulk Phenotype Target"
+                               help="MUST exist in the bulk RNA datasets phenotype factors as above." >
+                            <expand macro="validator_text" />
+                        </param>
+                        <param name="phenotype_target_threshold" type="float" label="Bulk Phenotype Target Threshold"
+                               value="-99"
+                               help="The (%) threshold at which the phenotype target manifests. Leave at -99 to select all." >
+                        </param>
+                        <param name="sample_disease_group" type="text" label="scRNA Sample Disease Group"
+                               help="Name for target disease group, ideally a value from the scRNA phenotype factor data" >
+                            <expand macro="validator_text" />
+                        </param>
+                        <param name="sample_disease_group_scale" type="integer"
+                               label="scRNA Sample Disease Group (Scale)" value="5"
+                               help="Used to accentutate certain features in the plots. Increase this number to reduce the effect." />
+                    </when>
+                </conditional>
+                <param name="maxyscale" type="float" min="0" value="" optional="true"
+                       label="Scale all Y-axes to max limit" help="Leave blank to autoscale each plot."/>
             </when>
             <when value="dendrogram" >
                 <param name="celltypes_label" type="text" value="cellType"
@@ -156,14 +175,14 @@
     <outputs>
         <data name="out_pdf" format="pdf" label="${tool.name} on ${on_string}: PDF Plots" />
         <data name="out_tab" format="tabular" label="${tool.name} on ${on_string}: Cell Proportions by Sample" >
-            <filter>do["method"] == "dendrogram" and len(do["cluster_groups"]) > 0</filter>
+            <filter>do["method"] == "dendrogram" and len(do["cluster_groups"]) >0</filter>
         </data>
         <collection name="props" type="list" label="${tool.name} on ${on_string}: Proportion Matrices" >
             <filter>do["method"] == "estimateprops"</filter>
             <discover_datasets pattern="prop_(?P&lt;designation&gt;.+)\.tabular" format="tabular" directory="report_data" />
         </collection>
         <collection name="summaries" type="list" label="${tool.name} on ${on_string}: Summaries and Logs">
-            <filter>do["method"] == "estimateprops"</filter>
+            <filter>do["method"] == "estimateprops" and do["disease_factor"]["use"] == "yes"</filter>
             <discover_datasets pattern="summ_(?P&lt;designation&gt;.+)\.txt" format="txt" directory="report_data" />
             <discover_datasets pattern="varprop_(?P&lt;designation&gt;.+)\.tabular" format="tabular" directory="report_data" />
             <discover_datasets pattern="rsquared_(?P&lt;designation&gt;.+)\.tabular" format="tabular" directory="report_data" />
@@ -221,6 +240,18 @@
                 </assert_contents>
             </output>
         </test>
+        <test expect_num_outputs="2" >
+            <!-- Estimate Proportions: no disease factor, no fitting reports -->
+            <param name="bulk_eset" value="GSE50244bulkeset.subset.rds" />
+            <param name="scrna_eset" value="EMTABesethealthy.subset.rds" />
+            <conditional name="do" >
+                <param name="method" value="estimateprops" />
+                <param name="celltypes_label" value="cellType" />
+                <param name="samples_label" value="sampleID" />
+                <param name="disease_factor" value="no" />
+            </conditional>
+            <output name="out_pdf" value="default_output_no_disease.pdf" compare="sim_size" />
+        </test>
         <test expect_num_outputs="3" >
             <!-- Estimate Proportions test -->
             <param name="bulk_eset" value="GSE50244bulkeset.subset.rds" />
@@ -230,12 +261,15 @@
                 <param name="celltypes_label" value="cellType" />
                 <param name="samples_label" value="sampleID" />
                 <param name="celltypes" value="alpha,beta,delta,gamma,acinar,ductal" />
-                <param name="phenotype_factors" value="age,bmi,hba1c,gender" />
-                <param name="phenotype_target" value="hba1c" />
-                <param name="phenotype_target_threshold" value="6.5" />
-                <param name="sample_disease_group" value="T2D" />
-                <param name="sample_disease_group_scale" value="5" />
-                <param name="compare_title" value="HbA1c vs Beta Cell Type Proportion" />
+                <conditional name="disease_factor" >
+                    <param name="use" value="yes" />
+                    <param name="phenotype_scrna_target" value="beta" />
+                    <param name="phenotype_factors" value="age,bmi,hba1c,gender" />
+                    <param name="phenotype_target" value="hba1c" />
+                    <param name="phenotype_target_threshold" value="6.5" />
+                    <param name="sample_disease_group" value="T2D" />
+                    <param name="sample_disease_group_scale" value="5" />
+                </conditional>
             </conditional>
             <output name="out_pdf" value="default_output.pdf" compare="sim_size" />
             <output_collection name="summaries" count="5">
@@ -257,10 +291,8 @@
 
 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.
 
-.. image:: $PATH_TO_IMAGES/FigureMethod.jpg
-
     ]]></help>
     <citations>
         <citation type="doi">https://doi.org/10.1038/s41467-018-08023-x</citation>
     </citations>
-</tool>
+</tool>
\ No newline at end of file