-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: refactor-tobase
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOP LGTM
additional_columns: list | None = None, | ||
charged_frag_types: list | None = None, |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
drop_columns = [ | ||
col | ||
for col in ["flat_frag_start_idx", "flat_frag_stop_idx"] | ||
if col in speclib_base._precursor_df.columns | ||
] |
There was a problem hiding this comment.
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
corresponding _fragment_<column>_df matrix. Including 'mz' in additional_columns will | ||
use observed rather than calculated m/z values. |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
Add new speclib flat conversion to SpecLibFlat object and remove old functions