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 batch correction methods, Scanpy 1.6-specific things #86

Merged
merged 32 commits into from
Aug 23, 2020

Conversation

pinin4fjords
Copy link
Member

@pinin4fjords pinin4fjords commented Aug 11, 2020

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).

@pinin4fjords pinin4fjords changed the base branch from develop to feature/update_for_1.5.1 August 11, 2020 15:47
@pinin4fjords pinin4fjords changed the title [WIPupdate for 1.5.2 [WIP] update for 1.5.2 + new features Aug 11, 2020
@pinin4fjords pinin4fjords changed the title [WIP] update for 1.5.2 + new features [WIP] update for 1.5.2(?) + new features Aug 14, 2020
@pinin4fjords pinin4fjords changed the title [WIP] update for 1.5.2(?) + new features Add batch correction methods Aug 14, 2020
@pinin4fjords pinin4fjords changed the title Add batch correction methods Add batch correction methods, Scanpy 1.6-specific things Aug 14, 2020
@pinin4fjords pinin4fjords requested review from nh3 and pcm32 August 18, 2020 10:12
@pinin4fjords pinin4fjords changed the base branch from feature/update_for_1.5.1 to develop August 18, 2020 12:32

# Wrapper for mnn allowing use of non-standard slot

def combat(adata, key=None, key_added=None, layer=None, **kwargs):
Copy link
Member

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.

Copy link
Member Author

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',
Copy link
Member

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?

Copy link
Member Author

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).

@pcm32
Copy link
Member

pcm32 commented Aug 19, 2020

In principle it LGTM, but I guess that @nh3 is the most indicated person to review this.

scanpy_scripts/cmds.py Outdated Show resolved Hide resolved
scanpy_scripts/cmds.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@nh3 nh3 left a 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!

@pinin4fjords
Copy link
Member Author

Thanks @nh3 @pcm32 !

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