Skip to main content

Scalable Visualization of Massive Single-Cell DataUsing Neural Networks

Project description

Build Status Documentation Status

This is an applicable version for NeuralEE.

  1. The datasets loading and preprocessing module is modified from scVI.

  2. Define NeuralEE class and some auxiliary function, mainly for cuda computation, except like entropic affinity calculation which is quite faster computed on cpu.

  3. General elastic embedding algorithm on cuda is given based on matlab code from Max Vladymyrov.

  4. Add some demos of notebook helping to reproduce.

Installation

  1. Install Python 3.7.

  2. Install PyTorch. If you have an NVIDIA GPU, be sure to install a version of PyTorch that supports it. NeuralEE runs much faster with a discrete GPU.

  3. Install NeuralEE through pip or from GitHub:

pip install neuralee
git clone git://github.com/HiBearME/NeuralEE.git
cd NeuralEE
python setup.py install --user

Tutorial

from neuralee.dataset import CortexDataset
from neuralee.embedding import NeuralEE

import torch

# detect whether to use GPU.
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

# 1 load dataset.
cortex_dataset = CortexDataset(save_path='../data/')

# 2 preprocess dataset. logarithm transformation, genes subsample and standard scale.
cortex_dataset.log_shift()
cortex_dataset.subsample_genes(558)
cortex_dataset.standardscale()

# 3 embedding.
# 3.1 not using mini-batch trick, if dataset is not large.
# 3.1.1 calculate weights matrix
cortex_dataset.affinity()

# 3.1.2 initialize NeuralEE class.
NEE = NeuralEE(cortex_dataset, device=device)

# 3.1.3.1 elastic embedding.
results = NEE.EE()

# 3.1.3.2 NeuralEE.
results_Neural = NEE.fine_tune()

# 3.2 introduce mini-batch trick.
# 3.2.1 calculate weights matrix on each batch.
cortex_dataset.affinity_split(N_small=0.25)

# 3.2.2 initialize NeuralEE class.
NEE = NeuralEE(cortex_dataset, device=device)

# 3.2.3 elastic embedding.
results_Neural_with4batches = NEE.fine_tune()

For more detailed tutorials and reproduction of original paper’s results, check at notebook files.

Examples

HEMATO

NeuralEE of HEMATO

BRAIN LARGE

NeuralEE of BRAIN LARGE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuralee-0.1.4.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

neuralee-0.1.4-py2.py3-none-any.whl (36.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file neuralee-0.1.4.tar.gz.

File metadata

  • Download URL: neuralee-0.1.4.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.3

File hashes

Hashes for neuralee-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b08643c8c021b809f29b37f2658f0494775eed1ffbb93baa598d2a91a9ba2401
MD5 dea59a1b2d5db252965e62159330e2cd
BLAKE2b-256 18a3fdd22e2444a9d7dee7b52f674aa29e8c31f2da2559d59ab60135753b3eb4

See more details on using hashes here.

File details

Details for the file neuralee-0.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: neuralee-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 36.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.3

File hashes

Hashes for neuralee-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7524d1334abb4731b9a4ee425f18055c4df46ee23c544fc4e3f65da914eb7585
MD5 3efe868e581b1b7aa197827e72048525
BLAKE2b-256 2eda93ccec56dd8804c8890738af45ed242a45ee6b18d55f777730b7366c7722

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page