Pytorch implementation of Harmony algorithm on single-cell sequencing data integration
Project description
This is a Pytorch implementation of Harmony algorithm on single-cell sequencing data integration. Please see [Ilya Korsunsky et al., 2019](https://www.nature.com/articles/s41592-019-0619-0) for details.
Installation
This package is published on PyPI:
pip install harmony-pytorch
Usage
General Case
Given an embedding X as a N-by-d matrix (N for number of cells, d for embedding components) and cell attributes as a Data Frame df_metadata, use Harmony for data integration as the following:
from harmony import harmonize Z = harmonize(X, df_metadata, batch_key = 'Channel')
where Channel is the attribute in df_metadata for batches.
Alternatively, if there are multiple attributes for batches, write:
Z = harmonize(X, df_metadata, batch_key = ['Lab', 'Date'])
Input as AnnData Object
It’s easy for Harmony-pytorch to work with annotated count matrix data structure from anndata package. Let adata be an AnnData object in Python:
from harmony import harmonize Z = harmonize(adata.obsm['X_pca'], adata.obs, batch_key = 'Channel') adata.obsm['X_harmony'] = Z
For details about AnnData data structure, please refer to its documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file harmony-pytorch-0.1.0.tar.gz
.
File metadata
- Download URL: harmony-pytorch-0.1.0.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e0d6fb1ca1538f738c49002f08e7846a968d6abd6e21894b53faa13eafddfde |
|
MD5 | 9a8a35fa33e58753fe179df45ee6e82c |
|
BLAKE2b-256 | 9c4a95ec280ca080b77f5a8d117e22c5e357213e335c599d5e9cf6abc49a8b9d |
File details
Details for the file harmony_pytorch-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: harmony_pytorch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c92ca88f8422842041703b3e92ec6b0990ffb039909ed39dc9e8054e1a2e9962 |
|
MD5 | ab2babdcaf6a59285d763748b14c649e |
|
BLAKE2b-256 | 42f4b616898fa372604a116a4ad2700569cc13eaf7a12958dae1822d80ea4a5f |