Skip to content

Commit

Permalink
Spectronaut column delimeter
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaS92 committed Sep 18, 2024
1 parent 0c2b5d4 commit f930586
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions alphastats/loader/SpectronautLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import re
import warnings

SPECTRONAUT_COLUMN_DELIM = "."


class SpectronautLoader(BaseLoader):
"""Loader for Spectronaut outputfiles"""
Expand Down Expand Up @@ -72,7 +74,9 @@ def __init__(
if self.sample_column is not None:
self.rawinput = self._reshape_long_to_wide()

self.intensity_column = "[sample]." + self.intensity_column
self.intensity_column = (
"[sample]" + SPECTRONAUT_COLUMN_DELIM + self.intensity_column
)

self._add_contamination_column()
self._read_all_columns_as_string()
Expand All @@ -83,7 +87,9 @@ def _reshape_long_to_wide(self):
reshape to a wider format
"""
self.rawinput["sample"] = (
self.rawinput[self.sample_column] + "." + self.intensity_column
self.rawinput[self.sample_column]
+ SPECTRONAUT_COLUMN_DELIM
+ self.intensity_column
)
indexing_columns = [self.index_column]
if self.gene_names is not None:
Expand Down

0 comments on commit f930586

Please sign in to comment.