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

ENH: add actions to filter MAGs #169

Merged
merged 5 commits into from
May 17, 2024
Merged

Conversation

misialq
Copy link
Contributor

@misialq misialq commented May 16, 2024

Closes #160.

Some artifacts useful for testing can be found here.

@misialq misialq requested review from a team and VinzentRisch and removed request for a team May 16, 2024 13:28
Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 96.98795% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 97.78%. Comparing base (06a920b) to head (5df5b4e).
Report is 3 commits behind head on main.

Current head 5df5b4e differs from pull request most recent head 8c43fcb

Please upload reports for the commit 8c43fcb to get more accurate results.

Files Patch % Lines
q2_moshpit/filtering/filter_mags.py 93.44% 4 Missing ⚠️
q2_moshpit/filtering/tests/test_filter.py 98.91% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #169      +/-   ##
==========================================
- Coverage   97.82%   97.78%   -0.04%     
==========================================
  Files          64       67       +3     
  Lines        3534     3700     +166     
==========================================
+ Hits         3457     3618     +161     
- Misses         77       82       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@VinzentRisch VinzentRisch left a comment

Choose a reason for hiding this comment

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

Hi @misialq
I ran it with the provided data with no problems.
I have one suggestion. If I understand correctly the metadata is not optional and has to be provided for the filter actions. If the metadata is not given in the command, the error message is NoneType' object has no attribute 'get_ids, what is not very informative. I would add a check that raises an error if metadata is None, with an informative error message.
Apart from that all looks good! :)

@misialq
Copy link
Contributor Author

misialq commented May 17, 2024

Hey @VinzentRisch, thanks, good catch! Actually, it does not make much sense for the metadata to be optional - otherwise, there's nothing to filter on... I just turned it into a required argument - hope that addresses your comment ;)

@VinzentRisch
Copy link
Contributor

Ah yeah that makes sense.
Now I'm thinking that where should also be mandatory.
I saw that if where is None then an artifact is returned with all the original Mags.
But this does not have any application right? It just copies the artifact. So i dont think that where should be allowed to be None.

@misialq
Copy link
Contributor Author

misialq commented May 17, 2024

No, it should not be mandatory. You can also provide a metadata file which contains the IDs you want to filter on - there is no need to provide the "where" condition in such a case (you may already have a metadata table which is pre-filtered). This is explained in the help description of metadata and where parameters.

@VinzentRisch
Copy link
Contributor

Ah okay that makes sense.

Copy link
Contributor

@VinzentRisch VinzentRisch left a comment

Choose a reason for hiding this comment

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

Looks good :)

@misialq misialq merged commit bd0d596 into bokulich-lab:main May 17, 2024
4 of 6 checks passed
@misialq misialq deleted the filter-mags-derep branch May 17, 2024 11:16
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.

ENH: add an action to filter SampleData[MAGs] and FeatureData[MAG]
2 participants