Named after the beautiful Cecret lake
Location: 40.570Β°N 111.622Β°W , 9,875 feet (3,010 m) elevation
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 with pangolin, nextclade, freyja, and vadr. Another utility is to find consensus fasta files from fastq files, and add in fasta files that were generated previously or downloaded from GISAID or NCBI for multiple sequence alignment (MSA) and phylogenetic tree creation.
Cecret is also part of the staphb-toolkit.
- Nextflow
- Singularity or Docker - set the profile as singularity or docker during runtime
- git
# using singularity
nextflow run UPHL-BioNGS/Cecret -profile singularity
# using docker
nextflow run UPHL-BioNGS/Cecret -profile docker
(can be adjusted with 'params.reads', 'params.single_reads', and 'params.fastas')
Paired-end fastq.gz (ending with 'fastq', 'fastq.gz', 'fq', or 'fq.gz') reads as follows or designate directory with 'params.reads' or '--reads'
directory
βββ reads
βββ *fastq.gz
WARNING : Sometimes nextflow does not catch every name of paired-end fastq files. This workflow is meant to be fairly agnostic, but if paired-end fastq files are not being found it might be worth renaming them to some sort of sample_1.fastq.gz
format.
Single-end fastq.gz reads as follows or designate directory with 'params.single_reads' or '--single_reads'
directory
βββ single_reads
βββ *fastq.gz
WARNING : single and paired-end reads cannot be in the same directory
Fasta files (ending with 'fa', 'fasta', or 'fna') as follows or designate directory with 'params.fastas' or '--fastas'
directory
βββ fastas
βββ *fasta
MultiFasta files (ending with 'fa', 'fasta', or 'fna') as follows or designate directory with 'params.multifastas' or '--multifastas'
directory
βββ multifastas
βββ *fasta
WARNING : fastas and multifastas cannot be in the same directory. If no fasta preprocessing is necessary, put the single fastas in the multifastas directory.
The default primer scheme of the 'Cecret' workflow is the 'V4' primer scheme developed by artic network for SARS-CoV-2. Releases prior to and including '2.2.20211221' used the 'V3' primer scheme as the default. As many public health laboratories are still using 'V3', the 'V3' files are still in this repo, but now the 'V4' and 'V4.1' ('V4' with a spike-in of additional primers) are also included. The original primer and amplicon bedfiles can be found at artic's github repo. The recommended method to use these primer sets is with the corresponding profile.
# using artic V3 primers
nextflow run UPHL-BioNGS/Cecret -profile singularity,artic_V3
# using artic V4 primers
nextflow run UPHL-BioNGS/Cecret -profile singularity,artic_V4
# using artic V4.1 primers
nextflow run UPHL-BioNGS/Cecret -profile singularity,artic_V4_1
It is still possible to set 'params.primer_bed' and 'params.amplicon_bed' via the command line or in a config file with the path to the corresponding file.
For the sake of simplicity, processes in this workflow are designated 1 CPU, a medium amount of CPUs (5), or the largest amount of CPUs (the number of CPUs of the environment launching the workflow if using the main workflow and a simple config file or 8 if using profiles and the config template). The medium amount of CPUs can be adjusted by the End User by adjusting 'params.medcpus'
, the largest amount can be adjusted with 'params.maxcpus'
, or the cpus can be specified for each process individually in a config file.
The End User can adjust this by specifying the maximum cpus that one process can take in the config file 'params.maxcpus = <new value>'
or on the command line
nextflow run UPHL-BioNGS/Cecret -profile singularity --maxcpus <new value>
It is important to remember that nextflow will attempt to utilize all CPUs available, and this value is restricted to one process. As a specific example, the prcoess 'bwa' will be allocated 'params.maxcpus'
. If there are 48 CPUs available and 'params.maxcpus = 8'
, then 6 samples can be run simultaneously.
Sequencing has an intrinsic amount of error for every predicted base on a read. This error is reduced the more reads there are. As such, there is a minimum amount of depth that is required to call a base with ivar consensus, ivar variants, and bcftools variants. The main assumption of using this workflow is that the virus is clonal (i.e. only one infection represented in a sample) and created via pcr amplified libraries. The default depth for calling bases or finding variants is set with 'params.minimum_depth' with the default value being 'params.minimum_depth = 100'
. This parameter can be adjusted by the END USER in a config file or on the command line.
A corresponding parameter is 'params.mpileup_depth' (default of 'params.mpileup_depth = 8000'
), which is the number of reads that samtools (used by ivar) or bcftools uses to put into memory for any given position. If the END USER is experiencing memory issues, this number may need to be decreased.
For library preparation methods with baits followed by PCR amplification, it is recommended to remove duplicate reads. For most other methods, removing deplicates will not hurt. To remove duplicates, set the 'params.markdup'
to true. This removes duplicate reads from the aligned sam file, which is before the primer trimming and after the filter processes. This will likely enable a lower minimum depth for variant calling (default is 100).
On the command line:
nextflow run UPHL-BioNGS/Cecret -profile singularity --markdup true --minimum_depth 10
In a config file:
params.markdup = true
params.minimum_depth = 10
The defaults for Cecret continue to be for SARS-CoV-2, but there are growing demands for a workflow for Monkeypox Virus. As such, there are a few parameters that might benefit the End User.
There are three profiles for Monkeypox Virus sequencing : mpx
, mpx_idt
and mpx_primalseq
. The mpx
profile has some defaults for a metagenomic-type sequencing, while mpx_idt
is for libraries prepped with IDT's primers, and mpx_primalseq
which has been validated with Illumina library prep methods and sequencing platforms.
# metagenomic
nextflow run UPHL-BioNGS/Cecret -profile singularity,mpx
# using IDT's primers
nextflow run UPHL-BioNGS/Cecret -profile singularity,mpx_idt
# using Illumina library prep methods and sequencing platforms
nextflow run UPHL-BioNGS/Cecret -profile singularity,mpx_primalseq
There are amplicon-based methods, bait, and amplicon-bait hybrid library preparation methods which increases the portion of reads for a relevant organism. If there is a common preparation for the End User, please submit an issue, and I can create a profile for you. Remember that the bedfiles for the primer schemes and amplicons MUST match the reference.
nextflow pull UPHL-BioNGS/Cecret
nextflow run UPHL-BioNGS/Cecret -profile singularity --cleaner fastp
Or set params.cleaner = 'fastp'
in a config file
nextflow run UPHL-BioNGS/Cecret -profile singularity --trimmer samtools
Or set params.trimmer = 'samtools'
in a config file
nextflow run UPHL-BioNGS/Cecret -profile singularity --trimmer none
Or set params.trimmer = 'none'
in a config file
nextflow run UPHL-BioNGS/Cecret -profile singularity --aligner minimap2
Or set params.aligner = 'minimap2'
in a config file
To create a multiple sequence alignment and corresponding phylogenetic tree and SNP matrix, set params.relatedness = true
or
nextflow run UPHL-BioNGS/Cecret -profile singularity --relatedness true
nextflow run UPHL-BioNGS/Cecret -profile singularity --relatedness true --msa nextalign
Or set params.msa = 'nextalign'
and params.relatedness = true
in a config file
Using the aligned fasta from nextclade to for multiple sequence alignement instead of mafft or nextalign
nextflow run UPHL-BioNGS/Cecret -profile singularity --relatedness true --msa nextclade
Or set params.msa = 'nextclade'
and params.relatedness = true
in a config file.
WARNING : the aligned fasta from nextclade does not include a reference sequence. If this is desired for iqtree2, a fasta of the reference MUST be included with the input files and the outgroup CAN be specified with params.iqtree2_options = '-ninit 2 -n 2 -me 0.05 -m GTR -o <YOUR OUTGROUP>'
. Specifying the outgroup via 'params.iqtree2_outgroup'
will not be used.
And then you get trees like this which can visualized with itol or ggtree.
To classify reads with kraken2 to identify reads from human or the organism of choice
mkdir kraken2_db
cd kraken2_db
wget ftp://ftp.ccb.jhu.edu/pub/data/kraken2_dbs/old/minikraken2_v2_8GB_201904.tgz
tar -zxvf minikraken2_v2_8GB_201904.tgz
params.kraken2 = true
params.kraken2_db = 'kraken2_db'
params.kraken2_organism = "Severe acute respiratory syndrome-related coronavirus"
- seqyclean - for cleaning reads
- fastp - for cleaning reads ; optional, faster alternative to seqyclean
- bwa - for aligning reads to the reference
- minimap2 - an alternative to bwa
- ivar - calling variants and creating a consensus fasta; optional primer trimmer
- samtools - for QC metrics and sorting; optional primer trimmer; optional converting bam to fastq files; optional duplication marking
- fastqc - for QC metrics
- bedtools - for depth estimation over amplicons
- kraken2 - for read classification
- pangolin - for SARS-CoV-2 lineage classification
- freyja - for multiple SARS-CoV-2 lineage classifications
- nextclade - for SARS-CoV-2 clade classification
- vadr - for annotating fastas like NCBI
- mafft - for multiple sequence alignment (optional, relatedness must be set to "true")
- snp-dists - for relatedness determination (optional, relatedness must be set to "true")
- iqtree2 - for phylogenetic tree generation (optional, relatedness must be set to "true")
- nextalign - for phylogenetic tree generation (optional, relatedness must be set to "true", and msa must be set to "nextalign")
- bamsnap - no longer supported
- multiqc - summary of results
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.bedtools_multicov = true # bedtools multicov for coverage approximation of amplicons
params.nextclade = true # SARS-CoV-2 clade determination
params.pangolin = true # SARS-CoV-2 lineage determination
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.iqtree2 = true # creates phylogenetic tree from mafft multiple sequence alignement
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
Final File Tree after running cecret.nf
cecret # results from this workflow
βββ aligned # aligned (with aligner) but untrimmed bam files with indexes
βΒ Β βββ SRR13957125.sorted.bam
βΒ Β βββ SRR13957125.sorted.bam.bai
βΒ Β βββ SRR13957170.sorted.bam
βΒ Β βββ SRR13957170.sorted.bam.bai
βΒ Β βββ SRR13957177.sorted.bam
βΒ Β βββ SRR13957177.sorted.bam.bai
βββ bcftools_variants # set to false by default; VCF files of variants identified
βΒ Β βββ SRR13957125.vcf
βΒ Β βββ SRR13957170.vcf
βΒ Β βββ SRR13957177.vcf
βββ cecret_results.csv # comma-delimeted summary of results
βββ cecret_results.txt # tab-delimited summary of results
βββ combined_summary.csv # csv file of summary process
βββ consensus # the likely reason you are running this workflow
βΒ Β βββ SRR13957125.consensus.fa
βΒ Β βββ SRR13957170.consensus.fa
βΒ Β βββ SRR13957177.consensus.fa
βββ dataset # generated by nextclade
βΒ Β βββ genemap.gff
βΒ Β βββ primers.csv
βΒ Β βββ qc.json
βΒ Β βββ reference.fasta
βΒ Β βββ sequences.fasta
βΒ Β βββ tag.json
βΒ Β βββ tree.json
βΒ Β βββ virus_properties.json
βββ fasta_prep # optional for inputted fastas
βΒ Β βββ SRR13957125.test.fa
βΒ Β βββ SRR13957170.test.fa
βΒ Β βββ SRR13957177.test.fa
βββ fastp # optional tools for cleaning reads when 'params.cleaner = fastp'
βΒ Β βββ SRR13957125_clean_PE1.fastq.gz
βΒ Β βββ SRR13957125_clean_PE2.fastq.gz
βΒ Β βββ SRR13957125_fastp.html
βΒ Β βββ SRR13957125_fastp.json
βΒ Β βββ SRR13957170_clean_PE1.fastq.gz
βΒ Β βββ SRR13957170_clean_PE2.fastq.gz
βΒ Β βββ SRR13957170_fastp.html
βΒ Β βββ SRR13957170_fastp.json
βΒ Β βββ SRR13957177_clean_PE1.fastq.gz
βΒ Β βββ SRR13957177_clean_PE2.fastq.gz
βΒ Β βββ SRR13957177_fastp.html
βΒ Β βββ SRR13957177_fastp.json
βββ fastqc # QC metrics for each fasta sequence
βΒ Β βββ SRR13957125_1_fastqc.html
βΒ Β βββ SRR13957125_1_fastqc.zip
βΒ Β βββ SRR13957125_2_fastqc.html
βΒ Β βββ SRR13957125_2_fastqc.zip
βΒ Β βββ SRR13957170_1_fastqc.html
βΒ Β βββ SRR13957170_1_fastqc.zip
βΒ Β βββ SRR13957170_2_fastqc.html
βΒ Β βββ SRR13957170_2_fastqc.zip
βΒ Β βββ SRR13957177_1_fastqc.html
βΒ Β βββ SRR13957177_1_fastqc.zip
βΒ Β βββ SRR13957177_2_fastqc.html
βΒ Β βββ SRR13957177_2_fastqc.zip
βββ filter # fastq.gz files from reads that were aligned to the reference genome
βΒ Β βββ SRR13957125_filtered_R1.fastq.gz
βΒ Β βββ SRR13957125_filtered_R2.fastq.gz
βΒ Β βββ SRR13957125_filtered_unpaired.fastq.gz
βΒ Β βββ SRR13957170_filtered_R1.fastq.gz
βΒ Β βββ SRR13957170_filtered_R2.fastq.gz
βΒ Β βββ SRR13957170_filtered_unpaired.fastq.gz
βΒ Β βββ SRR13957177_filtered_R1.fastq.gz
βΒ Β βββ SRR13957177_filtered_R2.fastq.gz
βΒ Β βββ SRR13957177_filtered_unpaired.fastq.gz
βββ freyja # finding co-lineages
βΒ Β βββ aggregated-freyja.png
βΒ Β βββ aggregated-freyja.tsv
βΒ Β βββ SRR13957125_boot.tsv_lineages.csv
βΒ Β βββ SRR13957125_boot.tsv_summarized.csv
βΒ Β βββ SRR13957125_demix.tsv
βΒ Β βββ SRR13957125_depths.tsv
βΒ Β βββ SRR13957125_variants.tsv
βΒ Β βββ SRR13957170_boot.tsv_lineages.csv
βΒ Β βββ SRR13957170_boot.tsv_summarized.csv
βΒ Β βββ SRR13957170_demix.tsv
βΒ Β βββ SRR13957170_depths.tsv
βΒ Β βββ SRR13957170_variants.tsv
βΒ Β βββ SRR13957177_boot.tsv_lineages.csv
βΒ Β βββ SRR13957177_boot.tsv_summarized.csv
βΒ Β βββ SRR13957177_demix.tsv
βΒ Β βββ SRR13957177_depths.tsv
βΒ Β βββ SRR13957177_variants.tsv
βββ iqtree2 # phylogenetic tree that is generated with 'params.relatedness = true'
βΒ Β βββ iqtree2.iqtree
βΒ Β βββ iqtree2.log
βΒ Β βββ iqtree2.mldist
βΒ Β βββ iqtree2.treefile
βββ ivar_trim # bam files after primers have been trimmed off the reads with ivar
βΒ Β βββ SRR13957125_ivar.log
βΒ Β βββ SRR13957125.primertrim.sorted.bam
βΒ Β βββ SRR13957125.primertrim.sorted.bam.bai
βΒ Β βββ SRR13957170_ivar.log
βΒ Β βββ SRR13957170.primertrim.sorted.bam
βΒ Β βββ SRR13957170.primertrim.sorted.bam.bai
βΒ Β βββ SRR13957177_ivar.log
βΒ Β βββ SRR13957177.primertrim.sorted.bam
βΒ Β βββ SRR13957177.primertrim.sorted.bam.bai
βββ ivar_variants # tsv and vcf files of variants identified in sample
βΒ Β βββ SRR13957125.ivar_variants.vcf
βΒ Β βββ SRR13957125.variants.tsv
βΒ Β βββ SRR13957170.ivar_variants.vcf
βΒ Β βββ SRR13957170.variants.tsv
βΒ Β βββ SRR13957177.ivar_variants.vcf
βΒ Β βββ SRR13957177.variants.tsv
βββ kraken2 # kraken2 report of the organisms the reads may be from
βΒ Β βββ SRR13957125_kraken2_report.txt
βΒ Β βββ SRR13957170_kraken2_report.txt
βΒ Β βββ SRR13957177_kraken2_report.txt
βββ logs # divided log and err files for QC and troubleshooting pleasures
βΒ Β βββ processes*
βΒ Β Β Β βββ sample.run_id.err
βΒ Β Β Β βββ sample.run_id.log
βββ mafft # multiple sequence alignment created when 'params.relatedness = true'
βΒ Β βββ mafft_aligned.fasta
βββ markdup
βΒ Β βββ SRR13957125.markdup.sorted.bam
βΒ Β βββ SRR13957125.markdup.sorted.bam.bai
βΒ Β βββ SRR13957125_markdupstats.txt
βΒ Β βββ SRR13957170.markdup.sorted.bam
βΒ Β βββ SRR13957170.markdup.sorted.bam.bai
βΒ Β βββ SRR13957170_markdupstats.txt
βΒ Β βββ SRR13957177.markdup.sorted.bam
βΒ Β βββ SRR13957177.markdup.sorted.bam.bai
βΒ Β βββ SRR13957177_markdupstats.txt
βββ multicov # bedtools multicov over the amplicons
βΒ Β βββ SRR13957125.multicov.txt
βΒ Β βββ SRR13957170.multicov.txt
βΒ Β βββ SRR13957177.multicov.txt
βββ multiqc # aggregates data into single report
βΒ Β βββ multiqc_data
βΒ Β βΒ Β βββ multiqc_citations.txt
βΒ Β βΒ Β βββ multiqc_data.json
βΒ Β βΒ Β βββ multiqc_fastqc.txt
βΒ Β βΒ Β βββ multiqc_general_stats.txt
βΒ Β βΒ Β βββ multiqc_ivar_primers.txt
βΒ Β βΒ Β βββ multiqc_ivar_summary.txt
βΒ Β βΒ Β βββ multiqc.log
βΒ Β βΒ Β βββ multiqc_samtools_flagstat.txt
βΒ Β βΒ Β βββ multiqc_samtools_stats.txt
βΒ Β βΒ Β βββ multiqc_seqyclean.txt
βΒ Β βΒ Β βββ multiqc_sources.txt
βΒ Β βββ multiqc_report.html
βββ nextclade # nextclade reports
βΒ Β βββ combined.fasta
βΒ Β βββ nextclade.aligned.fasta
βΒ Β βββ nextclade.auspice.json
βΒ Β βββ nextclade.csv
βΒ Β βββ nextclade.errors.csv
βΒ Β βββ nextclade.gene.E.fasta
βΒ Β βββ nextclade.gene.M.fasta
βΒ Β βββ nextclade.gene.N.fasta
βΒ Β βββ nextclade.gene.ORF1a.fasta
βΒ Β βββ nextclade.gene.ORF1b.fasta
βΒ Β βββ nextclade.gene.ORF3a.fasta
βΒ Β βββ nextclade.gene.ORF6.fasta
βΒ Β βββ nextclade.gene.ORF7a.fasta
βΒ Β βββ nextclade.gene.ORF7b.fasta
βΒ Β βββ nextclade.gene.ORF8.fasta
βΒ Β βββ nextclade.gene.ORF9b.fasta
βΒ Β βββ nextclade.gene.S.fasta
βΒ Β βββ nextclade.insertions.csv
βΒ Β βββ nextclade.json
βΒ Β βββ nextclade.tsv
βββ pangolin # pangolin results
βΒ Β βββ combined.fasta
βΒ Β βββ lineage_report.csv
βββ samtools_ampliconstats # amplicon statistics and metrics as determined by samtools
βΒ Β βββ SRR13957125_ampliconstats.txt
βΒ Β βββ SRR13957170_ampliconstats.txt
βΒ Β βββ SRR13957177_ampliconstats.txt
βββ samtools_coverage # coverage and metrics as determined by samtools
βΒ Β βββ SRR13957125.cov.aligned.hist
βΒ Β βββ SRR13957125.cov.aligned.txt
βΒ Β βββ SRR13957125.cov.trimmed.hist
βΒ Β βββ SRR13957125.cov.trimmed.txt
βΒ Β βββ SRR13957170.cov.aligned.hist
βΒ Β βββ SRR13957170.cov.aligned.txt
βΒ Β βββ SRR13957170.cov.trimmed.hist
βΒ Β βββ SRR13957170.cov.trimmed.txt
βΒ Β βββ SRR13957177.cov.aligned.hist
βΒ Β βββ SRR13957177.cov.aligned.txt
βΒ Β βββ SRR13957177.cov.trimmed.hist
βΒ Β βββ SRR13957177.cov.trimmed.txt
βββ samtools_depth # the number of reads
βΒ Β βββ SRR13957125.depth.aligned.txt
βΒ Β βββ SRR13957125.depth.trimmed.txt
βΒ Β βββ SRR13957170.depth.aligned.txt
βΒ Β βββ SRR13957170.depth.trimmed.txt
βΒ Β βββ SRR13957177.depth.aligned.txt
βΒ Β βββ SRR13957177.depth.trimmed.txt
βββ samtools_flagstat # flag information
βΒ Β βββ SRR13957125.flagstat.aligned.txt
βΒ Β βββ SRR13957125.flagstat.trimmed.txt
βΒ Β βββ SRR13957125.flagstat.txt
βΒ Β βββ SRR13957170.flagstat.aligned.txt
βΒ Β βββ SRR13957170.flagstat.trimmed.txt
βΒ Β βββ SRR13957170.flagstat.txt
βΒ Β βββ SRR13957177.flagstat.aligned.txt
βΒ Β βββ SRR13957177.flagstat.trimmed.txt
βΒ Β βββ SRR13957177.flagstat.txt
βββ samtools_plot_ampliconstats # plots of the ampliconstats for troubleshooting purposes
βΒ Β βββ SRR13957125
βΒ Β βββ SRR13957125-combined-amp.gp
βΒ Β βββ SRR13957125-combined-amp.png
βΒ Β βββ SRR13957125-combined-coverage-1.gp
βΒ Β βββ SRR13957125-combined-coverage-1.png
βΒ Β βββ SRR13957125-combined-depth.gp
βΒ Β βββ SRR13957125-combined-depth.png
βΒ Β βββ SRR13957125-combined-read-perc.gp
βΒ Β βββ SRR13957125-combined-read-perc.png
βΒ Β βββ SRR13957125-combined-reads.gp
βΒ Β βββ SRR13957125-combined-reads.png
βΒ Β βββ SRR13957125-combined-tcoord.gp
βΒ Β βββ SRR13957125-combined-tcoord.png
βΒ Β βββ SRR13957125-combined-tdepth.gp
βΒ Β βββ SRR13957125-combined-tdepth.png
βΒ Β βββ SRR13957125-heat-amp-1.gp
βΒ Β βββ SRR13957125-heat-amp-1.png
βΒ Β βββ SRR13957125-heat-coverage-1-1.gp
βΒ Β βββ SRR13957125-heat-coverage-1-1.png
βΒ Β βββ SRR13957125-heat-read-perc-1.gp
βΒ Β βββ SRR13957125-heat-read-perc-1.png
βΒ Β βββ SRR13957125-heat-read-perc-log-1.gp
βΒ Β βββ SRR13957125-heat-read-perc-log-1.png
βΒ Β βββ SRR13957125-heat-reads-1.gp
βΒ Β βββ SRR13957125-heat-reads-1.png
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-amp.gp
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-amp.png
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-cov.gp
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-cov.png
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-reads.gp
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-reads.png
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-tcoord.gp
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-tcoord.png
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-tdepth.gp
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-tdepth.png
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-tsize.gp
βΒ Β βββ SRR13957125-SRR13957125.primertrim.sorted-tsize.png
βΒ Β βββ SRR13957170
βΒ Β βββ SRR13957170-combined-amp.gp
βΒ Β βββ SRR13957170-combined-amp.png
βΒ Β βββ SRR13957170-combined-coverage-1.gp
βΒ Β βββ SRR13957170-combined-coverage-1.png
βΒ Β βββ SRR13957170-combined-depth.gp
βΒ Β βββ SRR13957170-combined-depth.png
βΒ Β βββ SRR13957170-combined-read-perc.gp
βΒ Β βββ SRR13957170-combined-read-perc.png
βΒ Β βββ SRR13957170-combined-reads.gp
βΒ Β βββ SRR13957170-combined-reads.png
βΒ Β βββ SRR13957170-combined-tdepth.gp
βΒ Β βββ SRR13957170-combined-tdepth.png
βΒ Β βββ SRR13957170-heat-amp-1.gp
βΒ Β βββ SRR13957170-heat-amp-1.png
βΒ Β βββ SRR13957170-heat-coverage-1-1.gp
βΒ Β βββ SRR13957170-heat-coverage-1-1.png
βΒ Β βββ SRR13957170-heat-read-perc-1.gp
βΒ Β βββ SRR13957170-heat-read-perc-1.png
βΒ Β βββ SRR13957170-heat-read-perc-log-1.gp
βΒ Β βββ SRR13957170-heat-read-perc-log-1.png
βΒ Β βββ SRR13957170-heat-reads-1.gp
βΒ Β βββ SRR13957170-heat-reads-1.png
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-amp.gp
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-amp.png
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-cov.gp
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-cov.png
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-reads.gp
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-reads.png
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-tdepth.gp
βΒ Β βββ SRR13957170-SRR13957170.primertrim.sorted-tdepth.png
βΒ Β βββ SRR13957177
βΒ Β βββ SRR13957177-combined-amp.gp
βΒ Β βββ SRR13957177-combined-amp.png
βΒ Β βββ SRR13957177-combined-coverage-1.gp
βΒ Β βββ SRR13957177-combined-coverage-1.png
βΒ Β βββ SRR13957177-combined-depth.gp
βΒ Β βββ SRR13957177-combined-depth.png
βΒ Β βββ SRR13957177-combined-read-perc.gp
βΒ Β βββ SRR13957177-combined-read-perc.png
βΒ Β βββ SRR13957177-combined-reads.gp
βΒ Β βββ SRR13957177-combined-reads.png
βΒ Β βββ SRR13957177-combined-tcoord.gp
βΒ Β βββ SRR13957177-combined-tcoord.png
βΒ Β βββ SRR13957177-combined-tdepth.gp
βΒ Β βββ SRR13957177-combined-tdepth.png
βΒ Β βββ SRR13957177-heat-amp-1.gp
βΒ Β βββ SRR13957177-heat-amp-1.png
βΒ Β βββ SRR13957177-heat-coverage-1-1.gp
βΒ Β βββ SRR13957177-heat-coverage-1-1.png
βΒ Β βββ SRR13957177-heat-read-perc-1.gp
βΒ Β βββ SRR13957177-heat-read-perc-1.png
βΒ Β βββ SRR13957177-heat-read-perc-log-1.gp
βΒ Β βββ SRR13957177-heat-read-perc-log-1.png
βΒ Β βββ SRR13957177-heat-reads-1.gp
βΒ Β βββ SRR13957177-heat-reads-1.png
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-amp.gp
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-amp.png
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-cov.gp
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-cov.png
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-reads.gp
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-reads.png
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-tcoord.gp
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-tcoord.png
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-tdepth.gp
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-tdepth.png
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-tsize.gp
βΒ Β βββ SRR13957177-SRR13957177.primertrim.sorted-tsize.png
βββ samtools_stats # stats as determined by samtools
βΒ Β βββ SRR13957125.stats.aligned.txt
βΒ Β βββ SRR13957125.stats.trimmed.txt
βΒ Β βββ SRR13957125.stats.txt
βΒ Β βββ SRR13957170.stats.aligned.txt
βΒ Β βββ SRR13957170.stats.trimmed.txt
βΒ Β βββ SRR13957170.stats.txt
βΒ Β βββ SRR13957177.stats.aligned.txt
βΒ Β βββ SRR13957177.stats.trimmed.txt
βΒ Β βββ SRR13957177.stats.txt
βββ seqyclean # reads that have had PhiX and adapters removed
βΒ Β βββ Combined_SummaryStatistics.tsv
βΒ Β βββ SRR13957125_clean_PE1.fastq.gz
βΒ Β βββ SRR13957125_clean_PE2.fastq.gz
βΒ Β βββ SRR13957125_clean_SummaryStatistics.tsv
βΒ Β βββ SRR13957125_clean_SummaryStatistics.txt
βΒ Β βββ SRR13957170_clean_PE1.fastq.gz
βΒ Β βββ SRR13957170_clean_PE2.fastq.gz
βΒ Β βββ SRR13957170_clean_SummaryStatistics.tsv
βΒ Β βββ SRR13957170_clean_SummaryStatistics.txt
βΒ Β βββ SRR13957177_clean_PE1.fastq.gz
βΒ Β βββ SRR13957177_clean_PE2.fastq.gz
βΒ Β βββ SRR13957177_clean_SummaryStatistics.tsv
βΒ Β βββ SRR13957177_clean_SummaryStatistics.txt
βββ snp-dists # SNP matrix created with 'params.relatedness = true'
βΒ Β βββ snp-dists.txt
βββ submission_files # optional functionality that requires a key and renames files when 'params.rename = true'
βΒ Β βββ UT-UPHL-2103503681_filtered_R1.fastq.gz
βΒ Β βββ UT-UPHL-2103503681_filtered_R2.fastq.gz
βΒ Β βββ UT-UPHL-2103503681.genbank.fa
βΒ Β βββ UT-UPHL-2103503681.gisaid.fa
βΒ Β βββ UT-UPHL-2103929243_filtered_R1.fastq.gz
βΒ Β βββ UT-UPHL-2103929243_filtered_R2.fastq.gz
βΒ Β βββ UT-UPHL-2103929243.genbank.fa
βΒ Β βββ UT-UPHL-2103929243.gisaid.fa
βΒ Β βββ UT-UPHL-2103954304_filtered_R1.fastq.gz
βΒ Β βββ UT-UPHL-2103954304_filtered_R2.fastq.gz
βββ summary # convenient summary files
βΒ Β βββ combined_summary.csv
βΒ Β βββ SRR13957125.summary.csv
βΒ Β βββ SRR13957170.summary.csv
βΒ Β βββ SRR13957177.summary.csv
βββ vadr # consensus file QC
βββ combined.fasta
βββ trimmed.fasta
βββ vadr.vadr.alc
βββ vadr.vadr.alt
βββ vadr.vadr.alt.list
βββ vadr.vadr.cmd
βββ vadr.vadr.dcr
βββ vadr.vadr.fail.fa
βββ vadr.vadr.fail.list
βββ vadr.vadr.fail.tbl
βββ vadr.vadr.filelist
βββ vadr.vadr.ftr
βββ vadr.vadr.log
βββ vadr.vadr.mdl
βββ vadr.vadr.pass.fa
βββ vadr.vadr.pass.list
βββ vadr.vadr.pass.tbl
βββ vadr.vadr.rpn
βββ vadr.vadr.sda
βββ vadr.vadr.seqstat
βββ vadr.vadr.sgm
βββ vadr.vadr.sqa
βββ vadr.vadr.sqc
reads # user supplied fastq files for analysis
single_reads # user supplied fastq files for analysis
fastas # user supplied fasta files for analysis
multifastas # user supplied multifasta files for analysis
work # nextflow's working directories
A FILE THAT THE END USER CAN COPY AND EDIT IS FOUND AT configs/cecret_config_template.config
To get a copy of the config file, the End User can use the following command. This creates an edit_me.config
file in the current directory.
nextflow run UPHL-BioNGS/Cecret --config_file true
This file contains all of the configurable parameters with their default values. Use '-c'
to specify the edited config file.
nextflow run Cecret.nf -c <path to custom config file>
If the End User is using some sort of cloud or HPC setup, it is highly recommended that this file is copied and edited appropriately. A limited list of parameters is listed below:
- params.reads = workflow.launchDir + '/reads'
- params.single_reads = workflow.launchDir + '/single_reads'
- params.fastas = workflow.launchDir + '/fastas'
- params.multifastas = workflow.launchDir + '/multifastas'
- params.outdir = workflow.launchDir + '/cecret'
- To "resume" a workflow, use
-resume
with the nextflow command - To create a report, use
-with-report
with the nextflow command - To use nextflow tower, use
-with-tower
with the nextflow command
TELL ME ABOUT IT!!!
- Github issue
- Email me
- Send me a message on slack
Be sure to include the command that was used, what config file was used, and what the nextflow error was.
The multiqc report aggregates data across your samples into one file. Open the 'cecret/multiqc/multiqc_report.html' file with your favored browser. There tables and graphs are generated for 'General Statistics', 'Samtools stats', 'Samtools flagstats', 'FastQC', 'iVar', 'SeqyClean', 'Fastp', 'Pangolin', and 'Kraken2'.
In the history of this repository, there actually was an attempt to store fastq files here that the End User could use to test out this workflow. This made the repository very large and difficult to download.
Instead, it recommended that the End User uses the SARS-CoV-2 datasets, an effort of the CDC to provide a benchmark dataset for validating bioinformatic workflows. Fastq files from the nonviovoc, voivoc, and failed projects were downloaded from the SRA and put through this workflow. The summary files are included in the data directory under the following filenames for comparison:
- data/default_datasets_summary.csv : Using the default options
- data/toggled_datasets_summary.csv : Using fastp, minimap2, and samtools ampliconclip
- data/uphl_datasets_summary.csv : Using UPHL's profile (which is essentially the same as using the default options, but includes a kraken2 database used locally)
The expected amount of time to run this workflow with 250 G RAM and 48 CPUs, 'params.maxcpus = 8', and 'params.medcpus = 4' is ~42 minutes. This corresponded with 25.8 CPU hours.
There is also a sample mpx dataset file that was using the mpx profile for ERR9810266, ERR9912327, SRR19536726, and SRR19536727
# for a collection of fastas
nextflow run UPHL-BioNGS/Cecret -profile singularity --fastas <directory with fastas>
# for a collection of fastas and multifastas
nextflow run UPHL-BioNGS/Cecret -profile singularity --fastas <directory with fastas> --multifastas <directory with multifastas>
The End User can run mafft, snpdists, and iqtree on a collection of fastas as well with
nextflow run UPHL-BioNGS/Cecret -profile singularity --relatedness true --fastas <directory with fastas> --multifastas <directory with multifastas>
The End User can have paired-end, singled-end, and fastas that can all be put together into one analysis.
nextflow run UPHL-BioNGS/Cecret -profile singularity --relatedness true --fastas <directory with fastas> --multifastas <directory with multifastas> --reads <directory with paire-end reads> --single_reads <directory with single-end reads>
The End User is more than welcome to look at an example here. Just remove the comments for the parameters that need to be adjusted and specify with -c
.
To get a copy of the config file, the End User can use the following command. This created edit_me.config in the current directory.
nextflow run UPHL-BioNGS/Cecret --config_file true
At UPHL, our config file is small enough to be put as a profile option, but the text of the config file would be as follows:
singularity.enabled = true
singularity.autoMounts = true
params {
reads = "Sequencing_reads/Raw"
kraken2 = true
kraken2_db = '/Volumes/IDGenomics_NAS/Data/kraken2_db/h+v'
vadr = false
}
And then run with
nextflow run Cecret.nf -c <path to custom config file>
There are two ways to do this.
cecret/bedtools_multicov
has a file for each sample.
This is standard bedtools multicov output, so it doesn't have a header.
- Column 1 : The reference
- Column 2 : Start of amplicon
- Column 3 : End of amplicon
- Column 4 : Amplicon number
- Column 5-6 : version number and strand from bedfile
- Column 7 : (Column G) is the depth observed for that amplicon for that sample.
cecret/samtools_ampliconstats
has a file for each sample
Row number 126 (FDEPTH) has a column for each amplicon (also without a header). To get this row for all of the samples, grep
the keyword "FDEPTH" from each sample.
grep "^FDEPTH" cecret/samtools_ampliconstats/* > samtools_ampliconstats_all.tsv
There are corresponding images in cecret/samtools_plot_ampliconstats
for each sample.
The primer bedfile is the file with the start and stop of each primer sequence.
$ head configs/artic_V3_nCoV-2019.primer.bed
MN908947.3 30 54 nCoV-2019_1_LEFT nCoV-2019_1 +
MN908947.3 385 410 nCoV-2019_1_RIGHT nCoV-2019_1 -
MN908947.3 320 342 nCoV-2019_2_LEFT nCoV-2019_2 +
MN908947.3 704 726 nCoV-2019_2_RIGHT nCoV-2019_2 -
MN908947.3 642 664 nCoV-2019_3_LEFT nCoV-2019_1 +
MN908947.3 1004 1028 nCoV-2019_3_RIGHT nCoV-2019_1 -
MN908947.3 943 965 nCoV-2019_4_LEFT nCoV-2019_2 +
MN908947.3 1312 1337 nCoV-2019_4_RIGHT nCoV-2019_2 -
MN908947.3 1242 1264 nCoV-2019_5_LEFT nCoV-2019_1 +
MN908947.3 1623 1651 nCoV-2019_5_RIGHT nCoV-2019_1 -
The amplicon bedfile is the file with the start and stop of each intended amplicon.
$ head configs/artic_V3_nCoV-2019.insert.bed <==
MN908947.3 54 385 1 1 +
MN908947.3 342 704 2 2 +
MN908947.3 664 1004 3 1 +
MN908947.3 965 1312 4 2 +
MN908947.3 1264 1623 5 1 +
MN908947.3 1595 1942 6 2 +
MN908947.3 1897 2242 7 1 +
MN908947.3 2205 2568 8 2 +
MN908947.3 2529 2880 9 1 +
MN908947.3 2850 3183 10 2 +
Due to the many varieties of primer bedfiles, it is best if the End User supplied this file for custom primer sequences.
First of all, this is a great thing! Let me know if tools specific for your organism should be added to this workflow.
In a config file, change the following relevant parameters:
params.reference_genome
params.primer_bed
params.amplicon_bed #or set params.bedtools_multicov = false
params.gff_file #or set params.ivar_variants = false
And set
params.species = 'other'
params.pangolin = false
params.freyja = false
params.nextclade = false #or adjust nexclade_prep_options from '--name sars-cov-2' to the name of the relevent dataset
params.vadr = false #or configure the vadr container appropriately and params.vadr_reference
Although not perfect, if 'params.filter = true'
, then only the reads that were mapped to the reference are returned. This should eliminate all human contamination (as long as human is not part of the supplied reference) and all "problematic" incidental findings.
This workflow has too many bells and whistles. I really only care about generating a consensus fasta. How do I get rid of all the extras?
Change the parameters in a config file and set most of them to false.
params.species = 'none'
params.fastqc = false
params.ivar_variants = false
params.samtools_stats = false
params.samtools_coverage = false
params.samtools_depth = false
params.samtools_flagstat = false
params.bedtools_multicov = false
params.samtools_ampliconstats = false
params.samtools_plot_ampliconstats = false
params.bedtools_multicov = false
params.pangolin = false
params.freyja = false
params.nextclade = false
params.vadr = false
params.multiqc = false
And, yes, this means I added some bells and whistles so the End User could turn off the bells and whistles. /irony
No. Prior versions supported a tool called bamsnap, which had the potential to be great. Due to time constraints, this feature is no longer supported.
Never fear, they are still in nextflow's work directory if the End User really needs them. They are no longer included in publishDir
because of size issues. The BAM files are still included in publishDir
, and most analyses for SAM files can be done with BAM files.
Personally, I like having stderr
saved to a file because some of the tools using in this workflow print to stderr
instead of stdout
. I have found, however, that this puts all the error text into a file, which a lot of users-new-to-nextflow had a hard time finding. It is easier to assist and troubleshoot with End Users when stderr
is printed normally.
What is in the works to get added to 'Cecret'? (These are waiting for either versions to stabilize or a docker container to be available.)
- https://github.com/chrisruis/bammix
- https://github.com/lenaschimmel/sc2rf
- primalseq mpx primers
- masking options for phylogenetic relatedness