A Python script for running FUBAR (Fast Unconstrained Bayesian AppRoximation for inferring selection) analysis on sequence codon alignment files in batch.
This tool processes FASTA codon alignment files in a directory and runs FUBAR analysis using HyPhy. It automatically discovers FASTA files, checks for corresponding Newick tree files, and processes each alignment that hasn't already been analyzed.
- Python 3
- HyPhy with FUBAR method installed
- FASTA alignment files
- Corresponding Newick tree files (
.nwkextension)
Using Conda (recommended):
conda install -c bioconda hyphyUsing Homebrew (macOS):
brew install hyphyFrom source:
git clone https://github.com/veg/hyphy.git
cd hyphy
cmake .
makeUsing apt (Ubuntu/Debian):
sudo apt-get install hyphyVerify installation:
hyphy --versionpython3 run_FUBAR.py [options]-d, --dir: Directory containing input FASTA files (default: current directory)
Process FASTA files in the current directory:
python3 run_FUBAR.pyProcess FASTA files in a specific directory:
python3 run_FUBAR.py -d /path/to/alignments- FASTA files (
.fastaextension): Multiple sequence codon alignments - Newick tree files (
.nwkextension): Phylogenetic trees corresponding to each FASTA file
The script expects tree files to have the same name as the FASTA file with .nwk extension added (e.g., alignment.fasta and alignment.fasta.nwk).
- FUBAR results (
.FUBAR.jsonextension): JSON files containing FUBAR analysis results for each processed alignment
- Scans the specified directory for all
.fastafiles - For each FASTA file, checks if a corresponding
.nwktree file exists - Skips files that already have
.FUBAR.jsonoutput files - Runs FUBAR analysis using HyPhy for files that need processing
- Exits with error if a tree file is missing for any FASTA file
The script will exit with an error message if any FASTA file lacks a corresponding Newick tree file.