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

matchms_formatter only works when 'compound_name' is present #444

Closed
chufz opened this issue Nov 23, 2023 · 6 comments
Closed

matchms_formatter only works when 'compound_name' is present #444

chufz opened this issue Nov 23, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@chufz
Copy link

chufz commented Nov 23, 2023

Currently, the formatter only works when compound_name is given. However, sometimes spectral similarity is calculated without known compounds, leading to the error message:

  File "/gpfs1/data/galaxy_server/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/recetox/matchms_formatter/37da26e798f2/matchms_formatter/formatter.py", line 51, in <module>
    cli()
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1646, in invoke
    super().invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/gpfs1/data/galaxy_server/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/recetox/matchms_formatter/37da26e798f2/matchms_formatter/formatter.py", line 45, in cli
    result = load_data(scores_filename)
  File "/gpfs1/data/galaxy_server/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/recetox/matchms_formatter/37da26e798f2/matchms_formatter/formatter.py", line 36, in load_data
    scores = scores_to_dataframe(scores)
  File "/gpfs1/data/galaxy_server/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/recetox/matchms_formatter/37da26e798f2/matchms_formatter/formatter.py", line 19, in scores_to_dataframe
    data.append([scores.queries[col].metadata['compound_name'], scores.references[row].metadata['compound_name'], *scores.scores.data[i]])
KeyError: 'compound_name' ```
@hechth
Copy link
Member

hechth commented Nov 24, 2023

@chufz have you tried running matchms convert or filter on your inputs? that might help

@chufz
Copy link
Author

chufz commented Nov 24, 2023

Yes i converted with matchms convert to the msp in matchms format in advance

@hechth
Copy link
Member

hechth commented Nov 27, 2023

Okay - we can add an option to choose a different column

@bgruening
Copy link
Collaborator

data_column might be useful here: https://docs.galaxyproject.org/en/latest/dev/schema.html#id33

@hechth hechth added the bug Something isn't working label Feb 22, 2024
@hechth
Copy link
Member

hechth commented May 31, 2024

@zargham-ahmad is this still the case? Didn't we include a key in the latest version?

@zargham-ahmad
Copy link
Collaborator

@hechth yes, this can be closed we added an optional key parameter in the latest version

@hechth hechth closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants