Named after the beautiful Cecret lake
Location: 40.570°N 111.622°W , Elevation: 9,875 feet (3,010 m), Hiking level: easy
Image credit: Jeffrey McGrath posted on the Wikipedia Article
Table of Contents:
Introduction
Cecret was originally developed by @erinyoung at the Utah Public Health Laborotory for SARS-COV-2 sequencing with the artic/Illumina hybrid library prep workflow for MiSeq data with protocols here and here. This nextflow workflow, however, is flexible for many additional organisms and primer schemes as long as the reference genome is “small” and “good enough.” In 2022, @tives82 added in contributions for Monkeypox virus, including converting IDT’s primer scheme to NC_063383.1 coordinates. We are grateful to everyone that has contributed to this repo.
The nextflow workflow was built to work on linux-based operating systems. Additional config options are needed for cloud batch usage.
The library preparation method greatly impacts which bioinformatic tools are recommended for creating a consensus sequence. For example, amplicon-based library prepation methods will required primer trimming and an elevated minimum depth for base-calling. Some bait-derived library prepation methods have a PCR amplification step, and PCR duplicates will need to be removed. This has added complexity and several (admittedly confusing) options to this workflow. Please submit an issue if/when you run into issues.
It is possible to use this workflow to simply annotate fastas generated from any workflow or downloaded from GISAID or NCBI. There are also options for multiple sequence alignment (MSA) and phylogenetic tree creation from the fasta files.
Cecret is also part of the staphb-toolkit.
NF-CORE style docs cat be found in docs
WIKI can be found at https://github.com/UPHL-BioNGS/Cecret/wiki
Dependencies
Usage
nextflow run UPHL-BioNGS/Cecret -profile docker,test
Help
$ nextflow run . --help
N E X T F L O W ~ version 26.04.6
Launching `./main.nf` [extravagant_mahavira] revision: 734e57c941
UPHL-BioNGS/Cecret pipeline parameters
Reference-based consensus creation
USAGE:
nextflow run UPHL-BioNGS/Cecret -profile docker --sample_sheet samplesheet.csv --outdir cecret
OPTIONS:
TOGGLES
Toggles processes on (true)/off (false)
PROCESS ADJUSTMENTS
Adjusts how processes are run. These are similar to how task.ext values in modern nf-core workflows.
WORKFLOW COMPONENTS
The basic workflow components can be adjusted between some options
--download_nextclade_dataset Uses included nextclade dataset for SARS-CoV-2 during runtime when false.
Type: boolean | Default: true
--predownloaded_nextclade_dataset Path to predownloaded nextclade dataset
Type: string
--filter Specifies if reference-mapped fastq files should be extracted
Type: boolean
--markdup Specifies if duplicate reads should be removed (not recommended for nanopore)
Type: boolean
--relatedness Turns on multiple sequence alignment subworkflow when true
Type: boolean
REFERENCE FILES
Files related to the reference genome
--reference_genome THE Reference genome
Type: string
--amplicon_bed Bedfile for amplicons
Type: string
--gff File used in ivar variants. Must correspond with reference genome.
Type: string
--primer_bed File with bedfile of primers used in the analysis
Type: string
--primer_set Specifies a primer set included in repo
Type: string | Default: ncov_V5.3.2 | Choices: midnight_idt_V1, midnight_ont_V1, midnight_ont_V2, midnight_ont_V3, ncov_V3, ncov_V4, ncov_V4.1, ncov_V5.3.2, mpx_primalseq, mpx_idt, mpx_yale
INPUT/OUTPUT OPTIONS
Define where the pipeline should find input data and save output data.
--sample_sheet sample sheet with sample, fastq_1, and fastq_2 columns
Type: string
--species specifies species-specific sub-workflows
Type: string | Default: sarscov2
--kraken2_db directory to kraken2 database
Type: string
--outdir The output directory where the results will be saved. Absolute paths are required on cloud infrastructure.
Required | Type: string | Default: cecret
INSTITUTIONAL CONFIG OPTIONS
Parameters used to describe centralised config profiles. These should not be edited.
GENERIC OPTIONS
Less common options for the pipeline, typically set in a config file.
Run with --help_full to display all parameters.
Using a Sample Sheet
Cecret can also use a sample sheet for input with the sample name and reads separated by commas. The header must be sample,fastq_1,fastq_2. The general rule is the identifier for the file(s), the file locations, and the type if not paired-end fastq files.
Rows match files with their processing needs.
- paired-end reads:
sample,read1.fastq.gz,read2.fastq.gz
- single-reads reads:
sample,sample.fastq.gz,single
- nanopore reads :
sample,sample.fastq.gz,ont
- fasta files:
sample,sample.fasta,fasta
- multifasta files:
multifasta,multifasta.fasta,multifasta
Example sample sheet:
sample,fastq_1,fastq_2
SRR13957125,/home/eriny/sandbox/test_files/cecret/reads/SRR13957125_1.fastq.gz,/home/eriny/sandbox/test_files/cecret/reads/SRR13957125_2.fastq.gz
SRR13957170,/home/eriny/sandbox/test_files/cecret/reads/SRR13957170_1.fastq.gz,/home/eriny/sandbox/test_files/cecret/reads/SRR13957170_2.fastq.gz
SRR13957177S,/home/eriny/sandbox/test_files/cecret/single_reads/SRR13957177_1.fastq.gz,single
OQ255990.1,/home/eriny/sandbox/test_files/cecret/fastas/OQ255990.1.fasta,fasta
SRR22452244,/home/eriny/sandbox/test_files/cecret/nanopore/SRR22452244.fastq.gz,ont
# using docker on samples specified in SampleSheet.csv
nextflow run UPHL-BioNGS/Cecret -profile docker --sample_sheet SampleSheet.csv
# using a config file containing all inputs
nextflow run UPHL-BioNGS/Cecret -c file.config
Results are roughly organiized into ‘params.outdir’/< analysis >/sample.result
A file summarizing all results is found in 'params.outdir'/cecret_results.csv and 'params.outdir'/cecret_results.txt.
Consensus sequences can be found in 'params.outdir'/consensus and end with *.consensus.fa.
Quick Test with Example Output
To verify your installation using the built-in test profile:
nextflow run UPHL-BioNGS/Cecret -profile docker,test
This requires an internet connection and access to the ENA. Replace docker with singularity/apptainer/podman depending on your container setup.
Expected Output
When the test run completes, the primary summary file is written to cecret/cecret_results.txt (or <outdir>/cecret_results.txt). Key expected metrics for sample SRR23040634 are shown below:
| Metric |
Expected Value |
| Sample ID |
SRR23040634 |
| Top Organism |
Betacoronavirus pandemicum (99.29%) |
| Pangolin Lineage |
XBB.1 (pass) |
| Scorpio Call |
Omicron (XBB.1-like) (0.88 support) |
| Nextclade Clade |
22F (good, score: 2.62) |
| Freyja Dominant Lineage |
XBB* (XBB.X) (98.6%) |
| VADR Status |
PASS (model: NC_045512, alerts: -) |
| Mean Depth / 1X Coverage |
25,462.5X / 99.76% |
| Variants Identified |
104 |
| Cecret Version |
v3.73.26335 |
Minor floating-point differences in coverage, depth, or lineage/clade sub-calls may occur if newer Pangolin, Nextclade, or Freyja database containers are pulled at runtime.
Click to view full raw TSV output (`cecret_results.txt`)
sample_id sample pangolin_lineage nextclade_clade vadr_p/f fasta_line fastqc_raw_reads_1 fastqc_raw_reads_2 num_N num_total top_organism percent_reads_top_organism %_human_reads num_pos_100X samtools_num_failed_amplicons insert_size_after_trimming bcftools_variants_identified samtools_meandepth_after_trimming samtools_per_1X_coverage_after_trimming vadr_model vadr_alerts nextclade_clade_who nextclade_qc.overallScore nextclade_qc.overallStatus pangolin_conflict pangolin_ambiguity_score pangolin_scorpio_call pangolin_scorpio_support pangolin_scorpio_conflict pangolin_scorpio_notes pangolin_version pangolin_pangolin_version pangolin_scorpio_version pangolin_constellation_version pangolin_is_designated pangolin_qc_status pangolin_qc_notes pangolin_note pango_aliasor_lineage pango_aliasor_unaliased_lineage freyja_summarized Cecret version
SRR23040634 SRR23040634 XBB.1 22F PASS SRR23040634 11131284.0 737 29875 Betacoronavirus pandemicum 99.29 0 29529 0 0.0 104 25462.5 99.7626 NC_045512 - 2.619602 good 0.0 Omicron (XBB.1-like) 0.88 0.0 scorpio call: Alt alleles 74; Ref alleles 0; Amb alleles 8; Oth alleles 2 PUSHER-v1.41 4.4 0.3.19 v0.1.12 False pass Ambiguous_content:0.04 Usher placements: XBB.1(1/1) XBB.1 XBB.1 [('XBB* (XBB.X)' 0.9861098212722592)] v3.73.26335
Consensus fasta files will be in cecret/consensus.
Full workflow

