Skip to content

rcac-bioinformatics/bsaseq

Repository files navigation

bsaseq

PyPI version Bioconda License: MIT Docs CI

Bulk Segregant Analysis for QTL mapping from pooled whole-genome sequencing.

bsaseq identifies genomic loci controlling traits by comparing allele frequencies between phenotypically distinct bulked DNA pools. It provides a complete, reproducible workflow from a joint VCF to ranked candidate genes: sliding-window analysis with tricube smoothing, Z-score and G-statistic significance testing, publication-quality plots, and optional snpEff annotation.

Documentation: https://rcac-bioinformatics.github.io/bsaseq

Features

  • Multi-sample bulk support (pool technical replicates)
  • Sliding-window analysis with tricube smoothing
  • Z-score and G-statistic for candidate-region detection
  • Recessive and dominant inheritance modes
  • Optional snpEff annotation with gene-level ranking
  • Publication-quality genome-wide and regional plots
  • TSV, BED, and VCF outputs; Nextflow and Snakemake templates; SLURM/HPC tested

Installation

pip install bsaseq                    # PyPI
conda install -c bioconda bsaseq      # Bioconda
docker pull arnstrm2/bsaseq           # Docker Hub

From source:

git clone https://github.com/rcac-bioinformatics/bsaseq.git
cd bsaseq && pip install -e .

Requirements: Python 3.9-3.13; cyvcf2, numpy, pandas, scipy, matplotlib, click, rich. snpEff is optional and only needed for --annotate.

Quick start

# Basic recessive mapping
bsaseq run \
    --vcf joint_calls.vcf.gz \
    --high-bulk mutant_pool \
    --low-bulk wildtype_pool \
    --out results/analysis

# Pool replicates and annotate candidates
bsaseq run \
    --vcf joint_calls.vcf.gz \
    --high-bulk "mut1,mut2" \
    --low-bulk "wt1,wt2" \
    --out results/analysis \
    --annotate --snpeff-db Sorghum_bicolor

List sample names in a VCF with bsaseq samples --vcf joint_calls.vcf.gz.

Commands

Command Description
bsaseq run Complete BSA analysis pipeline
bsaseq samples List sample names in a VCF
bsaseq plot Regenerate plots from existing output
bsaseq annotate Annotate candidates with snpEff
bsaseq check-snpeff Verify snpEff installation

See the CLI reference for all options and defaults.

Input

The VCF must contain biallelic SNPs with per-sample AD (allelic depth); GQ is used for filtering when present. Recommended calling: GATK HaplotypeCaller or bcftools mpileup | bcftools call. Key defaults: --window-size 1000000, --step-size 250000, --min-dp 10, --z-threshold 3.0, --mode recessive.

Validation

bsaseq reproduces published results across two systems (see Validation):

Dataset Top region Max Z Concordance
Sorghum ms8 male sterility (Xiao et al. 2025) Chr04:61.0-63.0 Mb 12.3 Contains causal variant at 61,494,009
Rice root-knot nematode resistance (Lahari et al. 2019) Chr11:28.25-29.5 Mb 3.46 Within published QTL, ~5x narrower

Runtime is minutes on whole-genome data (e.g. sorghum ~730 Mb: 140,219 variants, 2,613 windows, 21.2 s, 0.28 GB peak memory).

Documentation and development

Citation

If you use bsaseq, please cite it using the metadata in CITATION.cff:

Seetharam, A. S., Adeyanju, A. O., & Tesso, T. (2025). bsaseq: Bulk segregant analysis and QTL mapping from pooled sequencing data (Version 1.0.0) [Computer software]. https://github.com/rcac-bioinformatics/bsaseq

License

MIT License. See LICENSE.

About

Bulk Segregant Analysis for QTL mapping from pooled whole-genome sequencing data.

Topics

Resources

License

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages