tests: remove_zero_variance_vars and remove_contaminants#25
Open
tests: remove_zero_variance_vars and remove_contaminants#25
remove_zero_variance_vars and remove_contaminants#25Conversation
4c32aa6 to
f5c0775
Compare
Collaborator
General
|
idf-io
reviewed
Apr 10, 2026
| with pytest.warns(UserWarning, match=r"at least one group"): | ||
| filtered = remove_zero_variance_vars( | ||
| adata, group_by="group", inplace=False, | ||
| ) |
Collaborator
There was a problem hiding this comment.
Need to check for remaining vars
idf-io
reviewed
Apr 10, 2026
| adata, group_by="group", inplace=False, | ||
| ) | ||
| assert "peptide_id" in filtered.var.columns | ||
| assert "protein_id" in filtered.var.columns |
idf-io
reviewed
Apr 10, 2026
|
|
||
| # ── G. Data type variants ────────────────────────────────────── | ||
|
|
||
| def test_float32_matrix(self): |
Collaborator
There was a problem hiding this comment.
Can you explain the reason behind this test? @leventetn
Remember, you are responsible for every line of code you write.
idf-io
reviewed
Apr 10, 2026
| protein_key="uniprot_id", | ||
| inplace=False, | ||
| ) | ||
| assert list(filtered.var_names) == ["protein_0", "protein_3", "protein_4"] |
Collaborator
There was a problem hiding this comment.
For a more robust test you need to use "uniprot_id"s that don't match the adata.var_names in both name and order. In the current version of the test could have the bug that if the function remove_contaminants uses the adata.var_names even if an alternative protein_key is supplied, the test would still pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.