# panDecay Configuration File
# Lines starting with # are comments and will be ignored
# This file allows you to specify all parameters for a panDecay analysis
# Format: parameter = value (spaces around = are optional)

# ==============================================================================
# BASIC INPUT/OUTPUT SETTINGS
# ==============================================================================

# Input alignment file (required)
alignment = my_sequences.fasta

# Alignment format (default: fasta)
# Options: fasta, phylip, nexus, clustal, stockholm
format = fasta

# Data type (default: dna)
# Options: dna, protein, discrete
data_type = dna

# Output file prefix (default: pan_decay_indices)
# This will generate files like: myanalysis.txt, myanalysis_tree.nwk, etc.
output = pan_decay_indices.txt

# Base name for annotated tree files (default: annotated_tree)
tree = annotated_tree

# Keep temporary files after analysis (default: false)
# Options: true, false
keep_files = false

# Enable debug mode with detailed logging (default: false)
debug = false

# Custom temporary directory (optional)
# If not specified, uses system temp directory
# temp = /path/to/temp

# ==============================================================================
# ANALYSIS MODE SETTINGS
# ==============================================================================

# Analysis type (default: ml)
# Options: ml, bayesian, parsimony, ml+parsimony, bayesian+parsimony, ml+bayesian, all
# Note: 'all' runs all three analysis types (ML + Bayesian + Parsimony)
# Use '+' to combine multiple analyses (e.g., ml+parsimony)
analysis = ml

# Perform bootstrap analysis (default: false)
bootstrap = false

# Number of bootstrap replicates (default: 100)
bootstrap_reps = 100

# Perform site-specific analysis (default: false)
site_analysis = false

# Generate visualizations (default: false)
# Requires matplotlib and seaborn
visualize = false

# Visualization format (default: png)
# Options: png, pdf, svg
viz_format = png

# Annotation type for visualization (default: lnl)
# Options: au, lnl
annotation = lnl

# Output formatting style (default: unicode)
# Options: unicode, ascii
output_style = unicode


# ==============================================================================
# MODEL SETTINGS (for ML and Bayesian analyses)
# ==============================================================================

# Base substitution model
# DNA options: JC, K80, HKY, GTR
# Protein options: JTT, WAG, LG, Dayhoff
# Discrete options: Mk
model = GTR

# Add gamma rate heterogeneity (default: false)
gamma = false

# Fixed gamma shape parameter (optional)
# If not specified, will be estimated
# gamma_shape = 0.5

# Add proportion of invariable sites (default: false)
invariable = false

# Fixed proportion of invariable sites (optional)
# If not specified, will be estimated
# prop_invar = 0.2

# Base frequencies (optional)
# Options: equal, estimate, empirical
base_freq = estimate

# Number of substitution types for DNA (optional)
# Options: 1, 2, 6
nst = 6

# Protein-specific model (overrides base model for protein data)
protein_model = WAG

# Fixed gamma shape parameter (advanced)
gamma_shape = 0.5

# Fixed proportion of invariable sites (advanced)
prop_invar = 0.2

# Site rate variation (overrides gamma setting)
# Options: equal, gamma
rates = gamma

# Parsimony model for discrete data (default: true for discrete)
parsmodel = true

# ==============================================================================
# COMPUTATIONAL SETTINGS
# ==============================================================================

# Number of threads for PAUP* (default: auto)
# Options: auto (uses cores-2), all, or specific number (e.g., 8)
threads = auto

# Path to PAUP* executable (default: paup)
# Specify full path if not in system PATH
paup = paup

# Starting tree file in Newick format (optional)
starting_tree = my_starting_tree.nwk

# Custom PAUP* commands file (optional)
# This overrides most model settings above
paup_block = custom_paup_commands.txt

# Custom temporary directory (optional)
temp = /path/to/temp

# ==============================================================================
# BAYESIAN-SPECIFIC SETTINGS
# ==============================================================================

# Bayesian software (required if analysis includes bayesian)
# Options: mrbayes
bayesian_software = mrbayes

# Path to MrBayes executable (default: mb)
mrbayes_path = mb