Updating Cecret
nextflow pull UPHL-BioNGS/Cecret
Cecret has a weekly update schedule. Cecret’s versions have three numbers : X.Y.Z. If the first number, X, changes, there has been a major modification. Params may have changed or subworkflows/channels may have been modified. If the second number, Y, changes, there has been a minor to moderate change. These are mainly for bug fixes or the changing the defaults of params. If the last number has been modified, Z, the workflow is basically the same, there have just been some updates in the containers pulled for the workflow. Most of these updates are to keep Freyja, NextClade, and Pangolin current for SARS-CoV-2 analysis.
The main components of Cecret are:
- nf-core - for schema validation and linting
- nf-docs - for user docs
- aci - for depth estimation over amplicons (optional, set params.aci = true)
- artic network - for aligning and consensus creation of nanopore reads
- bbnorm - for normalizing reads (optional, set params.bbnorm = true)
- bcftools - for variants
- bwa - for aligning reads to the reference
- fastp - for cleaning reads ; (optional, set params.cleaner = ‘fastp’)
- fastqc - for QC metrics
- freyja - for multiple SARS-CoV-2 lineage classifications
- heatcluster - for visualizing SNP matrices generated via SNP dists
- iqtree - for phylogenetic tree generation (optional, set params.relatedness = true)
- igv-reports - visualizing SNPs (optional, set params.igv_reports = true)
- ivar - calling variants and creating a consensus fasta; default primer trimmer
- kraken2 - for read classification
- mafft - for multiple sequence alignment (optional, relatedness must be set to “true”)
- minimap2 - an alternative to bwa (optional, set params.aligner = minimap2 )
- multiqc - summary of results
- nextclade - for SARS-CoV-2 clade classification (optional: aligned fasta can be used from this analysis when relatedness is set to “true” and msa is set to “nextclade”)
- pangolin - for SARS-CoV-2 lineage classification
- pango aliasor - for SARS-CoV-2 lineage tracing
- phytreeviz - for visualizing phylogenetic trees
- samtools - for QC metrics and sorting; optional primer trimmer; optional converting bam to fastq files; optional duplication marking
- seqyclean - for cleaning reads
- snp-dists - for relatedness determination (optional, relatedness must be set to “true”)
- vadr - for annotating fastas like NCBI
Consensus sequence cutoffs
Cecret defaults to a 0.6 (60%) minimum allele frequency threshold for consensus calling. Any genomic site falling below the minimum depth or 60% allele frequency is masked with an N.
This threshold was empirically selected to balance technical noise and consensus stability across real-world public health surveillance workflows. Amplicon amplification dynamics and pool imbalances routinely introduce technical noise into library preparations. While Cecret historically defaulted to a stricter 0.9 allele frequency threshold, real-world data demonstrated this cutoff was overly stringent. Conversely, internal testing showed that thresholds below 0.5 produced unstable consensus genomes and an excessive number of ambiguous base calls. The 0.6 cutoff accommodates common laboratory prep variations without over-calling ambiguous sites.
If an analysis requires a stricter cutoff (such as 0.75 or 0.9) or additional custom flags, override the params.ivar_consensus_options setting in a custom nextflow.config file with the cutoff placed with the -t flag.
params.ivar_consensus_options = '-q 20 -t 0.75 -n N'
Turning off unneeded processes
It came to my attention that some processes (like bcftools) do not work consistently. Also, they might take longer than wanted and might not even be needed for the end user. Here’s the processes that can be turned off with their default values:
params.bcftools_variants = true # vcf of variants
params.fastqc = true # qc on the sequencing reads
params.ivar_variants = true # itemize the variants identified by ivar
params.samtools_stats = true # stats about the bam files
params.samtools_coverage = true # stats about the bam files
params.samtools_depth = true # stats about the bam files
params.samtools_flagstat = true # stats about the bam files
params.samtools_ampliconstats = true # stats about the amplicons
params.samtools_plot_ampliconstats = true # images related to amplicon performance
params.kraken2 = false # used to classify reads and needs a corresponding params.kraken2_db and organism if not SARS-CoV-2
params.aci = false # coverage approximation of amplicons
parms.igv_reports = false # SNP IGV images
params.nextclade = true # SARS-CoV-2 clade determination
params.pangolin = true # SARS-CoV-2 lineage determination
params.pango_aliasor = true # SARS-CoV-2 lineage tracing
params.freyja = true # multiple SARS-CoV-2 lineage determination
params.vadr = false # NCBI fasta QC
params.relatedness = false # create multiple sequence alignments with input fastq and fasta files
params.snpdists = true # creates snp matrix from mafft multiple sequence alignment
params.iqtree = true # creates phylogenetic tree from mafft multiple sequence alignment
params.bamsnap = false # has been removed
params.rename = false # needs a corresponding sample file and will rename files for GISAID and NCBI submission
params.filter = false # takes the aligned reads and turns them back into fastq.gz files
params.multiqc = true # aggregates data into single report
Contributing
We welcome contributions from the community! For those interested in contributing to Cecret, improving the code, or reporting issues, please read the Contributing Guidelines for more information on how to get started.
评论