Skip to content

A Python script for running FUBAR (Fast Unconstrained Bayesian AppRoximation for inferring selection) analysis on sequence codon alignment files in batch

Notifications You must be signed in to change notification settings

MullinsLab/FUBAR_in_batch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

FUBAR Analysis Pipeline

A Python script for running FUBAR (Fast Unconstrained Bayesian AppRoximation for inferring selection) analysis on sequence codon alignment files in batch.

Description

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.

Requirements

  • Python 3
  • HyPhy with FUBAR method installed
  • FASTA alignment files
  • Corresponding Newick tree files (.nwk extension)

Installation

Installing HyPhy

Using Conda (recommended):

conda install -c bioconda hyphy

Using Homebrew (macOS):

brew install hyphy

From source:

git clone https://github.com/veg/hyphy.git
cd hyphy
cmake .
make

Using apt (Ubuntu/Debian):

sudo apt-get install hyphy

Verify installation:

hyphy --version

Usage

python3 run_FUBAR.py [options]

Options

  • -d, --dir: Directory containing input FASTA files (default: current directory)

Examples

Process FASTA files in the current directory:

python3 run_FUBAR.py

Process FASTA files in a specific directory:

python3 run_FUBAR.py -d /path/to/alignments

Input Files

  • FASTA files (.fasta extension): Multiple sequence codon alignments
  • Newick tree files (.nwk extension): 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).

Output

  • FUBAR results (.FUBAR.json extension): JSON files containing FUBAR analysis results for each processed alignment

Behavior

  • Scans the specified directory for all .fasta files
  • For each FASTA file, checks if a corresponding .nwk tree file exists
  • Skips files that already have .FUBAR.json output files
  • Runs FUBAR analysis using HyPhy for files that need processing
  • Exits with error if a tree file is missing for any FASTA file

Error Handling

The script will exit with an error message if any FASTA file lacks a corresponding Newick tree file.

About

A Python script for running FUBAR (Fast Unconstrained Bayesian AppRoximation for inferring selection) analysis on sequence codon alignment files in batch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages