Skip to main content

Python bindings for rsx: high-performance RAD-seq sex determination toolkit

Project description

pyrsx

Python bindings for rsx: a high-performance streaming toolkit for RAD-seq sex determination.

Installation

pip install pyrsx

Usage

import pyrsx

# Process FASTQ files into marker depth table
pyrsx.process("reads/", "markers.tsv", threads=4, min_depth=5)

# Compute distribution with Fisher's exact test + FDR
pyrsx.distrib("markers.tsv", "popmap.tsv", "distrib.tsv",
              test="fisher", correction="fdr")

# Extract significant markers with Bayesian output
pyrsx.signif("markers.tsv", "popmap.tsv", "signif.tsv",
             test="fisher", correction="fdr", bayes=True)

# Streaming PCA
pyrsx.pca("markers.tsv", "pca_results/", n_components=10)

# Merge tables (bounded memory, handles 75M+ sequences)
pyrsx.merge(["table1.tsv", "table2.tsv"], "merged.tsv")

Features

  • All rsx commands accessible from Python
  • 3.14x geometric-mean speedup on the tracked Slurm literature comparison panel
  • Bounded-memory streaming for arbitrarily large datasets
  • Multiple statistical tests: chi-squared, Fisher's exact, G-test
  • Multiple corrections: Bonferroni, Benjamini-Hochberg FDR
  • Bayesian sex-linkage classification (Bayes Factor + posterior)
  • Streaming PCA via Tucker mode-2 decomposition
  • K-mer based marker deduplication

High-level API & backend agnosticism (recommended)

The low-level functions above are thin wrappers. For most users the MarkerTable + result objects (in pyrsx.api) are the idiomatic entry point:

import pyrsx as rsx

table = rsx.MarkerTable.from_path("markers.tsv")   # or from_dataframe(...)
result = table.triage(popmap="popmap.tsv", min_depth=10)

# Everything is a narwhals DataFrame under the hood → backend agnostic
print(result.df)                    # stays in whatever backend you prefer
df = result.to_polars()             # or .to_pandas(), to_dataframe(backend=...)

How outputs are read (no forced pandas fallback): Internal TSVs produced by rsx core commands are read with pyarrow.csv (handling the leading #Number of markers comment via skip_rows=1) and then wrapped with to_narwhals(...). The exposed objects are always narwhals DataFrames (concrete backend = pyarrow by default for efficiency). You only pull in pandas/polars if you ask for that backend later. This is the standard narwhals approach used throughout the high-level API (see _adapters.py, _read_core_tsv, and the detailed docs in the Rust extension).

See the docstrings of MarkerTable, the various *Result classes, and _read_core_tsv for the full rationale.

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

pyrsx-0.2.6.tar.gz (120.2 kB view details)

Uploaded Source

Built Distributions

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

pyrsx-0.2.6-cp39-abi3-manylinux_2_28_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

pyrsx-0.2.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

pyrsx-0.2.6-cp39-abi3-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

pyrsx-0.2.6-cp39-abi3-macosx_10_12_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file pyrsx-0.2.6.tar.gz.

File metadata

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

File hashes

Hashes for pyrsx-0.2.6.tar.gz
Algorithm Hash digest
SHA256 963e70e1c0d90ce7456af004335c5bea7cd9fb25be554f6001aaf1c760f7b09e
MD5 91253a448d4e7b6c9b97c9a1e56963a2
BLAKE2b-256 a19bd5b7d38667e270d2f17e6492729b932146996d8021dc89b7ebde3cf5e35d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.6.tar.gz:

Publisher: pypi.yml on HaoZeke/rsx-rs

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

File details

Details for the file pyrsx-0.2.6-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyrsx-0.2.6-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8f237fb7378840501446814adb683153e260b58cd4e9d39c933bd488e0da1de0
MD5 a6a5f6bb02156ca2e7fd3172cf190356
BLAKE2b-256 2b33adb393f4a78c935d391f15664e2ed5cf5af47df1b54adff5b3ffbe2a286a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.6-cp39-abi3-manylinux_2_28_aarch64.whl:

Publisher: pypi.yml on HaoZeke/rsx-rs

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

File details

Details for the file pyrsx-0.2.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrsx-0.2.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee72462f61886377681604320b6537f16dd4f9f0320f4ff05e607f6a3e1b0da8
MD5 a1be57b71ce9f613a22e9abf2edd7b65
BLAKE2b-256 b2cf189a2748aacd2e99cbb4a3bb2a95c9ff458528f4bfe61445a69c6b9cd093

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on HaoZeke/rsx-rs

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

File details

Details for the file pyrsx-0.2.6-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: pyrsx-0.2.6-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyrsx-0.2.6-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 102415ea63674417d16e73ae2874193f57c9b8baf6744ef5852080fc773702cb
MD5 f6e1afb1dc684b15d2ea7aecd90fb707
BLAKE2b-256 72b59be229084198f3fe49b07d57be7986cf8963a3e17b23529031c9eff0e849

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.6-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: pypi.yml on HaoZeke/rsx-rs

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

File details

Details for the file pyrsx-0.2.6-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyrsx-0.2.6-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d99adb6149c1a781c336de8807aca387795d60ee824c6a1b01792e6270386552
MD5 87333c6e8a12abb0058b4c6363aea0bb
BLAKE2b-256 0296005d4e3931cd86b73ee38c13229deee4ef0cd3b566a83fe4f4e2ec57bc27

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.6-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: pypi.yml on HaoZeke/rsx-rs

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