Skip to content

Commit

Permalink
Merge pull request #5499 from kostrykin/dev/bheu24-fix20
Browse files Browse the repository at this point in the history
[BHEU2024] Update the "Introduction to image analysis using Galaxy" and "HeLa screen analysis" tutorials
  • Loading branch information
bgruening authored Nov 6, 2024
2 parents e1259c3 + 3bcc052 commit 705a89b
Show file tree
Hide file tree
Showing 14 changed files with 410 additions and 619 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 55 additions & 50 deletions topics/imaging/tutorials/hela-screen-analysis/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The dataset required for this tutorial contains a screen of DAPI stained HeLa nu
> {% snippet faqs/galaxy/datasets_import_from_data_library.md %}
>
> 3. {% tool [Unzip](toolshed.g2.bx.psu.edu/repos/imgteam/unzip/unzip/6.0+galaxy0) %} with the following parameters:
> - {% icon param-file %} *"input_file"*: `Zipped ` input file
> - {% icon param-file %} *"input_file"*: `B2.zip`
> - *"Extract single file"*: `Single file`
> - *"Filepath"*: `B2--W00026--P00001--Z00000--T00000--dapi.tif`
>
Expand All @@ -92,7 +92,7 @@ The dataset required for this tutorial contains a screen of DAPI stained HeLa nu
> {% snippet faqs/galaxy/datasets_rename.md %}
>
> 5. {% tool [Unzip](toolshed.g2.bx.psu.edu/repos/imgteam/unzip/unzip/6.0+galaxy0) %} with the following parameters:
> - {% icon param-file %} *"input_file"*: `Zipped ` input file
> - {% icon param-file %} *"input_file"*: `B2.zip`
> - *"Extract single file"*: `All files`
>
> 6. Rename {% icon galaxy-pencil %} the resulting collection to `control`
Expand All @@ -110,7 +110,7 @@ The dataset required for this tutorial contains a screen of DAPI stained HeLa nu
> {% snippet faqs/galaxy/datasets_import_from_data_library.md %}
>
> 8. {% tool [Unzip](toolshed.g2.bx.psu.edu/repos/imgteam/unzip/unzip/6.0+galaxy0) %} to extract the zipped screen:
> - {% icon param-file %} *"input_file"*: `Zipped ` input file
> - {% icon param-file %} *"input_file"*: `B3.zip`
> - *"Extract single file"*: `All files`
>
> 9. Rename {% icon galaxy-pencil %} the collection to `PLK1`
Expand All @@ -134,77 +134,82 @@ First, we will create and test a workflow which extracts mean DAPI intensity, ar
> <hands-on-title>Create feature extraction workflow</hands-on-title>
>
> 1. {% tool [Filter 2D image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_simple_filter/ip_filter_standard/0.0.3-3) %} with the following parameters to smooth the image:
> - *"Filter type"*: `Gaussian Blur`
> - *"Radius/Sigma"*: `3`
> - {% icon param-file %} *"Source file"*: `testinput.tif` file
> 2. {% tool [Threshold image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_auto_threshold/ip_threshold/0.0.5-2) %} with the following parameters to segment the image:
> - {% icon param-file %} *"Source file"*: output of {% tool [Filter 2D image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_simple_filter/ip_filter_standard/0.0.3-3) %}
> - *"Threshold Algorithm"*: `Otsu`
> - *"Dark Background"*: `Yes`
> 3. {% tool [Split binary image using watershed transformation](toolshed.g2.bx.psu.edu/repos/imgteam/2d_split_binaryimage_by_watershed/ip_2d_split_binaryimage_by_watershed/0.0.1-2) %} with the following parameters to split touching objects:
> - {% icon param-file %} *"Source file"*: output of {% tool [Threshold image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_auto_threshold/ip_threshold/0.0.5-2) %}
> - *"Minimum distance between two objects."*: `20`
> 4. {% tool [Extract 2D features](toolshed.g2.bx.psu.edu/repos/imgteam/2d_feature_extraction/ip_2d_feature_extraction/0.1.1-2) %} with the following parameters to extract features from the segmented objects:
> - {% icon param-file %} *"Label file"*: output of {% tool [Split binary image using watershed transformation](toolshed.g2.bx.psu.edu/repos/imgteam/2d_split_binaryimage_by_watershed/ip_2d_split_binaryimage_by_watershed/0.0.1-2) %}
> - *"Use original image to compute additional features."*: `No original image`
> 1. {% tool [Filter 2-D image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_simple_filter/ip_filter_standard/1.12.0+galaxy1) %} with the following parameters to smooth the image:
> - {% icon param-file %} *"Input image"*: `testinput.tif` file
> - *"Filter type"*: `Gaussian`
> - *"Sigma"*: `3`
> 2. {% tool [Threshold image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_auto_threshold/ip_threshold/0.18.1+galaxy3) %} with the following parameters to segment the image:
> - {% icon param-file %} *"Input image"*: output of {% tool [Filter 2-D image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_simple_filter/ip_filter_standard/1.12.0+galaxy1) %}
> - *"Thresholding method"*: `Globally adaptive / Otsu`
> 3. {% tool [Convert binary image to label map](toolshed.g2.bx.psu.edu/repos/imgteam/binary2labelimage/ip_binary_to_labelimage/0.5+galaxy0) %} with the following parameters to split touching objects:
> - {% icon param-file %} *"Binary image"*: output of {% tool [Threshold image](toolshed.g2.bx.psu.edu/repos/imgteam/2d_auto_threshold/ip_threshold/0.18.1+galaxy3) %}
> - *"Mode":* `Watershed transform`
> - *"Minimum distance between two objects"*: `20`
> 4. {% tool [Extract image features](toolshed.g2.bx.psu.edu/repos/imgteam/2d_feature_extraction/ip_2d_feature_extraction/0.18.1+galaxy0) %} with the following parameters to extract features from the segmented objects:
> - {% icon param-file %} *"Label map"*: output of {% tool [Convert binary image to label map](toolshed.g2.bx.psu.edu/repos/imgteam/binary2labelimage/ip_binary_to_labelimage/0.5+galaxy0) %}
> - *"Use the intensity image to compute additional features"*: `No intensity image`
> - *"Select features to compute"*: `Select features`
> - *"Available features"*:
> - {% icon param-check %} `Add label id of label image`
> - {% icon param-check %} `Label from the label map`
> - {% icon param-check %} `Area`
> - {% icon param-check %} `Eccentricity`
> - {% icon param-check %} `Major Axis Length`
> 5. {% tool [Filter label map by rules](toolshed.g2.bx.psu.edu/repos/imgteam/2d_filter_segmentation_by_features/ip_2d_filter_segmentation_by_features/0.0.1) %} with the following parameters to filter the label map from 3. with the extracted features and a set of rules:
> - {% icon param-file %} *"Source file"*: output of {% tool [Split binary image using watershed transformation](toolshed.g2.bx.psu.edu/repos/imgteam/2d_split_binaryimage_by_watershed/ip_2d_split_binaryimage_by_watershed/0.0.1-2) %}
> - {% icon param-file %} *"Feature file"*: output of {% tool [Extract 2D features](toolshed.g2.bx.psu.edu/repos/imgteam/2d_feature_extraction/ip_2d_feature_extraction/0.1.1-2) %}
> - {% icon param-file %} *"Rules file"*: rules file
> 6. {% tool [Extract 2D features](toolshed.g2.bx.psu.edu/repos/imgteam/2d_feature_extraction/ip_2d_feature_extraction/0.1.1-2) %} with the following parameters to extract features the final readout from the segmented objects:
> - {% icon param-file %} *"Label file"*: output of {% tool [Filter label map by rules](toolshed.g2.bx.psu.edu/repos/imgteam/2d_filter_segmentation_by_features/ip_2d_filter_segmentation_by_features/0.0.1) %}
> - *"Use original image to compute additional features."*: `Use original image`
> - {% icon param-file %} *"Original image file"*: `testinput.tif` file
> - {% icon param-check %} `Major axis length`
> 5. {% tool [Filter label map by rules](toolshed.g2.bx.psu.edu/repos/imgteam/2d_filter_segmentation_by_features/ip_2d_filter_segmentation_by_features/0.0.1-4) %} with the following parameters to filter the label map from 3. with the extracted features and a set of rules:
> - {% icon param-file %} *"Label map"*: output of {% tool [Convert binary image to label map](toolshed.g2.bx.psu.edu/repos/imgteam/binary2labelimage/ip_binary_to_labelimage/0.5+galaxy0) %}
> - {% icon param-file %} *"Features"*: output of {% tool [Extract image features](toolshed.g2.bx.psu.edu/repos/imgteam/2d_feature_extraction/ip_2d_feature_extraction/0.18.1+galaxy0) %}
> - {% icon param-file %} *"Rules"*: `rules` file
> 6. {% tool [Extract image features](toolshed.g2.bx.psu.edu/repos/imgteam/2d_feature_extraction/ip_2d_feature_extraction/0.18.1+galaxy0) %} with the following parameters to extract features the final readout from the segmented objects:
> - {% icon param-file %} *"Label map"*: output of {% tool [Filter label map by rules](toolshed.g2.bx.psu.edu/repos/imgteam/2d_filter_segmentation_by_features/ip_2d_filter_segmentation_by_features/0.0.1-4) %}
> - *"Use the intensity image to compute additional features"*: `Use intensity image`
> - {% icon param-file %} *"Intensity image"*: `testinput.tif` file
> - *"Select features to compute"*: `Select features`
> - *"Available features"*:
> - {% icon param-check %} `Mean Intensity`
> - {% icon param-check %} `Mean Intensity (requires original image)`
> - {% icon param-check %} `Area`
> - {% icon param-check %} `Major Axis Length`
> 7. Now we can extract the workflow for batch processing
> - {% icon param-check %} `Major axis length`
> 7. Now we can extract the workflow for batch processing:
> - Name it "feature_extraction".
> - Remember to exclude {% tool [Unzip](toolshed.g2.bx.psu.edu/repos/imgteam/unzip/unzip/6.0+galaxy0) %} by unchecking the tool.
> - Don't treat `B2.zip` and `B3.zip` as inputs (the workflow is supposed to be applied to the images directly).
> - Exclude {% tool [Unzip](toolshed.g2.bx.psu.edu/repos/imgteam/unzip/unzip/6.0+galaxy0) %} by unchecking the tool (3 times).
>
> {% snippet faqs/galaxy/workflows_extract_from_history.md %}
>
> 8. Edit the workflow you just created
> - Add the tool {% tool Input dataset %} and name it `input image`.
> - Name the input for the rules file `filter rules`.
> - Mark the results of steps 5 and 6 as outputs (by clicking on the asterisk next to the output name).
> 8. Edit the workflow you just created:
> - Select "Input dataset" from the list of tools. The step {% icon param-file %} **8: Input Dataset** appears.
> - Change the "Label" of {% icon param-file %} **8: Input Dataset** to `input image`.
> - Change the "Label" of {% icon param-file %} **1: rules** to `filter rules`.
> - Connect the output of {% icon param-file %} **8: input image** to the input of {% icon tool %} **2: Filter 2-D image**.
> - Connect the output of {% icon param-file %} **8: input image** to the "Intensity image" input of {% icon tool %} **7: Extract image features**.
> - Mark the results of {% icon tool %} **6: Filter label map by rules** and {% icon tool %} **7: Extract image features** as the primary outputs of the workflow (by clicking on the checkboxes of the outputs).
>
{: .hands_on}
The resulting workflow should look something like this:
![feature extraction workflow](../../images/hela-screen-analysis/feature_extraction_workflow.png "Feature extraction subworkflow.")
![feature extraction workflow](../../images/hela-screen-analysis/feature_extraction_workflow.png "Feature extraction workflow.")
# Apply workflow to screen
Now we want to apply our extracted workflow to `original data` and merge the results. For this purpose, we create a workflow which uses the previously created workflow as subworkflow.
Now we want to apply our extracted workflow to a series of images and merge the results. For this purpose, we create a workflow which uses the previously created workflow as a sub-workflow.
> <hands-on-title>Create screen analysis workflow</hands-on-title>
>
> 1. Create a new workflow in the workflow editor.
>
> {% snippet faqs/galaxy/workflows_create_new.md %}
> 2. Add a {% tool Input dataset collection %} node and name it `input images`
> 3. Add a {% tool Input dataset %} node and name it `rules`
> 4. Add the **feature_extraction** workflow as node.
> - {% icon param-file %} *"input image"*: `input images` output of {% tool Input dataset collection %}
> - {% icon param-file %} *"filter rules"*: `rules` output of {% tool Input dataset %}
> 5. Add a {% tool Collapse Collection %} node.
> - {% icon param-file %} *"Collection of files to collapse into single dataset"*: output of **feature_extraction** workflow
> - *"Keep one header line"*: `Yes`
> - *"Append File name"*: `No`
> - Mark the tool output as workflow output
> 6. Save your workflow and name it `analyze_screen`
>
> 2. Select "Input dataset collection" from the list of tools. The step {% icon param-collection %} **1: Input Dataset Collection** appears in your workflow. Change the "Label" of this step to `input images`.
> 3. Add the input dataset {% icon param-file %} **2: rules** to your workflow (select "Input dataset" from the list of tools and set the "Label" of the newly created step to `rules`).
> 4. Add the {% icon workflow %} **feature_extraction** workflow as a sub-workflow:
> - Expand the "Workflows" section in the list of tools and select "feature_extraction" to add it to the workflow.
> - Connect the output of {% icon param-file %} **1: input images** to the "input image" input of {% icon workflow %} **3: feature_extraction**.
> - Connect the output of {% icon param-file %} **2: rules** to the "filter rules" input of {% icon workflow %} **3: feature_extraction**.
> 5. Create the step {% icon tool %} **4: Collapse Collection** in the workflow (by choosing "Collapse Collection" from the list of tools).
> - Connect the output "output (tabular)" of {% icon workflow %} **3: feature_extraction** to {% icon tool %} **4: Collapse Collection**.
> - Set *"Keep one header line"* of {% icon tool %} **4: Collapse Collection**: `Yes`
> - Set *"Prepend File name"* of {% icon tool %} **4: Collapse Collection**: `No`
> - Mark the output of {% icon tool %} **4: Collapse Collection** as the primary workflow output.
> 6. Save your workflow and name it `analyze_screen`.
{: .hands_on}
The resulting workflow should look something like this:
Expand All @@ -214,11 +219,11 @@ The resulting workflow should look something like this:
> <hands-on-title>Run screen analysis workflow</hands-on-title>
>
> 1. Run the screen analysis workflow {% icon workflow %} on the `control` screen and the `rules` file
> 1. Run the "analyze_screen" workflow on the `control` screen using the `rules` file.
>
> {% snippet faqs/galaxy/workflows_run.md %}
>
> 2. Run the screen analysis workflow {% icon workflow %} on the `PLK1` screen and the `rules` file
> 2. Run the "analyze_screen" workflow on the `PLK1` screen using the `rules` file.
>
{: .hands_on}
Expand Down
Loading

0 comments on commit 705a89b

Please sign in to comment.