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.5.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.5-cp39-abi3-manylinux_2_28_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

pyrsx-0.2.5-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.5.tar.gz.

File metadata

  • Download URL: pyrsx-0.2.5.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.5.tar.gz
Algorithm Hash digest
SHA256 56a3e57457cb941373fd71fde6999a89db6f4a211192678dc692515d300f1109
MD5 3323313cd5bada323d843e77f0eb2fa8
BLAKE2b-256 171e6731891aa27e02e51a5f6ebfe9592ce9a9506e19ccaf5d89525ac00d0574

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrsx-0.2.5-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 543e4e7bd7062ef5bad3a0bbc5ae8315471a52c88a2a37690b6bf6825d31e9c3
MD5 a53a5a29f799135afcf9b6bd135189a4
BLAKE2b-256 d6c33385cbe361c87814350ecef39d9950c102151f65515d39f71be9922cc2a0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrsx-0.2.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ad354b27f0e3d87aba7e844de9e75271a1dcdf0ed87b1b691934c6bc159bdbf
MD5 2cfeea1de0cadd408823c23029d17a2f
BLAKE2b-256 92c279749bc745449d391fc376c13f8824797ee9342e8db60ca9c16af52b26ff

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyrsx-0.2.5-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.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2bc42d117f5d065f79d7c68cadf1eae6e94ece06ea06f796416732e9488e0c16
MD5 803e4445b21f00f07814f9ca7857ed5f
BLAKE2b-256 3c5b1700688673a68fff04f36afc16935d10b98925bd787112b09dbfba062a4b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrsx-0.2.5-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 772392627b9a2c1f4733091f2d96a375ed00b5ed15fb8d445d48cf9d25fffe1f
MD5 6d1028c64a9779332a4933dc036dad2b
BLAKE2b-256 4f74cbe2a62f0345411684ec042af7c2e970464aa90961bd1b409a1706763b00

See more details on using hashes here.

Provenance

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