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.6.tar.gz (12.0 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.6-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: recombass-0.1.6.tar.gz
  • Upload date:
  • Size: 12.0 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.6.tar.gz
Algorithm Hash digest
SHA256 254937e131bc36ec2c160dcb8924ff001229ef30d96edeb6ce0518eaa8e8c9d0
MD5 8d6113808502ba9e2e425f97a692d9e9
BLAKE2b-256 2331978ba4cf04b38f799e3f12e26442a1cff8aa50b541c0d0dc622844d305f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: recombass-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 12.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d545293ca3fe72b342f6a18e7248c90ead2c9e75d7e17a570eda1ca52310f886
MD5 3c6411aa50abc52029c5faa96906cf87
BLAKE2b-256 cb33eb715c5645fc0f7274d36568f96179a31ab52c636ef7295b0bf6ff6380e7

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