Repository 'cp_cellprofiler4'
hg clone https://toolshed.g2.bx.psu.edu/repos/bgruening/cp_cellprofiler4

Changeset 0:b333df978624 (2022-04-25)
Next changeset 1:5a810dc963f4 (2023-11-05)
Commit message:
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 4cb71c4badd30480d67860ff614410f37f2cc8d0"
added:
cellprofiler.xml
macros.xml
test-data/ExampleHuman.cppipe
test-data/images.tar
test-data/images/AS_09125_050116030001_D03f00d0.tif
test-data/images/AS_09125_050116030001_D03f00d1.tif
test-data/images/AS_09125_050116030001_D03f00d2.tif
b
diff -r 000000000000 -r b333df978624 cellprofiler.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cellprofiler.xml Mon Apr 25 18:30:59 2022 +0000
[
b'@@ -0,0 +1,245 @@\n+<tool id="cp_cellprofiler4" name="CellProfiler" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01">\n+    <description>run a CellProfiler pipeline</description>\n+    <macros>\n+        <import>macros.xml</import>\n+        <token name="@VERSION_SUFFIX@">0</token>\n+        <xml name="test_assert_content" token_n="291">\n+            <assert_contents>\n+                <has_n_lines n="@N@" />\n+            </assert_contents>\n+        </xml>\n+    </macros>\n+    <expand macro="cp_requirements" />\n+    <command detect_errors="aggressive"><![CDATA[\n+        export MPLCONFIGDIR=\\$TEMP &&\n+        bash \'$script_file\' &&\n+        cellprofiler -c -r --file-list list.txt -o ./output -p \'$pipeline\' \n+        #if $detailed_output\n+            -L 10 > ./cp.log 2>&1\n+        #end if \n+    ]]></command>\n+    <configfiles>\n+        <configfile name="script_file">\n+mkdir ./input\n+mkdir ./output\n+\n+#if $con_input_type.input_type =="yes"\n+    tar -C ./input -xvf $con_input_type.input_images\n+#else\n+    #for $i, $filename in enumerate($con_input_type.input_images):\n+        ln -s \'$filename\' \'./input/${filename.element_identifier}.${filename.ext}\'\n+    #end for\n+#end if\n+\n+find `pwd`/input -name "*.*" > list.txt\n+        </configfile>\n+    </configfiles>\n+  \n+    <inputs>\n+        <param name="pipeline" type="data" format="txt" label="Pipeline file" help="A ready-to-run .cppipe file. It can be created with various CellProfiler modules." />\n+        <conditional name="con_input_type">\n+            <param name="input_type" type="select" label="Are the input images packed into a tar archive?">\n+                <option value="yes">Yes</option>\n+                <option value="no">No</option>\n+            </param> \n+            <when value="no">\n+                <param name="input_images" type="data" multiple="true" format="@FORMATS@" label="Images" />\n+            </when>\n+            <when value="yes">\n+                <param name="input_images" type="data" format="tar" label="A tarball of images" />\n+            </when>\n+        </conditional>\n+       \n+        <param name="detailed_output" type="boolean" label="Detailed logging file?" help="If set, a detailed CellProfiler log file will be generated." />\n+    </inputs>\n+\n+    <outputs>\n+        <collection name="pipeline_output" type="list" label="CellProfiler pipeline output files">\n+            <discover_datasets pattern="__designation_and_ext__" visible="false" directory="output"/>\n+        </collection>\n+        <data format="txt" name="logs" from_work_dir="cp.log" label="CellProfiler log">\n+            <filter>detailed_output</filter>\n+        </data>\n+    </outputs>\n+\n+    <tests>\n+        <test expect_num_outputs="1">\n+            <param name="pipeline" value="ExampleHuman.cppipe" />\n+            <conditional name="con_input_type">\n+                <param name="input_type" value="no" />\n+                <param name="input_images" value="images/AS_09125_050116030001_D03f00d0.tif,images/AS_09125_050116030001_D03f00d1.tif,images/AS_09125_050116030001_D03f00d2.tif" />\n+            </conditional>\n+            <param name="detailed_output" value="False" />\n+            <output_collection name="pipeline_output" type="list" count="7">\n+                <element name="AS_09125_050116030001_D03f00d0.tif_Overlay">\n+                    <assert_contents>\n+                      <has_size value="168221"/>\n+                    </assert_contents>\n+                </element>\n+                <element name="Cells">\n+                    <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="Cytoplasm">\n+                  <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="Experiment">\n+                  <expand macro="test_assert_content" n="261" />\n+                </element>\n+                <element name="Image">\n+                  <expand macro="test_assert_content" n="2" />\n+  '..b'       <param name="input_images" value="images.tar" />\n+            </conditional>\n+            <param name="detailed_output" value="False" />\n+            <output_collection name="pipeline_output" type="list" count="7">\n+                <element name="AS_09125_050116030001_D03f00d0_Overlay">\n+                    <assert_contents>\n+                      <has_size value="168221"/>\n+                    </assert_contents>\n+                </element>\n+                <element name="Cells">\n+                    <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="Cytoplasm">\n+                  <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="Experiment">\n+                  <expand macro="test_assert_content" n="261" />\n+                </element>\n+                <element name="Image">\n+                  <expand macro="test_assert_content" n="2" />\n+                </element>\n+                <element name="Nuclei">\n+                  <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="PH3">\n+                  <expand macro="test_assert_content" n="23" />\n+                </element>\n+            </output_collection>\n+        </test>\n+        <test expect_num_outputs="2">\n+            <param name="pipeline" value="ExampleHuman.cppipe" />\n+            <conditional name="con_input_type">\n+                <param name="input_type" value="yes" />\n+                <param name="input_images" value="images.tar" />\n+            </conditional>\n+            <param name="detailed_output" value="True" />\n+            <output_collection name="pipeline_output" type="list" count="7">\n+                <element name="AS_09125_050116030001_D03f00d0_Overlay">\n+                    <assert_contents>\n+                      <has_size value="168221"/>\n+                    </assert_contents>\n+                </element>\n+                <element name="Cells">\n+                    <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="Cytoplasm">\n+                  <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="Experiment">\n+                  <expand macro="test_assert_content" n="261" />\n+                </element>\n+                <element name="Image">\n+                  <expand macro="test_assert_content" n="2" />\n+                </element>\n+                <element name="Nuclei">\n+                  <expand macro="test_assert_content" n="290" />\n+                </element>\n+                <element name="PH3">\n+                  <expand macro="test_assert_content" n="23" />\n+                </element>\n+            </output_collection>\n+            <output name="logs" ftype=\'txt\'>\n+                <assert_contents>\n+                    <has_text_matching expression="JVM will be started with AWT in headless mode" />\n+                </assert_contents>\n+            </output>\n+        </test>        \n+\n+    </tests>\n+    \n+    <help>\n+    <![CDATA[\n+\n+      .. class:: infomark\n+\n+      **What it does**\n+\n+      This is the last tool in a CellProfiler workflow and runs a CellProfiler @TOOL_VERSION@ pipeline file on a collection of images.\n+\n+\n+      .. class:: infomark\n+\n+      **Input**\n+\n+      - Collection of images.\n+\n+      - Existing CellProfiler pipeline file *(.cppipe)* or generated by linking CellProfiler tools.\n+\n+      .. class:: infomark\n+\n+      **Output**\n+\n+      - Images if the tool *SaveImages* was included in the workflow.\n+      - The features selected if the tool *ExportToSpreadsheet* was included in the workflow.\n+\n+      .. class:: warningmark\n+\n+      **IMPORTANT**\n+\n+      Only the pipelines generated with the version @TOOL_VERSION@ of CellProfiler can be run, other versions may cause problems.\n+      ]]>\n+    </help>\n+    <expand macro="citations" />\n+</tool>\n'
b
diff -r 000000000000 -r b333df978624 macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml Mon Apr 25 18:30:59 2022 +0000
b
@@ -0,0 +1,58 @@
+<macros>
+    <token name="@TOOL_VERSION@">4.2.1</token>
+    <token name="@PY_VERSION@">3.8</token>
+    <token name="@FORMATS@">jpg,png,tiff,bmp,gif,pcx,ppm,psd,pbm,pgm,eps</token>
+    <token name="@SPACES@">"    "</token>
+    <!-- four spaces needed for CP pipeline file -->
+    <token name="@COMMON_HELP@">
+        .. class:: infomark
+
+        **Input**
+
+        Existing CellProfiler pipeline file *(.cppipe)* or generated by linking CellProfiler tools.
+
+        .. class:: infomark
+
+        **Output**
+
+        The input CellProfiler pipeline file *(.cppipe)* in addition to the settings of this module.
+
+        .. class:: warningmark
+
+        **IMPORTANT**
+
+        The first tool in a CellProfiler workflow has to be **Starting modules** and the last one **CellProfiler**. You can also execute the entire pipeline with the final CellProfiler tool, in which you feed in the images you want to process as well.
+    </token>
+
+    <xml name="cp_requirements">
+        <requirements>
+            <requirement type="package" version="@TOOL_VERSION@">cellprofiler</requirement>
+        </requirements>
+    </xml>
+
+
+    <xml name="py_requirements">
+        <requirements>
+            <requirement type="package" version="@PY_VERSION@">python</requirement>
+        </requirements>
+    </xml>
+
+
+    <xml name="citations">
+        <citations>
+            <citation type="bibtex">
+                @article{McQuin_2018,
+                title = {CellProfiler 3.0: Next-generation image processing for biology},
+                author = {McQuin C, Goodman A, Chernyshev V, Kamentsky L, Cimini BA, Karhohs KW, Doan M, Ding L, Rafelski SM, Thirstrup D, Wiegraebe W, Singh S, Becker T, Caicedo JC, Carpenter AE},
+                year = {2018},
+                volume = {16(7):e2005970},
+                DOI = {10.1371/journal.pbio.2005970},
+                journal = {PLoS Biol.},
+                url = {https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.2005970},
+                }
+            </citation>
+        </citations>
+    </xml>
+    
+</macros>
+
b
diff -r 000000000000 -r b333df978624 test-data/ExampleHuman.cppipe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/ExampleHuman.cppipe Mon Apr 25 18:30:59 2022 +0000
[
b'@@ -0,0 +1,252 @@\n+CellProfiler Pipeline: http://www.cellprofiler.org\n+Version:5\n+DateRevision:400\n+GitHash:\n+ModuleCount:14\n+HasImagePlaneDetails:False\n+\n+Images:[module_num:1|svn_version:\'Unknown\'|variable_revision_number:2|show_window:False|notes:[\'To begin creating your project, use the Images module to compile a list of files and/or folders that you want to analyze. You can also specify a set of rules to include only the desired files in your selected folders.\']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    :\n+    Filter images?:Images only\n+    Select the rule criteria:and (extension does isimage) (directory doesnot containregexp "[\\\\\\\\\\\\\\\\/]\\\\\\\\.")\n+\n+Metadata:[module_num:2|svn_version:\'Unknown\'|variable_revision_number:6|show_window:False|notes:[\'The Metadata module optionally allows you to extract information describing your images (i.e, metadata) which will be stored along with your measurements. This information can be contained in the file name and/or location, or in an external file.\']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Extract metadata?:No\n+    Metadata data type:Text\n+    Metadata types:{}\n+    Extraction method count:1\n+    Metadata extraction method:Extract from file/folder names\n+    Metadata source:File name\n+    Regular expression to extract from file name:^(?P<Plate>.*)_(?P<Well>[A-P][0-9]{2})_s(?P<Site>[0-9])_w(?P<ChannelNumber>[0-9])\n+    Regular expression to extract from folder name:(?P<Date>[0-9]{4}_[0-9]{2}_[0-9]{2})$\n+    Extract metadata from:All images\n+    Select the filtering criteria:and (file does contain "")\n+    Metadata file location:Elsewhere...|\n+    Match file and image metadata:[]\n+    Use case insensitive matching?:No\n+    Metadata file name:\n+    Does cached metadata exist?:No\n+\n+NamesAndTypes:[module_num:3|svn_version:\'Unknown\'|variable_revision_number:8|show_window:False|notes:[\'DNA: DNA stained with DAPI\', \'PH3: An antibody for phosphorylated histone H3 correlated with mitosis\', \'cellbody: \']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Assign a name to:Images matching rules\n+    Select the image type:Grayscale image\n+    Name to assign these images:DNA\n+    Match metadata:[]\n+    Image set matching method:Order\n+    Set intensity range from:Image metadata\n+    Assignments count:3\n+    Single images count:0\n+    Maximum intensity:255.0\n+    Process as 3D?:No\n+    Relative pixel spacing in X:1.0\n+    Relative pixel spacing in Y:1.0\n+    Relative pixel spacing in Z:1.0\n+    Select the rule criteria:and (file does contain "d0.tif")\n+    Name to assign these images:DNA\n+    Name to assign these objects:Cell\n+    Select the image type:Grayscale image\n+    Set intensity range from:Image metadata\n+    Maximum intensity:255.0\n+    Select the rule criteria:and (file does contain "d1.tif")\n+    Name to assign these images:PH3\n+    Name to assign these objects:Cell\n+    Select the image type:Grayscale image\n+    Set intensity range from:Image metadata\n+    Maximum intensity:255.0\n+    Select the rule criteria:and (file does contain "d2.tif")\n+    Name to assign these images:cellbody\n+    Name to assign these objects:Cell\n+    Select the image type:Grayscale image\n+    Set intensity range from:Image metadata\n+    Maximum intensity:255.0\n+\n+Groups:[module_num:4|svn_version:\'Unknown\'|variable_revision_number:2|show_window:False|notes:[\'The Groups module optionally allows you to split your list of images into image subsets (groups) which will be processed independently of each other. Examples of groupings include screening batches, microtiter plates, time-lapse movies, etc.\']|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Do you want to group your images?:No\n+    grouping metadata count:1\n+    Metadata category:None\n+\n+IdentifyPrimaryObjects:[module_num:5|svn_version:\'Unknown\'|variable_revision_number:14|show_window:True|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants'..b' Lower outlier fraction:0.05\n+    Upper outlier fraction:0.05\n+    Averaging method:Mean\n+    Variance method:Standard deviation\n+    # of deviations:2.0\n+    Thresholding method:Otsu\n+\n+IdentifyTertiaryObjects:[module_num:9|svn_version:\'Unknown\'|variable_revision_number:3|show_window:True|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Select the larger identified objects:Cells\n+    Select the smaller identified objects:Nuclei\n+    Name the tertiary objects to be identified:Cytoplasm\n+    Shrink smaller object prior to subtraction?:Yes\n+\n+MeasureObjectIntensity:[module_num:10|svn_version:\'Unknown\'|variable_revision_number:4|show_window:True|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Select images to measure:DNA, PH3\n+    Select objects to measure:Nuclei, Cells, Cytoplasm\n+\n+MeasureObjectSizeShape:[module_num:11|svn_version:\'Unknown\'|variable_revision_number:3|show_window:True|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Select object sets to measure:Nuclei, Cells, Cytoplasm\n+    Calculate the Zernike features?:Yes\n+    Calculate the advanced features?:No\n+\n+OverlayOutlines:[module_num:12|svn_version:\'Unknown\'|variable_revision_number:4|show_window:True|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Display outlines on a blank image?:No\n+    Select image on which to display outlines:DNA\n+    Name the output image:OrigOverlay\n+    Outline display mode:Color\n+    Select method to determine brightness of outlines:Max of image\n+    How to outline:Thick\n+    Select outline color:#0080FF\n+    Select objects to display:Cells\n+    Select outline color:blue\n+    Select objects to display:Nuclei\n+    Select outline color:yellow\n+    Select objects to display:PH3\n+\n+SaveImages:[module_num:13|svn_version:\'Unknown\'|variable_revision_number:15|show_window:True|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Select the type of image to save:Image\n+    Select the image to save:OrigOverlay\n+    Select method for constructing file names:From image filename\n+    Select image name for file prefix:DNA\n+    Enter single file name:OrigBlue\n+    Number of digits:4\n+    Append a suffix to the image file name?:Yes\n+    Text to append to the image name:_Overlay\n+    Saved file format:png\n+    Output file location:Default Output Folder|\n+    Image bit depth:8-bit integer\n+    Overwrite existing files without warning?:Yes\n+    When to save:Every cycle\n+    Record the file and path information to the saved image?:Yes\n+    Create subfolders in the output folder?:No\n+    Base image folder:Elsewhere...|\n+    How to save the series:T (Time)\n+\n+ExportToSpreadsheet:[module_num:14|svn_version:\'Unknown\'|variable_revision_number:13|show_window:True|notes:[]|batch_state:array([], dtype=uint8)|enabled:True|wants_pause:False]\n+    Select the column delimiter:Comma (",")\n+    Add image metadata columns to your object data file?:No\n+    Add image file and folder names to your object data file?:No\n+    Select the measurements to export:No\n+    Calculate the per-image mean values for object measurements?:No\n+    Calculate the per-image median values for object measurements?:No\n+    Calculate the per-image standard deviation values for object measurements?:No\n+    Output file location:Default Output Folder|\n+    Create a GenePattern GCT file?:No\n+    Select source of sample row name:Metadata\n+    Select the image to use as the identifier:None\n+    Select the metadata to use as the identifier:None\n+    Export all measurement types?:Yes\n+    Press button to select measurements:\n+    Representation of Nan/Inf:NaN\n+    Add a prefix to file names?:No\n+    Filename prefix:MyExpt_\n+    Overwrite existing files without warning?:Yes\n+    Data to export:Do not use\n+    Combine these object measurements with those of the previous object?:No\n+    File name:DATA.csv\n+    Use the object name for the file name?:Yes\n'
b
diff -r 000000000000 -r b333df978624 test-data/images.tar
b
Binary file test-data/images.tar has changed
b
diff -r 000000000000 -r b333df978624 test-data/images/AS_09125_050116030001_D03f00d0.tif
b
Binary file test-data/images/AS_09125_050116030001_D03f00d0.tif has changed
b
diff -r 000000000000 -r b333df978624 test-data/images/AS_09125_050116030001_D03f00d1.tif
b
Binary file test-data/images/AS_09125_050116030001_D03f00d1.tif has changed
b
diff -r 000000000000 -r b333df978624 test-data/images/AS_09125_050116030001_D03f00d2.tif
b
Binary file test-data/images/AS_09125_050116030001_D03f00d2.tif has changed