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

transfer library building with diverse frag types #423

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

GeorgWa
Copy link
Collaborator

@GeorgWa GeorgWa commented Jan 5, 2025

Requires unrelease alphabase features (MannLabs/alphabase#265)

Adapts alphaDIA to allow transfer library building with arbitrary frag types.

@GeorgWa GeorgWa requested review from mo-sameh and mschwoer January 5, 2025 11:41
Copy link
Collaborator

@mo-sameh mo-sameh left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1154,7 +1154,7 @@ def requantify_fragments(
config = plexscoring.CandidateConfig()
config.update(
{
"top_k_fragments": 1000, # Use all fragments ever expected, needs to be larger than charged_frag_types(8)*max_sequence_len(100?)
"top_k_fragments": 9999, # Use all fragments ever expected, needs to be larger than charged_frag_types(8)*max_sequence_len(100?)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not add an order of magnitude here just to be on the safe side ;-)

number_of_processes=number_of_processes,
processing_kwargs={
"charged_frag_types": fragment.get_charged_frag_types(
self.config["transfer_library"]["fragment_types"].split(";"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

note that this is not compatible with #424

charged_frag_types: list[str] | None = None,
) -> SpecLibFlat:
"""
Parse an output folder and return a SpecLibFlat object containing the precursor and fragment data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

parse a folder? maybe be a bit more specific here

Comment on lines +108 to +109
foldername = os.path.basename(folder)
psm_df["raw_name"] = foldername
Copy link
Collaborator

Choose a reason for hiding this comment

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

(nit) psm_df["raw_name"] = os.path.basename(folder)

_ = pool.apply_async(
process_folder,
(folder,),
self._processing_kwargs,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this looks wrong (but isn't, I know ;-))
maybe

args=(folder,),
kwds=self._processing_kwargs,

Comment on lines +114 to +116
speclib._precursor_df = pd.DataFrame()
for col in psm_df.columns:
speclib._precursor_df[col] = psm_df[col]
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason why we not just (deep)copy here?

) -> tuple[pd.DataFrame, pd.DataFrame]:
"""
Parse the output folder to get a precursor and fragment dataframe in the flat format.
def process_folder(
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we find a more specific name here? build_speclibflat_from_folder?

Comment on lines +315 to 318
# semicolon separated list of fragment types to include in the library. possible values are
# 'a', 'b', 'c', 'x', 'y', 'z'
# 'b_H2O', 'y_H2O', 'b_NH3', 'y_NH3', 'b_modloss', 'y_modloss', 'c_lossH', 'z_addH'
fragment_types: 'b;y'
Copy link
Collaborator

Choose a reason for hiding this comment

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

note that this will cause a merge conflict with #424 .. maybe omit it here to make life easier (assuming it's the same information that is added)

@mschwoer mschwoer deleted the branch main January 17, 2025 09:26
@mschwoer mschwoer closed this Jan 17, 2025
@mschwoer mschwoer reopened this Jan 17, 2025
@GeorgWa GeorgWa changed the base branch from development to main January 17, 2025 13:19
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