changeset 66:3b1dbe3fb91b draft

planemo upload for repository https://github.com/CHESSComputing/ChessAnalysisPipeline commit 922ced93dce7a89190712f1ad9abad569fe52683
author ximgchess
date Mon, 24 Apr 2023 16:39:59 +0000
parents 3af7a69bd3d6
children f751fb2b1985
files pip_install.sh saxswaxs/pipeline.yaml saxswaxs/reduce.xml tomo/pipeline_combine.yaml tomo/pipeline_find_center.yaml tomo/pipeline_reconstruct.yaml tomo/tomo_combine.xml tomo/tomo_find_center.xml tomo/tomo_macros.xml tomo/tomo_reconstruct.xml
diffstat 10 files changed, 300 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pip_install.sh	Mon Apr 24 16:39:59 2023 +0000
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+if [[ $# -ne 1 ]]; then
+  echo "$0 requires the package as its only command line argument"
+  exit
+fi
+
+VERSION=`python --version | awk '{split($2,a,"."); printf "%s.%s", a[1], a[2]}'`
+PIPLOC=`which python | sed 's/bin\/python//g'`
+PIPLOC=$PIPLOC/lib/python$VERSION/site-packages
+
+echo "Try installing $1 to $PIPLOC"
+#pip install --target $PIPLOC $1
--- a/saxswaxs/pipeline.yaml	Thu Apr 13 13:54:53 2023 +0000
+++ b/saxswaxs/pipeline.yaml	Mon Apr 24 16:39:59 2023 +0000
@@ -2,9 +2,9 @@
 
   # Download example data
   - common.URLReader:
-      url: https://gitlab01.classe.cornell.edu/api/v4/projects/308/repository/files/saxswaxs%2fdata.tar/raw?ref=main
+      url: https://gitlab01.classe.cornell.edu/api/v4/projects/308/repository/files/saxswaxs%2frawdata_test_1d.tar/raw?ref=main
       headers:
-        PRIVATE-TOKEN: GITLABTOKEN
+        PRIVATE-TOKEN: # your token here
   - common.URLResponseProcessor
   - common.ExtractArchiveWriter:
       filename: .
--- a/saxswaxs/reduce.xml	Thu Apr 13 13:54:53 2023 +0000
+++ b/saxswaxs/reduce.xml	Mon Apr 24 16:39:59 2023 +0000
@@ -1,20 +1,17 @@
 <tool id="CHAP_saxswaxs_reduce" name="SAXSWAXS Reduce Map" version="0.1.0+galaxy0" python_template_version="3.5" profile="21.05">
     <requirements>
-      <requirement type="package" version="0.0.5">chessanalysispipeline</requirement>
+      <requirement type="package" version="0.0.3">chessanalysispipeline</requirement>
       <requirement type="package" version="2.28.1">requests</requirement>
       <requirement type="package" version="2023.3.0">pyfai</requirement>
       <requirement type="package" version="1.10.7">pydantic</requirement>
-      <requirement type="package" version="1.0.1">nexusformat</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
         pip --exists-action i install certif-pyspec==1.5.3 &&
         cp '$mapconfig' map.yaml &&
 	cp '$integrationconfig' integration.yaml &&
-	sed 's/GITLABTOKEN/$token/' '$__tool_directory__/pipeline.yaml' > pipeline.yaml &&
-	CHAP --config pipeline.yaml
+	CHAP --config '$__tool_directory__/pipeline.yaml'
     ]]></command>
     <inputs>
-        <param type="text" name="token" />
         <param type="data" name="mapconfig" format="yaml" />
         <param type="data" name="integrationconfig" format="yaml" />
     </inputs>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tomo/pipeline_combine.yaml	Mon Apr 24 16:39:59 2023 +0000
