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

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

pyrsx-0.2.3-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.3.tar.gz.

File metadata

  • Download URL: pyrsx-0.2.3.tar.gz
  • Upload date:
  • Size: 111.1 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.3.tar.gz
Algorithm Hash digest
SHA256 7bced5cbd18e1e11012701fa776871b28035df2c328cc67f318ca7ff22e89e44
MD5 710cb2b9559f7be6abb3b36a52cf896e
BLAKE2b-256 7f9a9a5985789c2d1746187eecdbf5398aabd8a753bbaeb109668debc9554de4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrsx-0.2.3-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cab850f86ef2747c0e41b36b342cf363da32afdae5f44a621395f10b63b19366
MD5 242fd624166decdfaaf803a80760fd65
BLAKE2b-256 9579fc249d11064f5aeba5abaab15a5a81459952a484188dd22e8328b7cfe57f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrsx-0.2.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4fb2644222d057a72be77f7bcb4ce0edfe88f484ca546339ca231c7987bb106
MD5 2f2768607147d5a52b6d38d6cd654d72
BLAKE2b-256 c646444d093eebc87df318dc169af67dfe62759cdf20c0fc7da66cb2ccadf0ae

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyrsx-0.2.3-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.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab677a3a17d00b6574750c5131bdb2541493b8b59eb80a6b1a6a0af3848d0047
MD5 211681653ad425eb66c4e9b6ba0c7de6
BLAKE2b-256 376b528b545fd676973ee9951c87ff5cd8647c87c756de0b69ff016c67a09296

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyrsx-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 db2d672470755db46ed6363037c73ebe4c1b5533e3317e303f646638a9196ca5
MD5 e00bef6feeaab4f1c34851fa7ffec6d3
BLAKE2b-256 be9283649cc4faa538d3579b5de105f22a74a4922f8afe0d437b01cfd51e125c

See more details on using hashes here.

Provenance

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