-
Notifications
You must be signed in to change notification settings - Fork 673
Add warning for rank_genes_groups #3792
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
Open
grst
wants to merge
2
commits into
main
Choose a base branch
from
rank-genes-groups-warning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Add a warning message to :func:`~scanpy.tl.rank_genes_groups` that it is not | ||
appropriate for most use-cases. |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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 scenario in which you would want to use
rank_genes_groups
?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.
I don't think it should be included in scanpy 2.0 in its current form.
Happy to hear other opinions, e.g. from @Zethson
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.
Yes and no. I think it is valuable for scanpy to have something built in, that allows you to check DEGs without requiring other packages. E.g., I sometimes use it together with dotplots to quickly check that my clusters capture some cell types I expect in the data as a sort of soft quality control step when just quickly exploring some data in a notebook, before running a proper analysis. Theoretically, there is also the use case of having an AnnData object where the observations are samples, not cells. In that case, it would still not be an ideal solution for single-cell RNA-sequencing, but there are other modalities that could be represented as AnnData objects for which the assumptions of PyDESeq2 and other algorithms don't hold. I am however unconvinced that anybody actually uses it like that and this benefit may not outway the risk of having a incredibly high false positivity rate on many scRNAseq datasets if this function is left in and people end up using it.
Uh oh!
There was an error while loading. Please reload this page.
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.
Use case 2 that Gregor mentioned immediately came to my mind and there's also benchmarking papers that back that up (Wilcoxon does well).
I agree with Gregor that something has to be done. A warning can be pretty intrusive though because lots of downstream scverse ecosystem tools use it and some even loop over it which would lead to tons of clutter and warnings. I wonder whether an alternative would be to have a rudimentary optional and simple pydeseq2 interface while adding a fat warning in our API docs & tutorials about the usage of the simpler
rank_genes_groups
options.I think that scanpy users are fine with optional dependencies. Leiden & igraph etc also have to be installed explicitly.
Uh oh!
There was an error while loading. Please reload this page.
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.
Having scanpy not cover DEGs (arguably the main output of any scRNAseq analysis) feels like an important limitation of the package. From reading raw data up to clustering and annotating clusters, everything can be done in pure scanpy/AnnData (at least a basic version of it). But the main desired result cannot be produced and it is quite unclear from the scanpy documentation how it can be achieved. Searching for "pseudobulk" in the scanpy docs yields just one uninformative result. The best practices guide does not cover the current state-of-the-art. Decoupler's documentation does cover it, but that is a different package. Since scanpy will be used by many beginners and biologists venturing into computational biology, this feels a bit inadequate.
Edit: Limited wifi on train, apologies for repeated points and messed up message order. I did not see anything before sending my comments.
Uh oh!
There was an error while loading. Please reload this page.
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.
Overhauling the DE content in BP has been on our radar for a while! It will happen soonish, trust me haha. The best practice notebook also has a lot more details and references that shouldn't matter for a scanpy tutorial. I'd keep them separate for now.
Although I just merged a PR that removes scvi-tools from pertpy which makes it much leaner, I would not build a scanpy tutorial on pertpy. I agree with Malte that a native scanpy solution is useful and our users kind of expect it.
I think a future with a pure and powerful DE package, which Gregor envisions, and a simple scanpy solution, is a good future.
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.
I don't think we'd need decoupler in this equation. Pseudobulk is now handled by scanpy and then use PyDESeq2 from there.
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.
I think we all agree what a good solution looks like, the issue here is more how we get the users to adopt them.
Uh oh!
There was an error while loading. Please reload this page.
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.
+
Sounds like we should do a scanpy tutorial then built on PyDESeq2 + scanpy?
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.
sounds good. And add warning boxes with references to that tutorial in the 3k PBMC tutorial and the rank_genes_groups function