Sovereign 8s.is mirror of standardgalactic/CanDate-repo
  • Nextflow 88.2%
  • Python 7.2%
  • Shell 2.1%
  • HTML 1.5%
  • R 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-03-23 10:41:31 +01:00
additionnal-scripts updating readme and candate_nf 2026-03-23 10:41:08 +01:00
assets adding new version of CanDater using the NF-core framework 2026-01-30 14:34:09 +01:00
candate_nf updating readme and candate_nf 2026-03-23 10:41:08 +01:00
data upating pipeline version 2026-02-13 09:32:14 +01:00
candate_help.md updating readme and candate_nf 2026-03-23 10:41:08 +01:00
EXEMPLE_input_bam.csv updating readme and candate_nf 2026-03-23 10:41:08 +01:00
README.md updating readme and candate_nf 2026-03-23 10:41:08 +01:00

🐺 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

  1. BAM files or FASTA consensus files

    • Preferably BAM files for full workflow.
    • Input specified via a .csv file:

Optional

  1. Reference FASTA for alignment Default provided:

    ./data/181ancientsModernNODLOOP.fasta
    
  2. 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 --depth and --min_qual to 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