@@ -0,0 +1,16 @@
+pipeline:
+
+  # Combine tomography stacks
+  - common.MultipleReader:
+      readers:
+        - NexusReader:
+            filename: reconstructed.nxs
+        - YAMLReader:
+            filename: combine.yaml
+            schema: TomoCombineConfig
+  - tomo.TomoDataProcessor:
+      output_folder: tomo_combine_plots
+      save_figs: 'only'
+  - common.NexusWriter:
+      filename: output.nxs
+      force_overwrite: true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tomo/pipeline_find_center.yaml	Mon Apr 24 16:39:59 2023 +0000
@@ -0,0 +1,16 @@
+pipeline:
+
+  # Find rotation axis centers for the tomography stacks
+  - common.MultipleReader:
+      readers:
+        - NexusReader:
+            filename: reduced.nxs
+        - YAMLReader:
+            filename: find_center.yaml
+            schema: TomoFindCenterConfig
+  - tomo.TomoDataProcessor:
+      output_folder: tomo_find_center_plots
+      save_figs: 'only'
+  - common.YAMLWriter:
+      filename: output.yaml
+      force_overwrite: true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tomo/pipeline_reconstruct.yaml	Mon Apr 24 16:39:59 2023 +0000
@@ -0,0 +1,19 @@
+pipeline:
+
+  # Reconstruct tomography stacks
+  - common.MultipleReader:
+      readers:
+        - NexusReader:
+            filename: reduced.nxs
+        - YAMLReader:
+            filename: reconstruct.yaml
+            schema: TomoReconstructConfig
+        - YAMLReader:
+            filename: centers.yaml
+            schema: TomoFindCenterConfig
+  - tomo.TomoDataProcessor:
+      output_folder: tomo_reconstruct_plots
+      save_figs: 'only'
+  - common.NexusWriter:
+      filename: output.nxs
+      force_overwrite: true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tomo/tomo_combine.xml	Mon Apr 24 16:39:59 2023 +0000
@@ -0,0 +1,83 @@
+<tool id="CHAP_tomo_combine" name="Tomo Combine" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@" python_template_version="@PYTHON_TEMPLATE_VERSION@">
+    <description>Combine tomography stacks</description>
+    <macros>
+        <import>tomo_macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command detect_errors="exit_code">
+        <![CDATA[
+        mkdir tomo_combine_plots;
+        $__tool_directory__/../pip_install.sh 'certif-pyspec==1.5.3' &&
+        cp $input_file reconstruced.nex &&
+        cp $tool_config combine.yaml
+        CHAP --config 
+        $__tool_directory__/pipeline_combine.yaml
+        ]]>
+    </command>
+    <configfiles>
+        <configfile name="tool_config">
+            <![CDATA[#slurp
+#echo 'x_bounds:' #
+#if str($x_bounds.type_selector) == "full_range"
+#echo '- -1' #
+#echo '- -1' #
+#else
+#echo '- ' + str($x_bounds.low) #
+#echo '- ' + str($x_bounds.upp) #
+#end if
+#echo 'y_bounds:' #
+#if str($y_bounds.type_selector) == "full_range"
+#echo '- -1' #
+#echo '- -1' #
+#else
+#echo '- ' + str($y_bounds.low) #
+#echo '- ' + str($y_bounds.upp) #
+#end if
+            ]]>
+        </configfile>
+    </configfiles>
+    <inputs>
+        <param name="input_file" type="data" format="nex" optional="false" label="Reconstructed tomography data file"/>
+        <conditional name="x_bounds">
+            <param name="type_selector" type="select" label="Choose combined image range in the x-direction">
+                <option value="full_range" selected="true">Use the full image range</option>
+                <option value="enter_range">Manually enter the image range in the x-direction</option>
+            </param>
+            <when value="full_range"/>
+            <when value="enter_range">
+                <param name="low" type="integer" value="-1" optional="false" label="Lower image x-range index"/>
+                <param name="upp" type="integer" value="-1" optional="false" label="Upper image x-range index"/>
+            </when>
+        </conditional>
+        <conditional name="y_bounds">
+            <param name="type_selector" type="select" label="Choose combined image range in the y-direction">
+                <option value="full_range" selected="true">Use the full image range</option>
+                <option value="enter_range">Manually enter the image range in the y-direction</option>
+            </param>
+            <when value="full_range"/>
+            <when value="enter_range">
+                <param name="low" type="integer" value="-1" optional="false" label="Lower image y-range index"/>
+                <param name="upp" type="integer" value="-1" optional="false" label="Upper image y-range index"/>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="tool_config" format="yaml" label="Tool config" from_work_dir="combine.yaml" hidden="false"/>
+        <collection name="tomo_combine_plots" type="list" label="Data combination images">
+            <discover_datasets pattern="__name_and_ext__" directory="tomo_combine_plots"/>
+        </collection>
+        <data name="output_file" format="nex" label="Combined tomography data" from_work_dir="output.nex"/>
+    </outputs>
+    <help>
+        <![CDATA[
+        usage: PROG [-h] [--config CONFIG] [--verbose]
+
+options:
+  -h, --help       show this help message and exit
+  --config CONFIG  Input configuration file
+  --verbose        verbose output
+
+        ]]>
+    </help>
+    <expand macro="citations"/>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tomo/tomo_find_center.xml	Mon Apr 24 16:39:59 2023 +0000
@@ -0,0 +1,63 @@
+<tool id="CHAP_tomo_find_center" name="Tomo Find Center" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@" python_template_version="@PYTHON_TEMPLATE_VERSION@">
+    <description>Find rotation axis centers for the tomography stacks</description>
+    <macros>
+        <import>tomo_macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command detect_errors="exit_code">
+        <![CDATA[
+        mkdir tomo_find_center_plots;
+        $__tool_directory__/../pip_install.sh 'certif-pyspec==1.5.3' &&
+        cp $input_file reduced.nex &&
+        cp $tool_config find_center.yaml
+        CHAP --config 
+        $__tool_directory__/pipeline_find_center.yaml
+        ]]>
+    </command>
+    <configfiles>
+        <configfile name="tool_config">
+            <![CDATA[#slurp
+#if str($center_rows.type_selector) == "full_range"
+#echo 'lower_row: -1' #
+#echo 'lower_row: -1' #
+#else
+#echo 'lower_row: ' + str($center_rows.low) #
+#echo 'lower_row: ' + str($center_rows.upp) #
+#end if
+            ]]>
+        </configfile>
+    </configfiles>
+    <inputs>
+        <param name="input_file" type="data" format="nex" optional="false" label="Reduce tomography data file"/>
+        <conditional name="center_rows">
+            <param name="type_selector" type="select" label="Choose axis center image rows">
+                <option value="full_range" selected="true">Use the first and last detector row</option>
+                <option value="enter_range">Manually enter the center image rows</option>
+            </param>
+            <when value="full_range"/>
+            <when value="enter_range">
+                <param name="low" type="integer" value="-1" optional="false" label="Lower detector row index"/>
+                <param name="upp" type="integer" value="-1" optional="false" label="Upper detector row index"/>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="tool_config" format="yaml" label="Tool config" from_work_dir="find_center.yaml" hidden="false"/>
+        <collection name="tomo_find_center_plots" type="list" label="Find rotation axis center images">
+            <discover_datasets pattern="__name_and_ext__" directory="tomo_find_center_plots"/>
+        </collection>
+        <data name="output_file" format="yaml" label="Rotation axis centers data" from_work_dir="output.yaml"/>
+    </outputs>
+    <help>
+        <![CDATA[
+        usage: PROG [-h] [--config CONFIG] [--verbose]
+
+options:
+  -h, --help       show this help message and exit
+  --config CONFIG  Input configuration file
+  --verbose        verbose output
+
+        ]]>
+    </help>
+    <expand macro="citations"/>
+</tool>
--- a/tomo/tomo_macros.xml	Thu Apr 13 13:54:53 2023 +0000
+++ b/tomo/tomo_macros.xml	Mon Apr 24 16:39:59 2023 +0000
@@ -4,7 +4,7 @@
     <token name="@PYTHON_TEMPLATE_VERSION@">3.9</token>
     <xml name="requirements">
         <requirements>
