-
Notifications
You must be signed in to change notification settings - Fork 13
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 batch correction methods, Scanpy 1.6-specific things #86
Conversation
…ated fields to common
… exhangeable Loom (incompatible with latest annData) and use native non-exchangeable Scanpy Loom export instead
…nd to flavor = 'seurat_v3'
…sion-group/scanpy-scripts into feature/update_for_1.5.2
|
||
# Wrapper for mnn allowing use of non-standard slot | ||
|
||
def combat(adata, key=None, key_added=None, layer=None, **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.
I'm guessing that this is using Combat_seq right? or is it applicable on differential expression results? My understanding is that the origina Combat was written for microarrays continuous real data and is not directly applicable to non-negative discrete count 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.
This is just a wrapper around Scanpy's own function: https://scanpy.readthedocs.io/en/stable/api/scanpy.pp.combat.html, derived from https://github.com/brentp/combat.py.
People got very excited about the discrete thing with sequencing at the start, but my understanding is that subsequent testing indicted that in practice the issue was not such a big deal.
@@ -41,12 +41,15 @@ | |||
'matplotlib', | |||
'pandas', | |||
'h5py', | |||
'scanpy>=1.5.1,<1.6.0', |
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.
do we plan to do a release with 1.5.x or will we just skip it?
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.
Some of the changes here are 1.6.0-specific, so will need this pin. I released a 1.5.1 compatible version yesterday (though without the batch stuff implemented here).
In principle it LGTM, but I guess that @nh3 is the most indicated person to review this. |
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 too. Great job again!
Predominantly the batch correction methods we're after:
I've tried to make the interfaces consistent where appropriate. In reference to previous patterns (if not entirely consistently with default behaviour in Scanpy itself), I've stored results in custom slots by default, e.g. layers, rather than at e.g. .X. Of course we could change the default behaviour to match Scanpy pretty easily.
Harmony became available in the latest Scanpy release (1.6.0).