Skip to main content

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

Metadata

Release files for hierdiff 0.85

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hierdiff 0.85
File Size Uploaded
hierdiff-0.85.tar.gz 24.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hierdiff 0.85
File Interpreter ABI Platform
hierdiff-0.85-py3-none-any.whl Python 3 none any Details

Total release size: 51.7 kB

Release files / hierdiff-0.85.tar.gz

Download URL hierdiff-0.85.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2009a27e5e878b447bccbfa8981b715958fd7d6e29eae6ca473db2f35409298a
BLAKE2b-256 checksum
How to use checksums
a8e650b21c82dc08f6ed0390913916de4535f165f23e0a7b90de7ab631c283b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release files / hierdiff-0.85-py3-none-any.whl

Download URL hierdiff-0.85-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94672c639e6007c1adf1ecd8e9d707dfe37af218859fb50e0078a783bc4533e1
BLAKE2b-256 checksum
How to use checksums
92604c30b5dce11db9b8533fc639b8993ebc00fb86a6f658bede5cf112324383
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.85 This release

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page