8000 PercolatorTabWriter style issue · Issue #114 · CompOmics/psm_utils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PercolatorTabWriter style issue #114

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

Closed
carolinelennartsson opened this issue Feb 3, 2025 · 2 comments · Fixed by #117
Closed

PercolatorTabWriter style issue #114

carolinelennartsson opened this issue Feb 3, 2025 · 2 comments · Fixed by #117
Assignees
Labels
bug Something isn't working
Milestone

Comments

@carolinelennartsson
Copy link

Hej, thanks for a nice library. :) I am trying to convert and write to Percolator pin format but I seem to get some issues related to the style parameter.


AttributeError Traceback (most recent call last)
Cell In[18], line 2
1 # Save as Percolator-compatible format
----> 2 writer = PercolatorTabWriter(output_file, "pin") # , add_basic_features = True
3 writer.write(psm_list)
5 print(f"Converted file saved as {output_file}")

File ~/miniconda3/lib/python3.11/site-packages/psm_utils/io/percolator.py:250, in PercolatorTabWriter.init(self, filename, style, feature_names, add_basic_features, *args, **kwargs)
244 else:
245 raise PercolatorIOException(
246 f"Could not infer Percolator Tab style from file extension {suffix}. "
247 "Please provide the style parameter."
248 )
--> 250 if self.style == "pin":
251 basic_features = ["PSMScore", "ChargeN"] if add_basic_features else []
252 self._columns = (
253 ["SpecId", "Label", "ScanNr"]
254 + basic_features
255 + self.feature_names
256 + ["Peptide", "Proteins"]
257 )

AttributeError: 'PercolatorTabWriter' object has no attribute 'style'

@carolinelennartsson
Copy link
Author

Update: Using the '.pin' extension worked.

@RalfG
Copy link
Member
RalfG commented Mar 6, 2025

Hi Caroline!

Thanks for reporting! This was indeed a bug. If style is not passed explicitly, it is inferred from the file extension. This is why it did work in your update. However, if it was passed, no inference happened (as intended), but the value was still not set when it should have been.

Will be fixed in the upcoming release.

Best,
Ralf

@RalfG RalfG self-assigned this Mar 6, 2025
@RalfG RalfG added the bug Something isn't working label Mar 6, 2025
@RalfG RalfG added this to the v1.4.0 milestone Mar 6, 2025
@RalfG RalfG closed this as completed in #117 Mar 6, 2025
@RalfG RalfG closed this as completed in e4aa4bc Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants
0