Skip to content

Conversation

@npinter
Copy link
Contributor

@npinter npinter commented Sep 29, 2025

As discussed here galaxyproject/galaxy#20966 I added the regex switch module as an expression tool.

Workflow example:
grafik

Workflow route 1:
grafik

Workflow route 2:
grafik

@mvdbeek mentioned there is a Galaxy bug regarding the workflow invocation. Tool works but "Attempting to schedule workflow invocation" takes 5 min to pipe the boolean to the target tools.

FOR CONTRIBUTOR:

  • I have read the CONTRIBUTING.md document and this tool is appropriate for the tools-iuc repo.
  • License permits unrestricted use (educational + commercial)
  • This PR adds a new tool or tool collection
  • This PR updates an existing tool or tool collection
  • This PR does something else (explain below)

@npinter
Copy link
Contributor Author

npinter commented Sep 29, 2025

Other regex tools and other expression tools are located in the category "Text Manipulation", so I changed "Expression tools" to that.

@npinter
Copy link
Contributor Author

npinter commented Sep 29, 2025

I don't see why it fails..

@npinter
Copy link
Contributor Author

npinter commented Sep 29, 2025

Is it because the tool doesn't generate a real output (only booleans?)? @mvdbeek

<help><![CDATA[
**Regex switch**
Matches a regular expression against an element name. It emits two booleans:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess "element name" needs better explanation. I guess you assume that the tool is mapped over a collection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the name of the dict element (job["input"]["name"]) of cwl (?), which looks like that:

    "engineConfig": [],
    "job": {
        "input": {
            "file_ext": "tabular",
            "file_size": 14,
            "name": "table.tsv",
            "metadata": {
                "dbkey": "?",
                "data_lines": 2,
                "comment_lines": 0,
                "columns": 2,
                "column_types": [
                    "int",
                    "int"
                ],
                "column_names": [],
                "delimiter": "__tc__"
            },
            "src": {
                "src": "hda",
                "id": 4
            }
        },
        "pattern": "\.csv$"
    },
    "context": null,
    "outdir": null,
    "tmpdir": null,

Not sure if this name comes either of the element identifier or the element name (I guessed the latter).

@npinter
Copy link
Contributor Author

npinter commented Oct 6, 2025

@bernt-matthias any idea why the testing fails?

@npinter
Copy link
Contributor Author

npinter commented Oct 7, 2025

@bernt-matthias looks like tests are green now :)

var matched = false;
try {
if (pat !== "") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a empty_field validator instead to the param?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Added!

@npinter
Copy link
Contributor Author

npinter commented Oct 8, 2025

Testing fails again with the same cryptic error as before (..which turned green at some point :) )

@bernt-matthias
Copy link
Contributor

Let me use the opportunity to debug the failure. I guess the problem is due to #7293

@bernt-matthias bernt-matthias mentioned this pull request Oct 8, 2025
5 tasks
@bernt-matthias bernt-matthias force-pushed the add-regex-switch-expression-tool branch from 4587f8e to e4dfb0c Compare October 8, 2025 11:37
@bernt-matthias
Copy link
Contributor

Fix is coming #7348 (I hope)

@npinter
Copy link
Contributor Author

npinter commented Oct 9, 2025

sorry for bump, but looks like it worked :) thank you @bernt-matthias

@bernt-matthias bernt-matthias merged commit 502f06f into galaxyproject:main Oct 9, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants