Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove maxquant MBR rows #229

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open

remove maxquant MBR rows #229

wants to merge 3 commits into from

Conversation

GeorgWa
Copy link
Collaborator

@GeorgWa GeorgWa commented Nov 4, 2024

currently alphabase fails for maxquant output which contains MBR PSMs.
This removes MBR PSMs and prints an explicit warning

@@ -11,6 +12,8 @@
psm_reader_yaml,
)

warnings.filterwarnings("always")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could the scope of this be reduced, e.g. to a specific code block and/or specific warnings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you know more about this.
This code is needed to enforce that warning are shown because it's somehow not happening.
So it's not removing warnings but showing them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I misinterprested this as "filter always" .. then it's fine, maybe add the information that warnings are otherwise not shown as a comment ..

)
df = df[~no_ms2_mask]
df.reset_index(drop=True, inplace=True)
df[scan_num_col] = df[scan_num_col].astype(int)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we don't hit the if "scan_num" in mapped_columns: block: will the type of scan_num_col still be int?
or turning it around: we should make sure all columns' dtypes are consistent, and independent of the inner logic of the reader.

if "scan_num" in mapped_columns:
scan_num_col = mapped_columns["scan_num"]
no_ms2_mask = df[scan_num_col] == ""
if np.sum(no_ms2_mask) > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit)
if (num_no_ms2_mask := np.sum(no_ms2_mask)) > 0:

Base automatically changed from maxquant-update to development November 7, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants