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

Add SpecLibFlat Interface for conversion #265

Open
wants to merge 1 commit into
base: refactor-tobase
Choose a base branch
from

Conversation

GeorgWa
Copy link
Collaborator

@GeorgWa GeorgWa commented Jan 4, 2025

Add new speclib flat conversion to SpecLibFlat object and remove old functions

Copy link
Collaborator

@jalew188 jalew188 left a comment

Choose a reason for hiding this comment

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

OOP LGTM

Comment on lines +253 to +254
additional_columns: list | None = None,
charged_frag_types: list | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

unfortunately we still have __python_version__ = ">=3.8" .. should we go to >=3.9 @jalew188 ?

- self._precursor_df["flat_frag_start_idx"],
)
for col, df in df_collection.items():
print(col)
Copy link
Contributor

Choose a reason for hiding this comment

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

accidental print?


def to_SpecLibBase(self):
# raise a deprecation warning
warnings.warn(
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Comment on lines +364 to +368
drop_columns = [
col
for col in ["flat_frag_start_idx", "flat_frag_stop_idx"]
if col in speclib_base._precursor_df.columns
]
Copy link
Contributor

Choose a reason for hiding this comment

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

could be removed by using drop(..., errors="ignore") cf. https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.drop.html

Comment on lines +315 to +316
corresponding _fragment_<column>_df matrix. Including 'mz' in additional_columns will
use observed rather than calculated m/z values.
Copy link
Contributor

Choose a reason for hiding this comment

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

This behaviour (mz) is a bit implicit.
could this be an extra switch (use_observed_mz, defaulting to True) ?

Could users be interested also in the calculated mz values?

import pandas as pd

from alphabase.io.hdf import HDF_File
from alphabase.peptide.fragment import flatten_fragments, remove_unused_fragments
from alphabase.peptide.fragment import (
_create_dense_matrices,
Copy link
Contributor

Choose a reason for hiding this comment

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

this should not be private

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.

4 participants