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.85.tar.gz
.
File metadata
- Download URL: hierdiff-0.85.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2009a27e5e878b447bccbfa8981b715958fd7d6e29eae6ca473db2f35409298a |
|
MD5 | 90dbe73498a3bb78d7d2fbee11f46da4 |
|
BLAKE2b-256 | a8e650b21c82dc08f6ed0390913916de4535f165f23e0a7b90de7ab631c283b3 |
File details
Details for the file hierdiff-0.85-py3-none-any.whl
.
File metadata
- Download URL: hierdiff-0.85-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94672c639e6007c1adf1ecd8e9d707dfe37af218859fb50e0078a783bc4533e1 |
|
MD5 | bc8a2cbbabee803531a656afe9a33a7d |
|
BLAKE2b-256 | 92604c30b5dce11db9b8533fc639b8993ebc00fb86a6f658bede5cf112324383 |