This repository provides a reproducible pipeline for ancestral sequence reconstruction using Nextflow and IQ-TREE. The workflow supports iTOL visualization, taxonomy annotation, and extraction of ancestral FASTA sequences for selected nodes.
- Automated environment setup with Conda
- Ancestral state reconstruction using IQ-TREE
- iTOL-compatible outputs for visualization
- Flexible FASTA extraction for all or selected ancestral nodes
- Taxonomy annotation for visualization (optional)
- Miniconda/Anaconda
- Nextflow (installed via Conda environment)
-
Clone the repository:
git clone https://github.com/alejimgon/asr-nf.git cd asr-nf -
Set up the Conda environment:
source scripts/setup.shThis will create and activate the
asr-nfenvironment with all dependencies.
-
Prepare your input files:
- Place your alignment files in
data/alignments/ - Place your tree files in
data/phylogenetic_trees/ - Edit
data/input_table.txtwith your analysis parameters (see below).
- Place your alignment files in
-
Run the pipeline:
nextflow run main.nf
-
Optional parameters:
- Fetch taxonomy and generate iTOL labels:
nextflow run main.nf --tax true --email your_email@example.com - Extract FASTA for all or selected nodes:
nextflow run main.nf --extract_fasta true nextflow run main.nf --extract_fasta true --fasta_nodes Node13,Node25 nextflow run main.nf --extract_fasta true --fasta_nodes "Nodes13|Nodes25" nextflow run main.nf --extract_fasta true --fasta_nodes my_nodes.txt nextflow run main.nf --extract_fasta true --fasta_missing X
- Fetch taxonomy and generate iTOL labels:
data/input_table.txt should be a tab-delimited file with the following columns (no header):
alignment_file model position aa asr_min
Example:
example.aln JTT+G 42 K 0.7
- Results are saved in the
outputs/directory. - iTOL files and extracted FASTA sequences are organized by analysis.
- Conda environment not activated:
Always usesource scripts/setup.shto ensure the environment is activated in your current shell. - Missing dependencies:
Re-run the setup script or checkenv/env.yaml.
This project is for non-commercial use.
See LICENSE for details.
If you use this pipeline, please cite IQ-TREE and Nextflow.
Developed by Alejandro Jiménez-González