diff concatenate_table.xml @ 0:6364be33b0c2 draft

"planemo upload for repository https://github.com/mesocentre-clermont-auvergne/aubi_piaf commit 48a10de1b21f94ab8019d9d0e4a43e0bd9d0c31e-dirty"
author agpetit
date Wed, 25 May 2022 09:00:24 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/concatenate_table.xml	Wed May 25 09:00:24 2022 +0000
@@ -0,0 +1,71 @@
+<tool id="concatenate_table" name="concatenate lines of multi tables" version="1.0.0" python_template_version="3.5" profile="@GALAXY_VERSION@">
+    <macros>
+        <token name="@GALAXY_VERSION@">21.05</token>
+    </macros>
+    <requirements>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+        #set $inter_file = "test.tabular"
+        #for $i, $input in enumerate($input_traj)
+            #if $i == 0
+                cat ${input} | awk -F'\t' 'BEGIN{mean="Time (ps)"; std=""} /^Time/ {for (i=2; i<(NF+1); i++) gsub(" ", ",mean ",\$i) ;
+                  for (i=2; i<(NF+1); i++) mean=mean "\t" \$i ;  for (i=2; i<(NF+1); i++) gsub(",mean", ",std ",\$i);
+                  for (i=2; i<(NF+1); i++) std=std "\t" \$i } END{print (mean std)}'  &>> '$sort_file' ;
+            #end if
+            #set $f=open(str($input), 'r')
+            #set $default_min = [x.rstrip().split()[0] for x in $f.readlines()][-1]
+            #set $default_min = float($default_min) * 10
+            cat ${input} | awk -F'\t' -v min=${default_min} 'BEGIN{min_val=min ;
+                max_val=0 ; means=""; std=""} /^[0-9]/ {if ($1 <= min_val) {min_val=$1} ;
+                if ($1 >= max_val) {max_val=$1}} ; /Mean/ {for (i=2; i<NF; i++) means=means"\t"\$i ;means=means"\t"\$NF } ;
+                /Std/ {for (i=2; i<NF; i++) std=std"\t"\$i; ;std=std"\t"\$NF} END {print (min_val "-" max_val means std)}' &>> '$inter_file' ;
+        #end for
+        cat '$inter_file' | sort -k1 -n &>> '$sort_file'
+    ]]></command>
+    <inputs>
+        <param name="input_traj" type="data_collection" format="tabular" collection_type="list" label="Collection of tables containing the pore diameter of an aquaporin for a subtrajectory"/>
+    </inputs>
+    <outputs>
+        <data name="sort_file" format="tabular" label="table_sort_pore_diameter_aqp.tabular"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input_traj">
+                <collection type="list">
+                    <element name="test_file1" value="PIP2.1_test_traj_1.tabular"/>
+                    <element name="test_file2" value="PIP2.1_test_traj_2.tabular"/>
+                    <element name="test_file3" value="PIP2.1_test_traj_3.tabular"/>
+                </collection>
+            </param>
+            <output name="sort_file" file="table_sort_pore_diameter_aqp.tabular"/>
+        </test>
+    </tests>
+    <help><![CDATA[
+
+.. class:: infomark
+
+**What it does**
+
+This tool allows to estimate the number of sub-trajectories to be created. It also allows to cut a path according to a desired number of sub-trajectories.
+
+_____
+
+.. class:: infomark
+
+**Inputs**
+
+    - Collection of tables that contain the calculation of the pore diameter of an aquaporin for each subtrajectory
+
+_____
+
+.. class:: infomark
+
+**Outputs**
+
+    - Table containing the average distance and standard deviation of each subpath for a complete trajectory
+
+    ]]></help>
+    <citations>
+        <citation type="doi">10.1016/j.softx.2015.06.001</citation>
+    </citations>
+</tool>