Skip to content

new: DIANN support + datashare example files - #22

Merged
GeorgWa merged 4 commits into
GeorgWa:mainfrom
boopthesnoot:diann_support
Oct 1, 2025
Merged

GeorgWa merged 4 commits into
GeorgWa:mainfrom
boopthesnoot:diann_support

Conversation

@boopthesnoot

@boopthesnoot boopthesnoot commented Aug 29, 2025 •

Copy link
Copy Markdown
Contributor

todo: update dependencies and docker because now we need to have the latest alphaDIA version from github (what is now called alphadia.raw_data used to not be called that)

@mschwoer mschwoer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

very cool!

Comment thread notebooks/src/io.py Resolved
Comment thread notebooks/src/io.py Resolved
Comment thread notebooks/src/io.py Resolved
Comment thread notebooks/src/io.py Resolved
Comment thread notebooks/src/slicer.py Outdated

def _add_missing_indices(self):
"""Add frame/scan indices if missing"""
if "frame_start" in self.precursor_df.columns:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could be made more robust:

required_columns = ["frame_start","frame_stop","scan_start", "scan_stop"]

if all([col in self.precursor_df.columns for col in required_columns]):
  return
if any(....)
  inconsistent state? raise?

for idx, row...

Comment thread notebooks/src/slicer.py Resolved
Comment thread notebooks/src/io.py Outdated
@@ -1,33 +1,46 @@
import os
from pathlib import Path
from typing import Any

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ad PR description: why do we need a different alphadia version? which one?

@GeorgWa GeorgWa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

very cool! Looks good to merge to me

Comment thread notebooks/src/diann_io.py Outdated
if "nce" in dia_data.spectrum_df.columns and not dia_data.spectrum_df.empty:
nce = float(dia_data.spectrum_df["nce"].max())
else:
raise ValueError("dia_data.spectrum_df lacks an 'nce' column or is empty")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

you could default to something like 28 here

Comment thread notebooks/src/diann_io.py
raise ValueError("dia_data.spectrum_df lacks an 'nce' column or is empty")

register_readers()
modification_mapping = {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

could we instead add them to the default alphabase diann mapping?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, i'll remove them from here after the alphabase PR would be merged and we'll get an alphabase release

Comment thread notebooks/src/diann_io.py Outdated
speclib_base.precursor_df = precursor_df
speclib_base.calc_fragment_mz_df()

speclib_base.precursor_df["nAA"] = speclib_base.precursor_df["sequence"].str.len()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

you could use:

res = tune_mgr.model_mgr(transfer_lib.precursor_df.copy(), predict_items=['ms2'])

precursor_df = res['precursor_df']
fragment_df = res['fragment_mz_df']
fragment_df = res['fragment_intensity_df']

Which would give you the nAA,frag_start_idx,frag_stop_idx and might have a bit less coupling to inner workings of peptdeep/alphabase

@GeorgWa
GeorgWa merged commit cc070db into GeorgWa:main Oct 1, 2025
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.

3 participants