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

Draft: Fix xcms_group and xcms_fillpeaks #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

lecorguille
Copy link
Member

@lecorguille lecorguille commented Nov 21, 2023

This PR aims to fix this issue on xcms_group:

galaxy.web.framework.decorators ERROR 2023-11-21 09:48:39,643 [pN:main.5,p:1423968,tN:WSGI_1] Uncaught exception in exposed API method:
Traceback (most recent call last):
  File "/shared/ifbstor1/galaxy/server/lib/galaxy/web/framework/decorators.py", line 337, in decorator
    rval = func(self, trans, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/shared/ifbstor1/galaxy/server/lib/galaxy/webapps/galaxy/api/workflows.py", line 589, in build_module
    "tool_state": module.get_state(),
                  ^^^^^^^^^^^^^^^^^^
  File "/shared/ifbstor1/galaxy/server/lib/galaxy/workflow/modules.py", line 311, in get_state
    return self.state.encode(Bunch(inputs=inputs), self.trans.app, nested=nested)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/shared/ifbstor1/galaxy/server/lib/galaxy/tools/__init__.py", line 533, in encode
    value = params_to_strings(tool.inputs, self.inputs, app, nested=nested)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/shared/ifbstor1/galaxy/server/lib/galaxy/tools/parameters/__init__.py", line 266, in params_to_strings
    value = params[key].value_to_basic(value, app, use_security=use_security)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/shared/ifbstor1/galaxy/server/lib/galaxy/tools/parameters/grouping.py", line 749, in value_to_basic
    current_case = rval["__current_case__"] = self.get_current_case(value[self.test_param.name])
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/shared/ifbstor1/galaxy/server/lib/galaxy/tools/parameters/grouping.py", line 742, in get_current_case
    raise ValueError("No case matched value:", self.name, str_value)
ValueError: ('No case matched value:', 'peaklist', 'True')

This error is raised from the workflow edition.

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)

@lecorguille
Copy link
Member Author

lecorguille commented Nov 21, 2023

It seems to come from: <filter>peaklist['peaklistBool'] == 'true'</filter> 🤔

https://github.com/workflow4metabolomics/tools-metabolomics/blob/master/tools/xcms/macros_xcms.xml#L106-L124

<xml name="input_peaklist_conditional">
        <conditional name="peaklist">
            <param name="peaklistBool" type="select" label="Get the Peak List">
                <option value="true">Yes</option>
                <option value="false">No</option>
            </param>
            <when value="true">
              <expand macro="input_peaklist"/>
            </when>
            <when value="false" />
        </conditional>
    </xml>

    <xml name="output_peaklist"  token_function="">
        <data name="variableMetadata" format="tabular" label="${image.name[:-6]}.@[email protected]" from_work_dir="variableMetadata.tsv" >
            <filter>peaklist['peaklistBool'] == 'true'</filter>
        </data>
        <data name="dataMatrix" format="tabular" label="${image.name[:-6]}.@[email protected]" from_work_dir="dataMatrix.tsv" >
            <filter>peaklist['peaklistBool'] == 'true'</filter>
        </data>
    </xml>

@lecorguille lecorguille changed the title Draft: Bump xcms wrapper version Draft: Fix xcms_group Nov 21, 2023
@lecorguille
Copy link
Member Author

lecorguille commented Nov 21, 2023

Another issue with fillpeasks

3.12.0+galaxy0
Capture d’écran 2023-11-21 à 11 52 11

3.12.0+galaxy1
Capture d’écran 2023-11-21 à 11 53 23

The filter seems broken

<xml name="input_peaklist_section">
        <section name="peaklist" title="Peak List" expanded="True">
            <param name="peaklistBool" type="hidden" label="Get the Peak List" value="true" />
            <expand macro="input_peaklist"/>
        </section>
    </xml>

    <xml name="output_peaklist"  token_function="">
        <data name="variableMetadata" format="tabular" label="${image.name[:-6]}.@[email protected]" from_work_dir="variableMetadata.tsv" >
            <filter>peaklist['peaklistBool'] == 'true'</filter>
        </data>
        <data name="dataMatrix" format="tabular" label="${image.name[:-6]}.@[email protected]" from_work_dir="dataMatrix.tsv" >
            <filter>peaklist['peaklistBool'] == 'true'</filter>
        </data>
    </xml>

@lecorguille lecorguille changed the title Draft: Fix xcms_group Draft: Fix xcms_group and xcms_fillpeaks Nov 21, 2023
@lecorguille
Copy link
Member Author

The main changes between the two version : f1f3799

@lecorguille
Copy link
Member Author

@bernt-matthias , do you have an idea?

@bernt-matthias
Copy link
Contributor

It seems to come from: peaklist['peaklistBool'] == 'true'

If I remember correctly then all exceptions raised by filter code are "swallowed" and the filter is evaluated to true.

The traceback indicates that an conditional (probably the select) is the culprit. Is there a way that I can reproduce the error?

The filter seems broken

The best to elucidate this would be to extend the test, e.g. by adding expect_num_outputs to the test tags .. and likely (re)add test cases.

Also odd tat the 3.12.0+galaxy1 are not available on the usegalaxy.* instances.

@lecorguille
Copy link
Member Author

I wasn't able to reproduce this with planemo serve and a refresh install of the tool :/

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