changeset 0:fddd754b8bcb draft default tip

"planemo upload for repository https://github.com/AstraZeneca-Omics/immport-galaxy-tools/tree/develop/flowtools/flowclr_sample_name commit 0d94c83066ae8396ffa2821a6cb751ed471e7bf5"
author azomics
date Thu, 23 Jul 2020 07:50:53 -0400
parents
children
files flowclr_sample_name.xml test-data/input1.flowclr test-data/input2.flowclr test-data/input3.flowclr test-data/output1.flowtext test-data/output2.flowtext
diffstat 6 files changed, 140 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flowclr_sample_name.xml	Thu Jul 23 07:50:53 2020 -0400
@@ -0,0 +1,102 @@
+<tool id="flclr_sample_name" name="Add sample information and merge" version="1.0+galaxy1" profile="18.01">
+  <description>a flow clustered or tabular text file collection.</description>
+  <requirements>
+     <requirement type="package" version="4.4">sed</requirement>
+  </requirements>
+  <stdio>
+    <exit_code range="1:" level="fatal" description="See stderr for more details." />
+  </stdio>
+  <command><![CDATA[
+    #set $first = $inputs[0]
+    head -n 1 '$first' | sed "s/\$/\t$header/" > '$output';
+
+    #if $sample_names
+    #set $identifiers = [ x.strip() for x in $sample_names.split(",") ]
+    #else
+    #set $identifiers = [ i.element_identifier for i in $inputs ]
+    #end if
+
+    #if len($identifiers) != len($inputs)
+    #  echo "Error, number of file identifiers/samples doesn't match the number of files.";
+    #  exit(1)
+    #end if
+
+    #for $i, $input in enumerate($inputs)
+      tail -n +2 '$input' | sed "s/\$/\t$identifiers[$i]/" >> '$output';
+    #end for#
+  ]]>
+  </command>
+  <inputs>
+    <param name="inputs" format="flowclr,tabular" type="data" multiple="true" min="2" label="Clustered flowtext or tabular file collection"/>
+    <param name="sample_names" type="text" label="Sample names" optional="true" help="Supply the sample names of each flowtext file in order of the flowtext files in the data collection, comma separated, to override the collection identifier. Please see below for more information on formatting."/>
+    <param name="header" type="text" value="Sample" optional="true" label="Column name for identifier" help="Sample by default, names the new column added with the identifier for each file."/>
+  </inputs>
+  <outputs>
+    <data format="flowtext" name="output" label="Merged output"/>
+  </outputs>
+  <tests>
+    <test>
+      <param name="inputs" value="input1.flowclr,input2.flowclr,input3.flowclr"/>
+      <output name="output" file="output1.flowtext"/>
+    </test>
+    <test>
+      <param name="inputs" value="input1.flowclr,input2.flowclr,input3.flowclr"/>
+      <param name="sample_names" value="S1,S2,S3"/>
+      <output name="output" file="output2.flowtext"/>
+    </test>
+  </tests>
+  <help><![CDATA[    
+Flowclr Sample Name
+-------------------
+
+This tool adds a column to a tabular file (including a flowtext or flowclustered file) with the sample information.
+
+**Input files**
+This tool requires a valid collection of tabular files such as flowtext files or clustered flowtext files. Files are processed serially.
+
+.. class:: warningmark
+
+By default the full file name will be used as sample name. Alternatively file names can be manually changed prior to running this tool.
+If inputing sample names manually, then you must supply a comma separated list of sample names in order of the files in the dataset collection.
+
+**Output file**
+The output is a single merged tabular file (e.g. flowtext file) containing rows for each input tabular file; with a column containing the sample information
+
+-----
+
+**Example**
+
+*File 1*::
+
+  FSC     SSC       Marker1   Marker2   Marker3   Marker4   Population
+  449     157       551       129       169       292       1
+  894     1023      199       277       320       227       3
+  262     73        437       69        0         146       6
+  340     115       509       268       0         74        1
+  ...     ...       ...       ...       ...       ...       ...
+
+*File 2*::
+
+  FSC	   SSC	   Marker1 Marker2 Marker3 Marker4 Population
+  523      354     554     176     213     185     2
+  678      8096    98      74      417     267     6
+  226      89      467     123     0       324     2
+  660      175     589     178     1       89      7
+  ...      ...     ...     ...     ...     ...     ...
+
+*Output*::
+
+  FSC      SSC     Marker1 Marker2 Marker3 Marker4 Population  Sample
+  449      157     551     129     169     292     1           sample1
+  894      1023    199     277     320     227     3           sample1
+  262      73      437     69      0       146     6           sample1
+  340      115     509     268     0       74      1           sample1
+  ...      ...     ...     ...     ...     ...     ...         ...
+  523      354     554     176     213     185     2           sample2
+  678      8096    98      74      417     267     6           sample2
+  226      89      467     123     0       324     2           sample2
+  660      175     589     178     1       89      7           sample2
+  ...      ...     ...     ...     ...     ...     ...         ...
+ ]]>
+  </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input1.flowclr	Thu Jul 23 07:50:53 2020 -0400
@@ -0,0 +1,5 @@
+FSC	SSC	CD4	CCR7	CD8	CCR3	Population
+289	56	438	0	626	480	3
+352	153	30	147	483	386	6
+383	190	156	228	734	408	7
+261	62	432	121	598	555	3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input2.flowclr	Thu Jul 23 07:50:53 2020 -0400
@@ -0,0 +1,4 @@
+FSC	SSC	CD4	CCR7	CD8	CCR3	Population
+289	56	438	0	626	480	3
+352	153	30	147	483	386	6
+261	62	432	121	598	555	3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input3.flowclr	Thu Jul 23 07:50:53 2020 -0400
@@ -0,0 +1,5 @@
+FSC	SSC	CD4	CCR7	CD8	CCR3	Population
+289	56	438	0	626	480	3
+352	153	30	147	483	386	6
+383	190	156	228	734	408	7
+261	62	432	121	598	555	3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output1.flowtext	Thu Jul 23 07:50:53 2020 -0400
@@ -0,0 +1,12 @@
+FSC	SSC	CD4	CCR7	CD8	CCR3	Population	Sample
+289	56	438	0	626	480	3	input1.flowclr
+352	153	30	147	483	386	6	input1.flowclr
+383	190	156	228	734	408	7	input1.flowclr
+261	62	432	121	598	555	3	input1.flowclr
+289	56	438	0	626	480	3	input2.flowclr
+352	153	30	147	483	386	6	input2.flowclr
+261	62	432	121	598	555	3	input2.flowclr
+289	56	438	0	626	480	3	input3.flowclr
+352	153	30	147	483	386	6	input3.flowclr
+383	190	156	228	734	408	7	input3.flowclr
+261	62	432	121	598	555	3	input3.flowclr
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/output2.flowtext	Thu Jul 23 07:50:53 2020 -0400
@@ -0,0 +1,12 @@
+FSC	SSC	CD4	CCR7	CD8	CCR3	Population	Sample
+289	56	438	0	626	480	3	S1
+352	153	30	147	483	386	6	S1
+383	190	156	228	734	408	7	S1
+261	62	432	121	598	555	3	S1
+289	56	438	0	626	480	3	S2
+352	153	30	147	483	386	6	S2
+261	62	432	121	598	555	3	S2
+289	56	438	0	626	480	3	S3
+352	153	30	147	483	386	6	S3
+383	190	156	228	734	408	7	S3
+261	62	432	121	598	555	3	S3