view flow-compensate.xml @ 1:ffc083c86d44 draft default tip

"planemo upload for repository https://github.com/AstraZeneca-Omics/immport-galaxy-tools/tree/master/flowtools/flow_compensate commit fd7533e2c5c6c078bd2734c1ded95db9b74e450e"
author azomics
date Wed, 23 Jun 2021 21:56:39 +0000
parents ca7ba337b727
children
line wrap: on
line source

<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 &> '$log_file'
      ]]></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>
      <data name="log_file" format="txt" label="Log for compensation by ${tool.name} on ${on_string}"/> 
    </outputs>
    <help><![CDATA[
        TODO: Fill in help.
    ]]></help>
</tool>