Commit 3e4cecb5 authored by root's avatar root

using macros -- need to revisit

parent 424c2ba4
<tool id="cp319" name="Cellprofiler" version="19.05">
<description>Run a CellProfiler v3.1.9 pipeline</description>
<requirements>
<requirement type="package" version="3.1.9">cellprofiler</requirement>
</requirements>
<requirement type="package" version="3.1.9">cellprofiler</requirement>
</requirements>
<configfiles>
<configfile name="script_file">
<configfile name="script_file">
mkdir `pwd`/input
mkdir `pwd`/output
#for $i,$filename in enumerate($inputType.inputdir):
ln -s $filename `pwd`/input/${filename.element_identifier}.${filename.ext}
#end for
find `pwd`/input -name *.tiff > list.txt
</configfile>
</configfile>
</configfiles>
<command><![CDATA[
#if $inputType.iType =="z"
mkdir input &&
mkdir output &&
unzip $inputType.inputdir -d input &&
cellprofiler -c -r -i input -o output -p $pipeline
#else
bash '$script_file' &&
cellprofiler -c -r --file-list list.txt -o `pwd`/output -p $pipeline
#end if
sleep 1
bash '$script_file' &&
cellprofiler -c -r --file-list list.txt -o `pwd`/output -p $pipeline
]]></command>
<inputs>
<param name="pipeline" type="data" format="txt" label="Pipeline file"/>
<conditional name="inputType">
<param name="iType" type="select" label="Select either a zip file or a collection from history">
<option value="z">zip file</option>
<option value="c">collection</option>
<option value="z">zip file</option>
<option value="s">images</option>
</param>
<when value="z">
......@@ -51,13 +42,16 @@ find `pwd`/input -name *.tiff > list.txt
</inputs>
<outputs>
<!-- <data format="txt" name="out_file" />-->
<collection name="pipeline_output" type="list" label="Cellprofiler pipeline output files">
<discover_datasets pattern="__designation_and_ext__" visible="false" directory="output"/>
</collection>
</outputs>
<stdio>
<exit_code range="2:" level="fatal" description="Error occured"/>
<exit_code range="4:" level="fatal" description="Error occured"/>
</stdio>
<tests>
......
......@@ -5,6 +5,7 @@
</requirements>
<macros>
<import>macros.xml</import>
<xml name="imgTypeCondition">
<conditional name="con_set_intensity">
<param name="set_intensity_range_from" type="select" label="Set intensity range from">
......@@ -366,8 +367,7 @@ with open("output","w") as f:
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......
......@@ -3,6 +3,9 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
</macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
......@@ -56,10 +59,9 @@ f.close()
python $script_file $inputs $input_pipeline
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<param name="input_object" type="text" label="Select the input objects" />
<param name="name_output_image" type="text" label="Name the output iamge" />
<expand macro="input_pipeline_macro" />
<param name="input_object" type="text" label="Select the input objects" />
<param name="name_output_image" type="text" label="Name the output image" />
<conditional name="con_color_format">
<param name="color_format" type="select" label="Select the color format">
......@@ -137,8 +139,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -152,7 +153,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -3,8 +3,8 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
<xml name="display_object">
<param name="select_input_obj" label="Select the input objects" type="text" />
<conditional name="con_obj_measurement_category">
......@@ -96,21 +96,6 @@
</macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
<configfile name="test">
import json
import sys
input_json_path=sys.argv[1]
as_dict = json.load(open(input_json_path, "r"))
params=json.dumps(as_dict, indent=4, sort_keys=True)
with open("output","w") as f:
f.write(params)
f.close()
</configfile>
<configfile name="script_file">
import json
import sys
......@@ -201,8 +186,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<conditional name="con_display_obj_image">
<param name="display_obj_image" type="select" label="Display object or image measurements?">
<option value="Object">Object</option>
......@@ -261,8 +245,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -276,7 +259,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -4,6 +4,8 @@
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
<xml name="feature_speckles">
<param name="speckles_feature_size" label="Feature size" type="text" />
<param name="speed_accuracy" label="Speed and accuracy" type="select">
......@@ -171,8 +173,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro"/>
<param name="input_image" type="text" label="Select the input image" />
<param name="name_output_image" type="text" label="Name the output image" />
......@@ -223,8 +224,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -238,7 +238,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -3,6 +3,9 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
</macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
......@@ -97,7 +100,7 @@ f.close()
python $script_file $inputs $input_pipeline
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<param name="delimiter" type="select" label="Select the column delimiter">
<option value="Comma (&quot;,&quot;)">Comma (",")</option>
<option value="Tab">Tab</option>
......@@ -193,8 +196,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......
......@@ -4,6 +4,7 @@
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
<xml name="rgb">
<param name="rgb_red" label="Select the image to be colored red" value="Leave this black" type="text"/>
......@@ -196,8 +197,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<conditional name="con_color_scheme">
<param name="color_scheme" label="Select a color scheme" type="select">
<option value="RGB">RGB</option>
......@@ -222,8 +222,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -237,7 +236,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -5,6 +5,7 @@
</requirements>
<macros>
<import>macros.xml</import>
<xml name="ipo_common">
<param name="input_from_nat" type="text" label="Select the input image (from NamesAndTypes)"/>
<param name="name_to_be_identified" type="text" label="Name the primary objects to be identified" />
......@@ -208,8 +209,7 @@ f.close()
python $script_file $inputs $input_pipeline
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<conditional name="con_advanced">
<param name="advanced" type="select" display="radio" label="Use advanced settings?">
<option value="No">No</option>
......@@ -306,8 +306,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -321,7 +320,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
......
<macros>
<xml name="output_pipeline_macro">
<data name="out_file" from_work_dir="output" format="txt" label="Output pipeline" hidden="true">
</data>
</xml>
<xml name="input_pipeline_macro">
<param name="input_pipeline" type="data" label="Pipeline to select"/>
</xml>
</macros>
......@@ -3,6 +3,9 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
</macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
<configfile name="script_file">
......@@ -61,8 +64,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<param name="input_image" label="Select input image" type="text" />
<param name="name_output_image" type="text" label="Name the output image" />
......@@ -90,8 +92,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -105,7 +106,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -3,6 +3,9 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
</macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
<configfile name="script_file">
......@@ -64,8 +67,7 @@ f.close()
python $script_file $inputs $input_pipeline
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<repeat name="rpt_image" title="Add another image">
<param name="image_to_measure" type="text" label="Select an image to measure" />
......@@ -87,8 +89,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -102,7 +103,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -3,6 +3,9 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
</macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
......@@ -60,8 +63,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<repeat name="rpt_area" title="Add another area">
<conditional name="con_area">
<param name="objects_or_image" label="Measure the area occupied in a binary image, or in objects?" type="select">
......@@ -84,8 +86,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -99,7 +100,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -3,6 +3,9 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
</macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
<configfile name="test">
......@@ -70,8 +73,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<repeat name="rpt_intensity" title="Add another image">
<param name="image_to_measure" label="Select image to measure" type="text"/>
<conditional name="con_intensity">
......@@ -88,8 +90,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -103,7 +104,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
<tool id="cp-measureimagequality" name="MeasureImageQuality Module" version="19.05">
<tool id="cp-measureimagequality" name="MeasureImageQuality" version="19.05">
<description>module of CellProfiler v3.1.9</description>
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
<xml name="macro_calc_threshold">
<conditional name="con_use_all_methods">
......@@ -177,8 +178,7 @@ f.close()
python $script_file $inputs $input_pipeline
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<param name="calc_for_images" type="text" label="Calculate metrics for which images?" value="All loaded images" />
<param name="include_rescaling_value" type="select" display="radio" label="Include the image rescaling value?">
......@@ -219,8 +219,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -234,7 +233,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -3,6 +3,7 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros><import>macros.xml</import></macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
......@@ -56,8 +57,7 @@ f.close()
python $script_file $inputs $input_pipeline
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<repeat name="rpt_image" title="Add another image">
<param name="image_to_measure" label="Select an image to measure" type="text" />
</repeat>
......@@ -70,8 +70,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -85,7 +84,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -3,6 +3,7 @@
<requirements>
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros><import>macros.xml</import></macros>
<configfiles>
<inputs name="inputs" filename="input.json" />
<configfile name="script_file">
......@@ -49,8 +50,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<repeat name="rpt_object" title="Add another object">
<param name="objects_to_measure" label="Select objects to measure" type="text" />
</repeat>
......@@ -63,8 +63,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -78,7 +77,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -4,6 +4,7 @@
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
<xml name="measureImgObj">
<repeat name="rpt_obj_to_measure" title="Add another object">
<param name="obj_to_measure" label="Select objects to measure" type="text" />
......@@ -77,8 +78,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<repeat name="rpt_image_to_measure" title="Add another image">
<param name="image_to_measure" label="Select an image to measure" type="text" />
</repeat>
......@@ -106,8 +106,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -121,7 +120,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
......@@ -4,6 +4,7 @@
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
<xml name="distToOtherParents">
<conditional name="con_other_parent_dist">
<param name="calc_dist_to_others" label="Calculate distances to other parents?" display="radio" type="select">
......@@ -84,8 +85,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro"/>
<param name="parent_objects" label="Parent objects" type="text"/>
......@@ -129,8 +129,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -144,7 +143,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.
</help>
......
#!/bin/bash
calc(){ awk "BEGIN { print $* }"; }
INPUT=$1
OUTPUT=$2
PIPELINE=$3
#echo $INPUT
#echo $OUTPUT
#echo $PIPELINE
NO_OF_FILES=$(ls $INPUT |wc -l)
echo no_of_files:$NO_OF_FILES
FOLDERS_COUNT=$(calc $NO_OF_FILES/100)
NO_OF_FOLDERS=$(printf "%.0f\n" $FOLDERS_COUNT)
LIMIT=$((NO_OF_FOLDERS+1))
echo foldr+1:$LIMIT
COUNTER=1
while [ $COUNTER -le $LIMIT ];do
mkdir $INPUT/dir-$COUNTER
mv `find $INPUT -maxdepth 1 -type l|sort |head -100` $INPUT/dir-$COUNTER
# echo counter:$COUNTER
# echo command: $INPUT/dir-$COUNTER -p $PIPELINE -o $OUTPUT
cellprofiler -c -r -i $INPUT/dir-$COUNTER -p $PIPELINE -o $OUTPUT
let COUNTER+=1
done
......@@ -4,6 +4,7 @@
<requirement type="package" version="2.7.16">python</requirement>
</requirements>
<macros>
<import>macros.xml</import>
<xml name="file_format">
<param name="file_format" label="Saved file format" type="select">
<option value="jpeg">jpeg</option>
......@@ -128,8 +129,7 @@ f.close()
]]></command>
<inputs>
<param name="input_pipeline" type="data" label="Select pipeline file from previous moudle"/>
<expand macro="input_pipeline_macro" />
<conditional name="con_type_of_image">
<param name="type_of_image" type="select" label="Select the type of image to save" >
<option value="Image">Image</option>
......@@ -205,9 +205,7 @@ f.close()
</inputs>
<outputs>
<data name="out_file" from_work_dir="output" format="txt" hidden="true">
</data>
<expand macro="output_pipeline_macro" />
</outputs>
<stdio>
......@@ -221,7 +219,7 @@ f.close()
Input: existing pipeline file
Output: new pipelie file
Output: new pipeline file
Combine this tool with "Common" and "CellProfiler" together to run the module alone.