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 arguments and filters to the calculate_msN_summary functions #856

Closed
wants to merge 1 commit into from

Conversation

bkieft-usa
Copy link
Collaborator

Per @benbowen 's email on April 12, 2024:

There should be an optional argument for whether to filter by 'in_feature'==True.

Also lately, I find the requirement of grouping by 'label' annoying. Is there a way to help people out by adding a label to each row if the person forgot to include that as an attribute upstream could be nice.

The former request was addressed by adding an optional argument to the function where rows are not automatically filtered by in_feature before calculating summaries (argument default is True which mimics previous behavior of function).

The latter request was addressed by an if statement within the function to add a fake ("Untitled") label so that calling the summary function with this column missing won't error out.

@benbowen
Copy link
Member

I think that the labels have to be unique. maybe use a resetindex with drop=false or something similar to automatically assign labels.

The group_duplicates function is intended to handle the making of ms2 spectra. Instead of calling it calculate_ms2_summary, call it unflatten_ms2_spectra and use group_duplicates

I'm not sure, but I think the slicing you are doing on in_label needs to have a .copy().

@bkieft-usa
Copy link
Collaborator Author

I guess we'll need to have a review of the possible uses of these functions - since I've never used them in the wild I only have a narrow view of how they work from the prefilter code and how they interact within feature_tools.py. We can talk about this at the metabolomics meeting.

@bkieft-usa bkieft-usa closed this Apr 15, 2024
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