Skip to main content

SNPmanifold: Manifold learning for single-cell SNVs

Project description

SNPmanifold

SNPmanifold is a Python package that learns a representative manifold for single cells based on their SNPs (Single-Nucleotide Polymorphisms) using VAE (Variational AutoEncoder) and UMAP (Uniform Manifold Approximation and Projection). It takes AD matrix, DP matrix, and VCF (or variant_name.tsv) as inputs. You can compile them from bam file(s) either conveniently by cellSNP-lite or by your custom scripts.

SNPmanifold first performs simple filtering on AD matrix and DP matrix for high-quality cells and SNPs. It then trains VAE and UMAP to learn a representative manifold for single cells according to their allele frequency of different SNPs (AF = AD/DP). Finally, it classifies cells into clones and infer their phylogeny based on the manifold.

Installation

Quick install can be achieved via pip (python 3.8 needed)

# for published version
pip install -U SNPmanifold

# or developing version
pip install -U git+https://github.com/StatBiomed/SNPmanifold

Or set a conda environment before installing (credits to Xinyi Lin). Replace $myenv with the environment name you prefer.

conda create -n $myenv python=3.8
conda activate $myenv

pip install -U git+https://github.com/StatBiomed/SNPmanifold

Quick Usage

Full documentation is at https://SNPmanifold.readthedocs.io.

Here is a quick start:

  1. Import SNPmanifold and create an object of the class SNP_VAE.
from SNPmanifold import SNP_VAE
  1. Run 4 methods (filtering, training, clustering, phylogeny) in order.

Each method can rerun sperately without reruning prior methods.

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

snpmanifold-0.0.8.tar.gz (23.0 kB view details)

Uploaded Source

File details

Details for the file snpmanifold-0.0.8.tar.gz.

File metadata

  • Download URL: snpmanifold-0.0.8.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.20

File hashes

Hashes for snpmanifold-0.0.8.tar.gz
Algorithm Hash digest
SHA256 37a40d9e524adadeb8499efa8c27b87562b26296a61cc3731d899ceaafa815b2
MD5 4af0d7c127475aaf297e8d3f1b38c673
BLAKE2b-256 843d849c292e5b794ee403c86b6c14805f64ee7bdccf8adad5f5e13a3094a4bd

See more details on using hashes here.

Supported by

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