Skip to main content

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

Build Status PyPI version Coverage Status

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

example

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

hierdiff-0.1.1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

hierdiff-0.1.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file hierdiff-0.1.1.tar.gz.

File metadata

  • Download URL: hierdiff-0.1.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for hierdiff-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fac5ec924697170679862adba61afd2d3d10678921b7e87b669775b6f3d2e27e
MD5 3c99c37599e0a15292dd32e0208e5436
BLAKE2b-256 da4c962413be1c227e7703805823fa56976f1ea47e38088009759731f78df250

See more details on using hashes here.

File details

Details for the file hierdiff-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hierdiff-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

File hashes

Hashes for hierdiff-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf360f6d22238ccdefd916443a48eeccd7dd9ac9ea5e76a5a118e3d60c885b8c
MD5 e97f35a6d0f81e4d73b9155c78979bbe
BLAKE2b-256 f561b6c85d5154377e2a1e4c7a8e0ac5e9c41ee6301e655bdc406eab27038bff

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