# Model for Bayesian analysis (optional)
# If not specified, uses same as ML model
bayes_model = GTR+G+I

# Number of MCMC generations (default: 1000000)
bayes_ngen = 1000000

# Burnin fraction 0-1 (default: 0.25)
bayes_burnin = 0.25

# Number of MCMC chains (default: 4)
bayes_chains = 4

# Sample frequency (default: 1000)
bayes_sample_freq = 1000

# Marginal likelihood estimation method (default: ss)
# Options: ss (stepping-stone), ps (path sampling), hm (harmonic mean)
marginal_likelihood = ss

# Stepping-stone sampling parameters
ss_alpha = 0.4
ss_nsteps = 50

# ==============================================================================
# CONVERGENCE CHECKING (MrBayes only)
# ==============================================================================

# Check MCMC convergence diagnostics (default: true)
check_convergence = true

# Minimum ESS (Effective Sample Size) threshold (default: 200)
# Values below this indicate poor mixing
min_ess = 200

# Maximum PSRF (Potential Scale Reduction Factor) threshold (default: 1.01)
# Values above this indicate lack of convergence between chains
max_psrf = 1.01

# Maximum ASDSF (Average Standard Deviation of Split Frequencies) (default: 0.01)
# Values above this indicate lack of convergence between independent runs
max_asdsf = 0.01

# Fail analysis if convergence criteria not met (default: false)
# If false, warnings are issued but analysis continues
convergence_strict = false

# Timeout for parsing MrBayes consensus trees in seconds (default: 30.0)
# Set to 0 to disable timeout
mrbayes_parse_timeout = 30.0

# ==============================================================================
# PARALLEL PROCESSING (MrBayes only)
# ==============================================================================

# Use MPI version of MrBayes (default: false)
use_mpi = false

# Number of MPI processors (default: number of chains)
mpi_processors = 8

# Path to mpirun executable (default: mpirun)
mpirun_path = mpirun

# Use BEAGLE library for acceleration (default: false)
use_beagle = false

# BEAGLE device (default: auto)
# Options: cpu, gpu, auto
beagle_device = auto

# BEAGLE precision (default: double)
# Options: single, double
beagle_precision = double

# BEAGLE scaling (default: dynamic)
# Options: none, dynamic, always
beagle_scaling = dynamic

# ==============================================================================
# CONSTRAINT SETTINGS
# ==============================================================================

# Constraint mode (default: all)
# Options: all (test all branches), specific (test listed branches), exclude
constraint_mode = all

# Specify branches to test (optional)
# Format: semicolon-separated clades, each clade is comma-separated taxa
# Example: Homo_sapiens,Pan_troglodytes;Mus_musculus,Rattus_norvegicus
test_branches = Homo_sapiens,Pan_troglodytes;Mus_musculus,Rattus_norvegicus

# Constraint file (optional)
# File containing constraint definitions (one per line)
constraint_file = constraints.txt

# ==============================================================================
# CONSTRAINT DEFINITIONS
# ==============================================================================
# Define specific clades to test when constraint_mode = specific
# Format: clade_name = comma-separated list of taxa
# Note: These are only used when constraint_mode = specific

[constraints]
# Example constraints (uncomment and modify as needed):
# clade1 = Homo_sapiens,Pan_troglodytes,Gorilla_gorilla
# clade2 = Rattus_norvegicus,Mus_musculus
# clade3 = Gallus_gallus,Taeniopygia_guttata

# ==============================================================================
# ADVANCED SETTINGS
# ==============================================================================

# Parsimony model for discrete data (default: true for discrete)
# parsmodel = true

# Site rate variation (overrides gamma setting)
# Options: equal, gamma
# rates = gamma

# ==============================================================================
# NOTES
# ==============================================================================
# 1. Command-line arguments override settings in this file
# 2. Paths can be absolute or relative to the working directory
# 3. Boolean values can be: true/false, yes/no, on/off, 1/0
# 4. Comments can appear on their own line or after values
# 5. Section headers like [constraints] are optional for organization
# 6. Empty lines are ignored