- Nextflow 88.2%
- Python 7.2%
- Shell 2.1%
- HTML 1.5%
- R 1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| additionnal-scripts | ||
| assets | ||
| candate_nf | ||
| data | ||
| candate_help.md | ||
| EXEMPLE_input_bam.csv | ||
| README.md | ||
🐺 CanDate
Bayesian Molecular Age Estimation for Ancient Canids
🧬 Overview
CanDate is a bioinformatic pipeline for estimating the molecular age of ancient canid samples using Bayesian tip-dating on their mitochondrial genomes.
It processes mitochondrial BAM or FASTA files through the following stages:
- FASTA extraction
- Multiple sequence alignment
- XML generation
- BEAST MCMC tip-dating analysis
- Tip-date extraction
CanDate is implemented in the Nextflow framework (compatible with nf-core standards) and supports modular resumption — meaning you can restart the pipeline from any step.
👩🔬 Development Team
Developed by Mahaut Goor & Maulik Upadhyay at the Paleogenomics Lab of Prof. Laurent Frantz
With the help of: Alberto Carmagnini & Lachie Scarsbrook
⚙️ Pipeline Steps
| Step | Description |
|---|---|
| 1 | Convert BAM files to FASTA sequences |
| 2 | Align sample FASTAs to a reference with MAFFT and trim with trimAl |
| 3 | Generate BEAST XML input files |
| 4 | Run BEAST MCMC chains |
| 5 | Combine logs and trees |
| 6 | Extract tip dates from BEAST outputs |
💡 You can resume from any step in case of interruption.
📥 Inputs
Required
-
BAM files or FASTA consensus files
- Preferably BAM files for full workflow.
- Input specified via a
.csvfile:
Optional
-
Reference FASTA for alignment Default provided:
./data/181ancientsModernNODLOOP.fasta -
XML template Default BEAST XML template:
./data/181ancientModernNODLOOP_REFDUMMY_1M.xml
🧬 Dependencies
| Tool | Version | Notes |
|---|---|---|
| Nextflow | ≥ 25.10.2 | Install Nextflow |
| Conda / Mamba | Latest | Install Conda |
| Beast | v.2.7.8 | Install Beast v.2.7.8 |
💻 Installation
Will be available in the next weeks
▶️ Usage Example
first run additionnal-scripts/prepare_input.sh
cd <path/to/your/bams>
bash additionnal-scripts/prepare_input.sh ./ > input_bams.csv
if you have bams from different mapping or don't know the mitochondrial chromosome header, run additionnal-scripts/extractMTChr.sh
bash additionnal-scripts/extractMTChr.sh ./ input_mt_header.csv
then run nextflow
mkdir -p res
nextflow run ./candate_nf \
--input input_bams.csv \
--outdir ./res \
--reference_xml ./data/181ancientModernNODLOOP_REFDUMMY_1M.xml \
--existing_maln ./data/181ancientsModernNODLOOP.fasta \
--mtdna_map_file input_mt_header.csv
--num_chain 4 \
--min_ess 100
🧠 Notes
-
Nextflow automatically creates trace files tracking process time.
-
Always run from a dedicated working directory:
cd /path/to/working_dir -
Do not delete the
work/directory until the run is complete — it’s required for resuming.
⚠️ For low-coverage BAMs, inspect consensus quality. Adjust
--depthand--min_qualto improve reliability.
🚧 Upcoming Features
-
Automatic filtering step after
samtools: Warn if consensus contains too many Ns (gaps).“Consensus has too many gaps — consider increasing minimum depth or quality thresholds.”
-
Sharable on other servers
-
add a checkup for the coverage (eg is under a threshold, print a warning)
📚 References
- Tip Dating & Leave-One-Out Method: Loog et al., 2020
- BEAST: Bouckaert et al., 2014
- nf-core Framework: Ewels et al., 2020