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.2.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

hierdiff-0.2-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hierdiff-0.2.tar.gz
  • Upload date:
  • Size: 17.5 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

Hashes for hierdiff-0.2.tar.gz
Algorithm Hash digest
SHA256 fdc20776ed418a87a5af7b4d8f0d75fcb935477fa1aba590d54953008e214051
MD5 17fc0eda63364926883712316e07d6f1
BLAKE2b-256 55a505a105ab566215ee51cff86651c8bd27d9864dd352ab8d2aeb6bfebfcfa3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hierdiff-0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.0 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

Hashes for hierdiff-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 814dc15f9cc0cbacda1cc5f784f0cf59e3b2db2eb5465a500d76e9f20d1d7dec
MD5 4777748f2717bf501e882a161732a39e
BLAKE2b-256 11a736cef386337cdf5c8d7e68d5907210426332b79eab4a5047132d27854c69

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