Skip to main content

cisbp

cisbp is an offline-first command-line client for the Catalog of Inferred Sequence Binding Preferences (CIS-BP). It downloads a versioned core snapshot once, builds a local DuckDB database, and then answers TF and motif queries without contacting the website.

The initial release supports CIS-BP build 3.10 and includes:

  • 392,337 transcription factors;
  • direct, inferred, missing, and unclassified motif-evidence status;
  • TF-to-motif associations and source metadata;
  • 13,030 motif records, including explicit unavailable matrices; and
  • 11,574 public non-empty A/C/G/T matrices.

Install and run

This project uses uv:

uv sync
uv run cisbp --help

A query automatically downloads and builds the database if it is not cached:

uv run cisbp tf search gata4 --species Danio_rerio

To download explicitly:

uv run cisbp data download
uv run cisbp data status

The core download transfers approximately 13 MB. The resulting archives and DuckDB database occupy approximately 112 MB. The downloader uses HTTP range requests to retrieve only the 6.7 MB core TF-information member from the much larger CIS-BP metadata archive.

Commands

Search TF names, CIS-BP IDs, or external IDs:

cisbp tf search GATA4 --species Homo_sapiens --evidence direct
cisbp tf search 'gata*' --species Danio_rerio --format json

Resolve and inspect one TF. A name must be disambiguated with --species when it occurs in multiple organisms:

cisbp tf get T192662_3.10 --format json
cisbp tf get gata4 --species Danio_rerio

Inspect a matrix or its TF associations:

cisbp motif get M00870_3.10
cisbp motif get M00870_3.10 --format cisbp
cisbp motif associations M00870_3.10 --format json

Exit statuses distinguish common query outcomes:

Status Meaning
0 Success
1 Download, cache, schema, or database error
3 No match or no public matrix
4 Ambiguous exact TF lookup

Cache

The default location is:

$XDG_CACHE_HOME/cisbp/

or ~/.cache/cisbp/ when XDG_CACHE_HOME is unset. Override it with either:

export CISBP_CACHE_DIR=/path/to/cache
cisbp --cache-dir /another/path data status

Each supported content revision is stored under builds/<version>/. The manifest records its source URLs, cache creation time, available HTTP metadata, sizes, and SHA-256 hashes. Downloads and database construction use a process lock and atomic file replacement. Source hashes are pinned because CIS-BP can update files beneath an unchanged build URL; accepting new content therefore requires an explicit adapter revision rather than silently changing results.

If a database or manifest is missing or invalid, the CLI rebuilds it from valid cached archives before contacting CIS-BP. There is intentionally no destructive force-refresh command in the initial release.

Machine-readable output

Query commands support --format json. Results are wrapped with the local schema version, CIS-BP build, and cache creation time:

{
  "schema_version": 1,
  "cisbp_build": "3.10",
  "retrieved_at": "...",
  "result": []
}

Tabular searches and associations also support --format tsv. Exact JSON lookups report expected failures using the same envelope plus an error object:

{
  "schema_version": 1,
  "cisbp_build": "3.10",
  "retrieved_at": "...",
  "result": null,
  "error": {"code": "not_found", "message": "..."}
}

Scientific interpretation

  • direct means CIS-BP associates the TF with an experimentally determined motif.
  • inferred means CIS-BP transferred a motif using its family-specific similarity procedure.
  • none means the source status is N and the downloaded core row has no motif association.
  • unknown preserves a motif association that CIS-BP did not classify as direct or inferred. Build 3.10 currently contains one such internally inconsistent source record; the CLI does not guess its evidence type.
  • A motif can be associated with many direct and inferred TFs.
  • Some source motifs, notably restricted records described by the CIS-BP FAQ, have an association but no public matrix. These are retained with matrix_available = false.
  • The downloaded matrix rows contain raw A/C/G/T frequency or probability values. The CLI does not silently convert them into log-odds scoring matrices.

CIS-BP asks users to cite its 2014 database paper and the 2019 similarity regression paper. See the official citation page and FAQ.

Network behavior and data redistribution

The CLI performs targeted requests only to the versioned bulk-download files; it does not scrape CIS-BP search results, TF pages, carts, or undocumented PHP endpoints. The downloaded data remain in the user's cache and are not bundled with this package. CIS-BP describes the database as freely available, but upstream motif sources may impose additional conditions, so do not redistribute the cached snapshot without checking the applicable terms.

Development

uv run ruff format --check .
uv run ruff check .
uv run pytest
uvx ty check src tests
uv build

Network downloads are not required by the unit tests. The first real query or data download is the integration test against the supported bulk snapshot.

The current cache lock uses the POSIX fcntl interface, so this initial release supports Linux and macOS. Windows support is deferred until it is needed.

Download files

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

Source Distribution

cisbp-0.1.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

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

cisbp-0.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file cisbp-0.1.0.tar.gz.

File metadata

  • Download URL: cisbp-0.1.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cisbp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 99bedb057a56f166cf1bfc5a2a13e6e05935ba86a032139c430bd3adf0a542eb
MD5 ac38c163dc32b2d27fa4bf9c6681e65e
BLAKE2b-256 7c3aa5b2ff5edccaeaf61a5a18749f4e1f9cdead4b8b751e8f232b55689ef4ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for cisbp-0.1.0.tar.gz:

Publisher: release.yml on JoOkuma/cisbp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cisbp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cisbp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cisbp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82c04e3b0a9e7c002084df98cd117e8d3ac0f0fae7db339d871d36af9e7f1e04
MD5 87bd630c25f7ab33cc9b21c3eb2b89cf
BLAKE2b-256 372ac606c249cf27615dd35914c219958db077172ea48f2442a14fa47779decf

See more details on using hashes here.

Provenance

The following attestation bundles were made for cisbp-0.1.0-py3-none-any.whl:

Publisher: release.yml on JoOkuma/cisbp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

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