changeset 1:6595c17673cb draft

planemo upload for repository https://github.com/bilille/galaxy-mixomics-blocksplsda commit 7ed137ea956b8074c34d43a5e1d46b39ddef1482-dirty
author ppericard
date Wed, 12 Jun 2019 11:22:33 -0400
parents bea08702ed51
children 655d1fbcd3e6
files mixomics_blocksplsda.xml mixomics_blocksplsda_script.R mixomics_plotvar.xml mixomics_plotvar_script.R
diffstat 4 files changed, 32 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mixomics_blocksplsda.xml	Fri May 17 05:00:22 2019 -0400
+++ b/mixomics_blocksplsda.xml	Wed Jun 12 11:22:33 2019 -0400
@@ -1,4 +1,4 @@
-<tool id="mixomics_blocksplsda" name="mixOmics block.splsda" version="0.1.0" profile="16.04" workflow_compatible="true">
+<tool id="mixomics_blocksplsda" name="mixOmics block.splsda" version="0.2.0" profile="16.04" workflow_compatible="true">
 
     <description>performs N-integration and feature selection with Projection to Latent Structures models (PLS) with sparse Discriminant Analysis</description>
     
@@ -79,9 +79,9 @@
     </inputs>
 
     <outputs>
-        <data name="rdata_out" format="rdata" label="${tool.id}_output.rdata" />
-        <data name="sample_metadata_out" format="tabular" label="${tool.id}_${sample_metadata_in.name}" />
-        <collection name="blocks_output" type="list" label="${tool.id}_blocks_output">
+        <data name="rdata_out" format="rdata" label="${tool.name}_output.rdata" />
+        <data name="sample_metadata_out" format="tabular" label="${tool.name}_${sample_metadata_in.name}" />
+        <collection name="blocks_output" type="list" label="${tool.name}_blocks_output">
             <discover_datasets pattern="(?P&lt;designation&gt;.+)\.tsv" directory="outdir" format="tabular" />
         </collection>
     </outputs>
@@ -148,6 +148,16 @@
 Variables metadata files are optional.
 If a file is provided, output metadata will be appended to the input file, otherwise a new output file will be created.
 
+1. Data matrix format
+    * Rows = variables, Columns = samples
+    * First row = samples name. MUST be the same and in the same order in every block as well as in the sample metadata file (transposed)
+    * First column = variables name
+
+2. Variables metadata format
+    * Rows = variables, Columns = metadata
+    * First row = metadata column names
+    * First column = variables names. MUST be the same and in the same order than in the associated data matrix
+
 Global input files:
 ===================
 
@@ -160,6 +170,11 @@
 By default, the last column of the samples metadata matrix will be used as samples description factors.
 If it's not the case, the column number can be inputed in the `Sample description column number` parameter.
 
+1. Samples metadata format
+    * Rows = samples, Columns = metadata
+    * First row = metadata column names
+    * First column = sample names. These names must be identical (transposed) and in the same order than for the blocks data matrices
+
 ----------
 Parameters
 ----------
--- a/mixomics_blocksplsda_script.R	Fri May 17 05:00:22 2019 -0400
+++ b/mixomics_blocksplsda_script.R	Wed Jun 12 11:22:33 2019 -0400
@@ -164,17 +164,17 @@
 # print("Block.splsda variates:")
 # print(mixomics_result$variates)
 
-for(bname in names(mixomics_result$variates))
+for(block_name in names(mixomics_result$variates))
 {
-    # print(bname)
-    # print(mixomics_result$variates[[bname]])
+    # print(block_name)
+    # print(mixomics_result$variates[[block_name]])
 
     # Format the column names to add the block name and replace spaces
-    colnames(mixomics_result$variates[[bname]]) <- paste("block.splsda", bname, gsub(" ", "_", colnames(mixomics_result$variates[[bname]])), sep = "_")
-    # print(mixomics_result$variates[[bname]])
+    colnames(mixomics_result$variates[[block_name]]) <- paste("block.splsda_variates", block_name, gsub(" ", "_", colnames(mixomics_result$variates[[block_name]])), sep = "_")
+    # print(mixomics_result$variates[[block_name]])
 
     # Append the new columns to the sample metadata matrix
-    sample_metadata <- cbind2(sample_metadata, mixomics_result$variates[[bname]])
+    sample_metadata <- cbind2(sample_metadata, mixomics_result$variates[[block_name]])
 }
 
 # print(sample_metadata)
@@ -196,6 +196,9 @@
     meta_variable <- mixomics_result$loadings[[block_name]]
     # print(head(meta_variable))
 
+    # Format the column names to add the block name and replace spaces
+    colnames(meta_variable) <- paste("block.splsda_loadings", gsub(" ", "_", colnames(meta_variable)), sep = "_")
+
     # Read input block variable metadata files if provided (optional)
     if(block_meta_var != "None")
     {
--- a/mixomics_plotvar.xml	Fri May 17 05:00:22 2019 -0400
+++ b/mixomics_plotvar.xml	Wed Jun 12 11:22:33 2019 -0400
@@ -26,7 +26,7 @@
         <param name="input_rdata" type="data" format="rdata" label="Input RData file from (sparse)(I)PCA, (regularized)CCA, (sparse)PLS(DA) or (sparse)(R)GCCA(DA)"/>
         <section name="adv" title="Advanced Options" expanded="false">
             <param name="legend" type="boolean" checked="true" truevalue="--legend" falsevalue="" label="Plot legend"/>
-            <param name="cutoff" type="float" value="0.85" min="0" max="1" label="Cut-off" />
+            <param name="cutoff" type="float" value="0" min="0" max="1" label="Cut-off" />
         </section>
     </inputs>
 
--- a/mixomics_plotvar_script.R	Fri May 17 05:00:22 2019 -0400
+++ b/mixomics_plotvar_script.R	Wed Jun 12 11:22:33 2019 -0400
@@ -36,9 +36,9 @@
 
 pdf(args$output_pdf)
 
-plotVar(mixomics_result,
-        legend = args$legend,
-        cutoff = args$cutoff)
+# plotVar(mixomics_result,
+#         legend = args$legend,
+#         cutoff = args$cutoff)
 
 for(k in 1:(length(mixomics_result$names[[3]])-1))
 {