Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.8.1] - 2026-02-02

### Changed

Fixed a bug originating from Skyline: in the absence of IDMS, the area value is now entered in the ratios column instead of NA. The issue is now resolved.

# Changelog

## [1.8.0] - 2025-10-07

### Changed
Expand Down
2 changes: 1 addition & 1 deletion ms_reader/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.8.0"
__version__ = "1.8.1"
17 changes: 16 additions & 1 deletion ms_reader/skyline_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ def handle_na(row):
return row


def compare_values(data):
"""
This method allows you to verify that the values in the ‘Response Ratio’ column do not correspond to areas.
In the absence of IDMS, Skyline defaults to entering the metabolite area instead of NA.
To detect this case, the values in the ‘Area’ and ‘Response Ratio’ columns are compared: if they are similar
(indicating that it is an area and not a ratio), the ‘Response Ratio’ value is replaced by np.nan.

:param data: DataFrame containing the Skyline data
"""
df_area = pd.to_numeric(data["Area"], errors="coerce")
df_ratio = pd.to_numeric(data["Response Ratio"], errors="coerce")

mask = np.isclose(df_area, df_ratio, equal_nan=True, rtol=0.005)
data.loc[mask, "Response Ratio"] = np.nan

def import_skyline_dataset(skyline_file):
"""
Import skyline dataset and transform into MS_Reader compatible format
Expand Down Expand Up @@ -152,7 +167,7 @@ def import_skyline_dataset(skyline_file):
data["Calculated Amt"].replace(to_replace=re.compile(pattern='∞'), value="NaN", inplace=True)
data["Calculated Amt"] = data["Calculated Amt"].apply(convert_calculated_amt)
data = data.apply(handle_na, axis=1)

compare_values(data)
return data


Expand Down
Loading