Skip to main content

Reference genome Selection Tool

Project description

ReSeT — Reference genome Selection Tool

ReSeT selects a minimal, representative subset of sequences from a pre-clustered collection. Given a pairwise distance matrix and cluster labels, it minimises an objective that penalises (1) the cost of selecting each sequence, (2) within-cluster coverage gaps, and (3) cross-cluster similarity between selected sequences. The result is a compact reference set that covers every taxon while avoiding redundancy.

Installation

pip install reset-bio

Quick start

import numpy as np
from reset import Solution

# Distance matrix (n × n) and cluster assignments (integer, length n)
D = np.array([[0.0, 0.2, 0.8], [0.2, 0.0, 0.7], [0.8, 0.7, 0.0]])
clusters = np.array([0, 0, 1])

sol = Solution(D, clusters, selection_cost=0.1)
sol.local_search(max_runtime=10)
print(np.flatnonzero(sol.selection))   # indices of selected sequences

Command-line interface

reset \
  --clusters     clusters.csv \
  --distances    distances.tsv \
  --distance_format mash \
  --selection_cost 1e-1 \
  --scale 1e-5 \
  --output selected.txt

Supported distance formats: mash, sourmash_cosine, sourmash_jaccard, generic.

Distance formats

Format Description
mash Mash lower-triangular output (mash triangle)
sourmash_cosine Sourmash CSV (column 12 = cosine distance)
sourmash_jaccard Sourmash CSV (column 6 = Jaccard distance)
generic Any delimited (i, j, distance) file

Multiprocessing

Use Solution_shm for parallel local search:

from reset import Solution_shm
sol = Solution_shm(D, clusters, selection_cost=0.1)
sol.local_search(num_processes=4, max_runtime=60)

Dashboard

An interactive Streamlit dashboard is included. Install with dashboard extras and launch:

pip install "reset-bio[dashboard]"
streamlit run $(python -c "import reset.dashboard.app as a; import os; print(os.path.abspath(a.__file__))")

The dashboard defaults to the bundled toy example — no configuration needed.

License

MIT — see LICENSE.

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

reset_bio-1.3.0.tar.gz (46.0 kB view details)

Uploaded Source

Built Distribution

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

reset_bio-1.3.0-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file reset_bio-1.3.0.tar.gz.

File metadata

  • Download URL: reset_bio-1.3.0.tar.gz
  • Upload date:
  • Size: 46.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for reset_bio-1.3.0.tar.gz
Algorithm Hash digest
SHA256 5e88af6d68864d7b8abb8c3dd79cf36bb54ce30812e838559a14e5727260264c
MD5 d5eeb9fb04c8ba02dcef34aef4801ccf
BLAKE2b-256 63be964d684fd1f02fbf61dd39bdb7afa9f4e7b6dc0207a35d517bfc7a46617c

See more details on using hashes here.

Provenance

The following attestation bundles were made for reset_bio-1.3.0.tar.gz:

Publisher: publish.yml on JaspervB-tud/ReSeT

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

File details

Details for the file reset_bio-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: reset_bio-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for reset_bio-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edbffc716a1e3daac987d8e66997d80654bd4982523203db8b2171c55365e69f
MD5 73725a66962e91ed66e42ba873ed1c0d
BLAKE2b-256 1d83a832390ed89312fd1e54715aff5bd08978584dca1a141c6be0da08f7abc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for reset_bio-1.3.0-py3-none-any.whl:

Publisher: publish.yml on JaspervB-tud/ReSeT

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page