Clustering high-dimensional instances (e.g. T cell receptors) and testing whether clusters of instances are differentially abundant in two or more categorical conditions, with interactive tree visualization.
Project description
hierdiff
A package that is useful for clustering high-dimensional instances (e.g. T cell receptors) and testing whether clusters of instances are differentially abundant in two or more categorical conditions. The package provides d3/SVG rendering of scipy hierarchical clustering dendrograms with zooming, panning and tooltips. This uniquely allows for exploring large trees of datasets, conditioned on a categorical trait.
Installation
pip install hierdiff
Example
import hierdiff
from scipy.spatial.distance import squareform
"""Contains categorical variable column 'trait1' and
instance counts in 'count'"""
dat, pwdist = generate_data()
res, Z = hierdiff.hcluster_tally(dat,
pwmat=squareform(pwdist),
x_cols=['trait1'],
count_col='count',
method='complete')
res = hierdiff.cluster_association_test(res, method='fishers')
"""Plot frequency of trait at nodes with p-value < 0.05"""
html = plot_hclust_props(Z, title='test_props2',
res=res, alpha=0.05, alpha_col='pvalue')
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 hierdiff-0.4.tar.gz
.
File metadata
- Download URL: hierdiff-0.4.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | baee84ac62dbc690ed14777692af56222999b3138082bbc4323e15678a16a4f5 |
|
MD5 | e44880017a7d4ff035a695dcc9856278 |
|
BLAKE2b-256 | 45b171589e8e627771cf4621026cff6e8007b7c4b0f45d1a80f0379438c66ad5 |
File details
Details for the file hierdiff-0.4-py3-none-any.whl
.
File metadata
- Download URL: hierdiff-0.4-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69d490500edb888aa15bb8c3414ee8a9bf3243867daba3b204b46edbc00a7cae |
|
MD5 | ad9a43164911c37fb07a95393cdaedd8 |
|
BLAKE2b-256 | c6029baeda84ffa83900f6c6d8655ce4ecc50965326f6b2eb15e934c5124c3a3 |