-            <requirement type="package" version="0.0.4">chessanalysispipeline</requirement>
+            <requirement type="package" version="0.0.6">chessanalysispipeline</requirement>
             <requirement type="package" version="1.1.0">lmfit</requirement>
             <requirement type="package" version="3.7.1">matplotlib</requirement>
             <requirement type="package" version="1.0.1">nexusformat</requirement>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tomo/tomo_reconstruct.xml	Mon Apr 24 16:39:59 2023 +0000
@@ -0,0 +1,85 @@
+<tool id="CHAP_tomo_reconstruct" name="Tomo Reconstruct" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@" python_template_version="@PYTHON_TEMPLATE_VERSION@">
+    <description>Reconstruct tomography stacks</description>
+    <macros>
+        <import>tomo_macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <command detect_errors="exit_code">
+        <![CDATA[
+        mkdir tomo_reconstruct_plots;
+        $__tool_directory__/../pip_install.sh 'certif-pyspec==1.5.3' &&
+        cp $input_file reduced.nex &&
+        cp $center_file centers.yaml &&
+        cp $tool_config reconstruct.yaml
+        CHAP --config 
+        $__tool_directory__/pipeline_reconstruct.yaml
+        ]]>
+    </command>
+    <configfiles>
+        <configfile name="tool_config">
+            <![CDATA[#slurp
+#echo 'x_bounds:' #
+#if str($x_bounds.type_selector) == "full_range"
+#echo '- -1' #
+#echo '- -1' #
+#else
+#echo '- ' + str($x_bounds.low) #
+#echo '- ' + str($x_bounds.upp) #
+#end if
+#echo 'y_bounds:' #
+#if str($y_bounds.type_selector) == "full_range"
+#echo '- -1' #
+#echo '- -1' #
+#else
+#echo '- ' + str($y_bounds.low) #
+#echo '- ' + str($y_bounds.upp) #
+#end if
+            ]]>
+        </configfile>
+    </configfiles>
+    <inputs>
+        <param name="input_file" type="data" format="nex" optional="false" label="Reduce tomography data file"/>
+        <param name="center_file" type="data" format="yaml" optional="false" label="Rotation axis centers data file"/>
+        <conditional name="x_bounds">
+            <param name="type_selector" type="select" label="Choose reconstructed image range in the x-direction">
+                <option value="full_range" selected="true">Use the full image range</option>
+                <option value="enter_range">Manually enter the image range in the x-direction</option>
+            </param>
+            <when value="full_range"/>
+            <when value="enter_range">
+                <param name="low" type="integer" value="-1" optional="false" label="Lower image x-range index"/>
+                <param name="upp" type="integer" value="-1" optional="false" label="Upper image x-range index"/>
+            </when>
+        </conditional>
+        <conditional name="y_bounds">
+            <param name="type_selector" type="select" label="Choose reconstructed image range in the y-direction">
+                <option value="full_range" selected="true">Use the full image range</option>
+                <option value="enter_range">Manually enter the image range in the y-direction</option>
+            </param>
+            <when value="full_range"/>
+            <when value="enter_range">
+                <param name="low" type="integer" value="-1" optional="false" label="Lower image y-range index"/>
+                <param name="upp" type="integer" value="-1" optional="false" label="Upper image y-range index"/>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="tool_config" format="yaml" label="Tool config" from_work_dir="reconstruct.yaml" hidden="false"/>
+        <collection name="tomo_reconstruct_plots" type="list" label="Data reconstruction images">
+            <discover_datasets pattern="__name_and_ext__" directory="tomo_reconstruct_plots"/>
+        </collection>
+        <data name="output_file" format="nex" label="Reconstructed tomography data" from_work_dir="output.nex"/>
+    </outputs>
+    <help>
+        <![CDATA[
+        usage: PROG [-h] [--config CONFIG] [--verbose]
+
+options:
+  -h, --help       show this help message and exit
+  --config CONFIG  Input configuration file
+  --verbose        verbose output
+
+        ]]>
+    </help>
+    <expand macro="citations"/>
+</tool>