-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
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.
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?) |
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.
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(";"), |
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.
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. |
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.
parse a folder? maybe be a bit more specific here
foldername = os.path.basename(folder) | ||
psm_df["raw_name"] = foldername |
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.
(nit) psm_df["raw_name"] = os.path.basename(folder)
_ = pool.apply_async( | ||
process_folder, | ||
(folder,), | ||
self._processing_kwargs, |
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 looks wrong (but isn't, I know ;-))
maybe
args=(folder,),
kwds=self._processing_kwargs,
speclib._precursor_df = pd.DataFrame() | ||
for col in psm_df.columns: | ||
speclib._precursor_df[col] = psm_df[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.
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( |
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 we find a more specific name here? build_speclibflat_from_folder
?
# 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' |
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.
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)
Requires unrelease alphabase features (MannLabs/alphabase#265)
Adapts alphaDIA to allow transfer library building with arbitrary frag types.