Skip to content

Commit

Permalink
add again what was lost by the failed merge commit 97613f1
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Nov 15, 2024
1 parent 97613f1 commit a711aff
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.4.0
current_version = 1.4.1
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
2 changes: 1 addition & 1 deletion alphabase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


__project__ = "alphabase"
__version__ = "1.4.0"
__version__ = "1.4.1"
__license__ = "Apache"
__description__ = "An infrastructure Python package of the AlphaX ecosystem"
__author__ = "Mann Labs"
Expand Down
18 changes: 18 additions & 0 deletions alphabase/psm_reader/maxquant_reader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import warnings
from typing import Optional

import numba
Expand All @@ -13,6 +14,9 @@
psm_reader_yaml,
)

# make sure all warnings are shown
warnings.filterwarnings("always")

mod_to_unimod_dict = {}
for mod_name, unimod_id in MOD_DF[["mod_name", "unimod_id"]].values:
unimod_id = int(unimod_id)
Expand Down Expand Up @@ -249,6 +253,20 @@ def _load_file(self, filename):
self._find_mod_seq_column(df)
df = df[~pd.isna(df["Retention time"])]
df.fillna("", inplace=True)

# remove MBR PSMs as they are currently not supported and will crash import
mapped_columns = self._find_mapped_columns(df)
if "scan_num" in mapped_columns:
scan_num_col = mapped_columns["scan_num"]
no_ms2_mask = df[scan_num_col] == ""
if (num_no_ms2_mask := np.sum(no_ms2_mask)) > 0:
warnings.warn(
f"Maxquant psm file contains {num_no_ms2_mask} MBR PSMs without MS2 scan. This is not yet supported and rows containing MBR PSMs will be removed."
)
df = df[~no_ms2_mask]
df.reset_index(drop=True, inplace=True)
df[scan_num_col] = df[scan_num_col].astype(int)

# if 'K0' in df.columns:
# df['Mobility'] = df['K0'] # Bug in MaxQuant? It should be 1/K0
# min_rt = df['Retention time'].min()
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
copyright = "2022, Mann Labs, MPIB"
author = "Mann Labs, MPIB"

release = "1.4.0"
release = "1.4.1"

# -- General configuration ---------------------------------------------------

Expand Down

0 comments on commit a711aff

Please sign in to comment.