Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Programming question]: Galaxy workflows #123

Open
haesleinhuepf opened this issue Nov 30, 2024 · 7 comments · May be fixed by #125
Open

[Programming question]: Galaxy workflows #123

haesleinhuepf opened this issue Nov 30, 2024 · 7 comments · May be fixed by #125
Assignees

Comments

@haesleinhuepf
Copy link
Owner

Do you know what Galaxy workflows (.ga files) are? If I outline a rough image processing workflow, could you construct a galaxy workflow from this?

git-bob think about this

@haesleinhuepf haesleinhuepf self-assigned this Nov 30, 2024
Copy link
Contributor

This message was generated by git-bob (version: 0.14.1dev, model: claude-3-5-sonnet-20241022, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

Hi! 👋

I know Galaxy workflows are JSON-formatted workflow files used with the Galaxy platform - a web-based platform for computational biomedical research. However, I'm not sufficiently familiar with their specific structure and requirements to reliably construct a .ga workflow file.

@haesleinhuepf - Could you help with guidance on Galaxy workflow construction?

Best,
git-bob

@haesleinhuepf
Copy link
Owner Author

Here is an example: https://github.com/rmassei/imaging_KNIME_to_Galaxy/blob/main/src/test_data/01_nuclei_segmentation/workflows/2024_nuclei_segmentation_galaxy.ga

Let's construct a new galaxy workflow with just two steps:

  • Gaussian blur filter
  • Threshold

git-bob think about this

Copy link
Contributor

This message was generated by git-bob (version: 0.14.1dev, model: claude-3-5-sonnet-20241022, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

Based on the example, here's a Galaxy workflow file implementing a simple Gaussian blur and thresholding pipeline:

{
    "a_galaxy_workflow": "true",
    "format-version": "0.1",
    "name": "gaussian_blur_threshold",
    "steps": {
        "0": {
            "id": 0,
            "type": "data_input",
            "inputs": [{"name": "Input Image"}],
            "position": {"left": 0, "top": 0}
        },
        "1": {
            "id": 1,
            "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_simple_filter/ip_filter_standard/1.12.0+galaxy1",
            "type": "tool",
            "input_connections": {
                "input": {"id": 0, "output_name": "output"}
            },
            "tool_state": "{\"filter\": {\"filter_type\": \"gaussian\", \"size\": \"3.0\"}}",
            "position": {"left": 300, "top": 0}
        },
        "2": {
            "id": 2, 
            "tool_id": "toolshed.g2.bx.psu.edu/repos/imgteam/2d_auto_threshold/ip_threshold/0.18.1+galaxy3",
            "type": "tool",
            "input_connections": {
                "input": {"id": 1, "output_name": "output"}
            },
            "tool_state": "{\"th_method\": {\"method_id\": \"otsu\"}}",
            "position": {"left": 600, "top": 0}
        }
    }
}

@haesleinhuepf
Copy link
Owner Author

git-bob comment on ways to automatically check if this workflow is formally correct. Is there a python lib or CLI tool which does that?

Copy link
Contributor

This message was generated by git-bob (version: 0.14.1dev, model: claude-3-5-sonnet-20241022, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

For checking if a Galaxy workflow file is formally correct, there are a couple of options:

  1. gxformat2 Python package: It has tools for validating Galaxy workflow formats
from gxformat2.yaml import validate_workflow
validate_workflow("workflow.ga")
  1. Galaxy's command line interface planemo:
planemo lint workflow.ga

Both tools can help catch syntax errors and validate the workflow structure.

Do you want me to demonstrate how to use any of these validation tools in more detail?

@haesleinhuepf
Copy link
Owner Author

Ok, let's write a Jupyter notebook that saves the worklow above in a .ga file and afterwards uses gxformat2 to validate the workflow.

git-bob implement this!

@haesleinhuepf
Copy link
Owner Author

haesleinhuepf commented Nov 30, 2024

Ok, this didn't work.

Let's try to use planemo instead. The correct syntax to use it for validating a workflow seems:

planemo workflow_lint path/to/workflow.ga

git-bob implement another notebook which writes the galaxy workflow above in a .ga file and validates it, this time using planemo CLI instead of gxformat2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment