Skip to main content

Detect recombination hot/cold spots from SNP matrices using wavelet denoising

Project description

recombass

PyPI License: MIT Python 3.9+

A command-line tool for detecting recombination hotspots and coldspots from bacterial SNP matrices using wavelet-based denoising and PMR (Pairwise Mismatch Rate) analysis.

Designed for microbial population genomics, recombass integrates strain filtering, MAF pruning, distance computation, and signal smoothing to identify genomic regions with elevated or suppressed recombination signals.

Requirements

  • Python 3.9+
  • snp-dists available on PATH

Installation

From PyPI

Install the external runtime dependency first, then install recombass from PyPI:

mamba install -c conda-forge -c bioconda snp-dists
pip install recombass

Basic Usage

Input Format

The input SNP matrix must be a tab-delimited table with:

  • SNP positions in the first column
  • strain names in the header row
  • nucleotide calls in each cell

Example:

	strain1	strain2	strain3	strain4
100	A	T	A	G
200	C	C	T	C
300	G	A	G	A
400	T	T	C	T
500	G	G	A	G

Command Line Interface

The main command structure:

recombass [OPTIONS] -m  -i <input_path> -o <output_prefix>

Available Options

  • -m, --maf FLOAT: Max major allele frequency (e.g., 0.95) (highly suggested)
  • -n, --nonredundant FLOAT: Non-redundant strain clustering threshold (e.g., 0.01)
  • --cold-criterion FLOAT: Coldspot detection threshold (default: -0.4)
  • --hot-criterion FLOAT: Hotspot detection threshold (default: 0.6)
  • -t, --threads INT: Number of threads to use (default: 20)
  • -i, --input PATH: Input file path (required)
  • -o, --output PATH: Output prefix (required)

Example Usage

# Basic usage
recombass -i <snps.tsv> -o <result_prefix>

# With MAF filtering and non-redundant filtering
recombass -i <snps.tsv> -o <result_prefix> -m 0.95 -n 0.01

# With custom thresholds and threads
recombass -i <snps.tsv> -o <result_prefix> -m 0.9 -n 0.02 --cold-criterion -0.5 --hot-criterion 0.7 -t 10

Output Files

The pipeline can generate the following files:

  • <result_prefix>.nr{rate}: Non-redundant filtered SNP matrix when -n is used
  • <result_prefix>.maf{rate}: MAF-filtered SNP matrix when -m is used
  • <result_prefix>.fa: FASTA converted from the current SNP matrix
  • <result_prefix>.fa.dist: Pairwise SNP distance matrix from snp-dists
  • <result_prefix>.fa.dist.tr: Triangular distance table used downstream
  • <result_prefix>.fa.dist.png: Distance distribution plot
  • <result_prefix>.recx.txt: Recombination index value
  • <result_prefix>.fa.pmr.30.2.wt.l.pdf: Hotspot plot from the denoised close-strain PMR signal
  • <result_prefix>.fa.pmr.all.2.wt.l.pdf: Coldspot plot from the denoised all-strain PMR signal
  • <result_prefix>.integrated.tsv: Integrated per-site output with raw PMR, denoised PMR, and hot/cold labels

When filtering is enabled, the effective output prefix changes as intermediate files are generated. For example:

recombass -i sample.tsv -o sample_out -m 0.95 -n 0.01

will produce final files such as:

  • sample_out.nr01
  • sample_out.nr01.maf95
  • sample_out.nr01.maf95.integrated.tsv
  • sample_out.nr01.maf95.fa.pmr.30.2.wt.l.pdf
  • sample_out.nr01.maf95.fa.pmr.all.2.wt.l.pdf

License

This project is licensed under the MIT 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

recombass-0.1.7.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

recombass-0.1.7-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file recombass-0.1.7.tar.gz.

File metadata

  • Download URL: recombass-0.1.7.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for recombass-0.1.7.tar.gz
Algorithm Hash digest
SHA256 86b83de089d14e1b75297c1ccd52c282e1040d810f6494c01f0b0d5847888f63
MD5 0fcea388ef293da2d6fd98b7261fb727
BLAKE2b-256 fa00d8f3bd55901cf466b7e5f86c0b303d3a1a8fedbc5887f6148e6fa4429d93

See more details on using hashes here.

File details

Details for the file recombass-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: recombass-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for recombass-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9d3e837d6b9f7c1fe0138a070aae7c823e1ee8cd30a7d8e82b5120ffcf86fd95
MD5 04cd56a9bd81b9cf98a196f75bf24eef
BLAKE2b-256 d1df05d0f01fe89c52c9c34fcbb0e00b0849621eaa21d37a9df2bef83b10c502

See more details on using hashes here.

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