Skip to content

PercolatorTabWriter style issue #114

@carolinelennartsson

Description

@carolinelennartsson

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'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions