You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'
The text was updated successfully, but these errors were encountered:
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.
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'
The text was updated successfully, but these errors were encountered: