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.4.tar.gz (115.3 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.4-cp39-abi3-manylinux_2_28_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

pyrsx-0.2.4-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.4-cp39-abi3-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

pyrsx-0.2.4-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.4.tar.gz.

File metadata

  • Download URL: pyrsx-0.2.4.tar.gz
  • Upload date:
  • Size: 115.3 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.4.tar.gz
Algorithm Hash digest
SHA256 4f082a6ea1a8a091d996cc6261ae43caf5c22c1a5f867f7d4ae1f25e3a0c0212
MD5 ec75f5e51476e181c69f14a6ba1c1544
BLAKE2b-256 70ee25cef3cb768c2d1ad9230cdb32aeadf1155b2bea8590a1de19b96dde1141

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.4.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.4-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyrsx-0.2.4-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 723a365263405fba7daeae6ef9851619a30bc4648b26ea2272f6e859711be4f4
MD5 943a7a971a56e94320786d1f8a902568
BLAKE2b-256 ea7d8c00a14a7cbe1d3518894ed2ad7d81a26cbb758f83065c13b0bce275c701

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.4-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.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrsx-0.2.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b29f9292ae829075bd0452bf13201336a4f36b213932736f715f519d64a53e4
MD5 8430589616a48e56152ea7733d31677a
BLAKE2b-256 877d6cd9fcc91055c21f7a18a13cc32a34d8cebe87cb7d0d95ca3211b71ee7bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.4-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.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: pyrsx-0.2.4-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.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71c03d861697246567370b2020c72ebfe0859929902173e18c5530db2601a64f
MD5 7b4306638344de3a9d4cb205058eb0f5
BLAKE2b-256 fcb6019ccb94ca779e75583a5382a69df35777ea373073e564e0074d890975d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.4-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.4-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyrsx-0.2.4-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e7594f1ad7b2f84754bc113a32d52beaf6529d4276bb58661072b41b408a8aa9
MD5 11f0e2989241fc32aaf5389a26f6c787
BLAKE2b-256 1d2b9860a587c3bd98d6a96419b176b6b2d15b0808eea31728e152504e202078

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsx-0.2.4-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