diff flow-compensate.xml @ 0:ca7ba337b727 draft

"planemo upload for repository https://github.com/AstraZeneca-Omics/immport-galaxy-tools/tree/master/flowtools/flow_compensate commit 386fcc6286d3e2d2769ac9856a653b04d5c6b0ad"
author azomics
date Tue, 25 May 2021 00:07:44 +0000
parents
children ffc083c86d44
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flow-compensate.xml	Tue May 25 00:07:44 2021 +0000
@@ -0,0 +1,54 @@
+<tool id="flow-compensate" name="Flow compensate" version="0.1.0+galaxy0" profile="19.01" python_template_version="3.5">
+    <description>
+        compensates a set of FCS objects through a compensation matrix
+    </description>
+    <requirements>
+      <requirement type="package" version="2.2.0">bioconductor-flowcore</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+        mkdir -p input_dir;
+        #for $fcs in $fcs_list:
+          ln -s '$fcs' input_dir/'$fcs.element_identifier';
+        #end for 
+        mkdir -p output_dir;
+        Rscript '$compensate_script' '$compensation_matrix' input_dir output_dir
+      ]]></command>
+    <configfiles>
+      <configfile name="compensate_script"><![CDATA[
+library(flowCore)
+
+args <- commandArgs( TRUE )
+
+if ( length( args ) != 3 ) {
+    cat( "ERROR: no arguments with directory, matrix file for compensation and out_dir",
+        file = stderr() )
+    stop()
+}
+
+comp_matrix <- read.table(file=args[[ 1 ]], sep="\t", header=TRUE, check.names = FALSE)
+comp_matrix<-as.matrix(comp_matrix[,-1])
+## Square matrix, reuse colnames into rownames
+rownames(comp_matrix)<-colnames(comp_matrix)
+fcs_dir <- args[[ 2 ]]
+
+samp<-read.flowSet(files=list.files(path=fcs_dir, pattern=".*.fcs\$"), path=fcs_dir)
+
+samp<-compensate(samp, comp_matrix)
+
+write.flowSet(samp, outdir=args[[ 3 ]])
+
+	      ]]></configfile>
+    </configfiles>
+    <inputs>
+        <param type="data" name="fcs_list" format="fcs" multiple="true" label="FCS files" help="FCS files to compensate using the provided matrix"/>
+        <param type="data" name="compensation_matrix" format="tabular" label="Matrix to use for compensation" />
+    </inputs>
+    <outputs>
+      <collection name="compensated_fcs" format="fcs" label="${tool.name} compensated FCS files on ${on_string}" type="list">
+        <discover_datasets pattern="__designation_and_ext__" directory="output_dir" visible="true" />
+      </collection>
+    </outputs>
+    <help><![CDATA[
+        TODO: Fill in help.
+    ]]></help>
+</tool>