Skip to main content

HECTOR

Hierarchical Embedding and Contrastive Training for Ontology-guided Recognition and Trajectory Analysis of single-cell sequencing data

HECTOR packages the current HECTOR inference and trajectory analysis code as a research-preview Python distribution. The package source is under hector/.

Installation

On Linux or WSL2 with an NVIDIA graphics card:

pip install "hector-sc[cuda12]"

On everything else — Mac, Windows, or Linux without an NVIDIA card:

pip install hector-sc

Either command installs the complete feature set; there are no other optional extras to choose from. HECTOR selects its inference backend automatically: TensorFlow on Linux, Windows, and Intel Macs, or MLX on Apple Silicon Macs.

The cuda12 extra adds TensorFlow's pip-managed NVIDIA CUDA runtime libraries, the prebuilt cupy-cuda12x wheel used for live VRAM measurement and CUDA memory-pool management, and the RAPIDS libraries cuml-cu12 and cugraph-cu12, which accelerate reduce_dimensions() and evaluate_cells(). Every package in the extra is gated to Linux, so on Mac and Windows the bracketed form installs nothing extra and is equivalent to the plain command.

Model Checkpoints

The packaged registry exposes two model entries hosted in Hugging Face repo polligator/HECTOR. Access to the hosted checkpoints is managed separately; authorized users can authenticate with Hugging Face before using a registry key.

  • human -> file human.h5 (Homo sapiens)
  • mouse -> file mouse.h5 (Mus musculus)

Basic usage:

import anndata
import hector

adata = anndata.read_h5ad("example_data.h5ad")
predictor = hector.HECTOR("human")
predictions = predictor.predict(adata)
predictor.write_predictions(adata, predictions)

Local checkpoint paths still work — pass a file path instead of a registry key:

import hector

predictor = hector.HECTOR("/path/to/your/checkpoint.h5")

Hardware Requirements

HECTOR automatically selects an available inference backend and adjusts batch sizes to the available memory. CPU inference is used where supported when no accelerator is available. Results are expected to be numerically stable for fixed inputs and settings, although small differences can occur across hardware, backends, batch sizes, or row orderings.

Resource Guidance
GPU VRAM 10 GB or more is recommended for GPU inference with the published human checkpoint; adaptive batching may permit smaller workloads on devices with less memory.
GPU VRAM (comfortable) 16 GB provides additional headroom for larger workloads.
System RAM Workload-dependent. Approximately 16 GB is a useful starting point for the published human checkpoint with a 100,000-cell anchor pool.
CPU-only mode Supported where the selected backend provides CPU execution, but generally slower than accelerated inference.

These estimates use the published human checkpoint (approximately 57 million parameters) with a 100,000-cell by 5,000-gene anchor pool. Smaller anchor pools or fewer genes generally reduce memory requirements, but memory use also includes fixed model and runtime overhead.

Package Layout

  • hector/predictor.py: public predictor API and high-level inference workflows
  • hector/predictor_support.py: internal model definitions, preprocessing, GRIT, and data utilities
  • hector/trajectory.py: public trajectory configuration, analyzer orchestration, and shared layout/color helpers
  • hector/trajectory_support.py: internal trajectory placement, ambiguity, clustering, and overlap helpers
  • hector/trajectory_render.py: Plotly and matplotlib trajectory renderers
  • hector/__init__.py: package exports plus model registry, cache, and download helpers

Citation

title: "Hierarchical Embedding and Contrastive Training for Ontology-guided Recognition and Trajectory Analysis"
authors: Junya Zhang
version: "1.0.1"
license: "Apache-2.0"
repository-code: "https://github.com/Polligator/HECTOR"

License

The source code is released under the Apache License, Version 2.0. See LICENSE for details.

The project name, logo, icons, and related branding are not licensed under Apache-2.0. Modified versions should not use the project name or branding in a way that suggests they are official, endorsed by, or affiliated with the original project.

Contributions

External code contributions are not currently accepted.

Bug reports, reproducibility reports, installation issues, and feature suggestions are welcome through GitHub Issues.

This policy helps keep copyright ownership clear while the project is under active research and development.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hector_sc-1.0.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hector_sc-1.0.1-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file hector_sc-1.0.1.tar.gz.

File metadata

  • Download URL: hector_sc-1.0.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.6

File hashes

Hashes for hector_sc-1.0.1.tar.gz
Algorithm Hash digest
SHA256 95896c40fd2a736f469cda5731d18f2b75a45d91bd9813b638d4690b5b21e6a0
MD5 7fd966251c7f6bef194c57be9ebfd1e3
BLAKE2b-256 2c11e781d63d464b9801b967f0047bc0c34f1fee7eb4c35a42856211f4b9d041

See more details on using hashes here.

File details

Details for the file hector_sc-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: hector_sc-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.6

File hashes

Hashes for hector_sc-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a2dd6cfe5a73ba7d01a88d7d168d0aa582d61148263222a8b7aaefe22301e63
MD5 aa31e59349fb365cd6e95d77433a8c0a
BLAKE2b-256 62bf7051afb4e637f5e3883c0db427286fc9fe7bb94a2e14aa24f22b096b29c1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0

2 files

0.1.0

2 files

0.0.1

2 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