Metadata-Version: 2.1
Name: SNPmanifold
Version: 0.0.9
Summary: SNPmanifold:  Manifold learning for single-cell SNVs
Home-page: https://github.com/StatBiomed/SNPmanifold
Author: ['Kevin Chung', 'Yuanhua Huang']
Author-email: u3570318@connect.hku.hk
License: Apache-2.0
Keywords: Manifold learning,Variational autoencoder,Single-cell single-nucleotide variations,Phylogenetic reconstruction
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anndata>=0.6
Requires-Dist: scanpy
Requires-Dist: leidenalg
Requires-Dist: numpy>=1.18.0
Requires-Dist: scipy>=1.4.1
Requires-Dist: pandas>=0.23.0
Requires-Dist: networkx
Requires-Dist: matplotlib>=3.1.2
Requires-Dist: seaborn>=0.10.0
Requires-Dist: torch
Requires-Dist: scikit-learn>=0.23
Requires-Dist: umap-learn>=0.5.3
Requires-Dist: tqdm
Provides-Extra: docs
Requires-Dist: sphinx_bootstrap_theme; extra == "docs"

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

```bash
# for published version
pip install -U SNPmanifold==0.0.9

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

```bash
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.

```python
from SNPmanifold import SNP_VAE
```

2. Run 4 methods (filtering, training, clustering, phylogeny) in order.

  Each method can rerun sperately without reruning prior methods. 

* The [demo page](https://snpmanifold.readthedocs.io/en/latest/SNPmanifold_demo.html) 
  and notebook [SNPmanifold_demo.ipynb](./SNPmanifold_demo.ipynb) show 
  a demo for quick usage of SNPmanifold on MKN45 cancer cell line using 
  mitochondrial SNPs.

* See how to use it via the [API page](https://snpmanifold.readthedocs.io/en/latest/API.html#main-object).
