Here, you can find an explanation of the different computations, tools or metrics implemented in deepCSA.
Use these outputs to assess overall data quality before interpreting biological signals:
- Depth summaries (
depthssummary/): verify consistent coverage across samples and genes. - Mutation density vs depth (
qc/metrics_vs_depth/): check that mutation density does not collapse in low-depth samples. - Omega QC (
qc/metrics_vs_depth/+qc/annotated_omegas): highlights genes/samples with unstable omega estimates. - Mutational profile stability (
computeprofile/*.profile_stability.tsv): higher deviations indicate unstable mutational profiles (see below).
omega/uses per-sample mutational profiles and per-sample synonymous rates to estimate selection.omegagloballoc/uses a global cohort mutational profile and global synonymous rates (shared across samples), which stabilizes estimates in low-burden samples and facilitates cohort-level comparisons.
Use omega for sample-specific selection signals and omegagloballoc for conservative cohort-level estimates.
Outputs in sitecomparison/ and sitecomparisongloballoc/ compare observed vs expected mutations per site or residue:
OBSERVED_MUTS: number of observed mutations.EXPECTED_MUTS: expected mutations from mutability models.OBS/EXP: selection enrichment ratio.p_value: Poisson p-value for observing at leastOBSERVED_MUTSgivenEXPECTED_MUTS.
The resolution is controlled by site_comparison_grouping (site, aminoacid, or aminoacid_change).
sigprofilerassignment/: assignments of known COSMIC signatures; includes activity tables and plots.signatures_hdp/: extracted signatures using a hierarchical Dirichlet process.sigprobs//muts2sigs/: per-mutation signature probabilities (useful for downstream stratification).
Interpret signature results alongside mutation counts and profile stability to avoid over-interpreting low-burden samples.
The file *.profile_stability.tsv is generated by adding a single mutation to each of the 96 SBS channels and measuring the L1 deviation from the original profile. Reported statistics include:
mean_deviation,min_deviation,max_deviation,std_deviation
Lower deviations indicate a more stable (less noisy) profile.
We are in the process of completing the documentation, but in the meantime you can check the recently published paper and its supplementary material for more details.
This can be found in the mutdensityadj folder of the deepCSA output.
The goal is to define a mean mutation density estimate for a specific subset of mutation sites. For example, we might be interested in measuring what is the mutation density at the set of missense mutation sites -- i.e., mutation sites in the CDS that induce missense mutations.
In the context of bulk-ultradeep sequencing, there are several factors that can influence the occurrence of mutations at a given site.
-
trinucleotide context of the site
-
neutral mutagenesis, defined as:
-
normalized profile: vector of relative mutabilities for each trinucleotide context
-
exposure associated with the profile, expressed as mutation burden
-
-
sequencing depth of the site
-
selection of the site
We would like to define a way to compute the mutation density that corrects for potential confounders like depth and triplet content, thus rendering the estimates more comparable. For example, the missense sites in gene A may imply that more missense mutations per site are observed than in gene B, even if both genes are subject to the same exact mutational process.
Given a collection
Assuming even depth
Throughout we make the following assumptions:
-
the only way mutations come about is by neutral mutagenesis
-
discrepancies between neutral mutagenesis and the observed mutations are due to selection
Mutation sites are defined as specific single base nucleotide changes. Each mutation site corresponds to a tri-nucleotide context of the form
Let
Note that in order to render absolute mutabilities, the
Let
Let
For each mutation site
Given a collection
Note that this definition of length has an arbitrary interpretation, because of the multiple possible choices that we can make for the relative mutational profile. To render a universal length, we must set a scale to represent the mutational profile with a concrete meaning. What would be a good practical reference?
One possibility would be to choose a scaling factor
If
Because
Applying this scaling, the effective length would take the following form:
Defining the mutation density as
For more explanations on omega go to the corresponding repo.
deepCSA applies Benjamini-Hochberg multiple-testing correction separately for each of the following
comparison sets: all-samples (cohort), sample groups, and per-sample results, and it does this
independently for gene-level and subgenic regions. The corrected values are reported in the
pvalue_adj column. P-values equal to 0 are set to 1.17e-38 (minimum non-zero float32) before
correction to avoid underflow.
The site comparison step takes advantage of the computation of mutabilities in omega, and then compares these mutabilities either by residue, residue change or nucleotide change.
deepCSA wraps the dNdScv R package and runs it with a dynamically built RefCDS reference instead of relying on a pre-baked .rda transcripts file.
The dnds subworkflow performs three steps for every run:
ADAPT_PANEL_REFCDS(dNdScv_panel_prep.py) — filter the biomart export referenced byparams.dnds_biomart_refto the transcripts overlapping the panel BED.BUILD_REFCDS— calldndscv::buildrefusingparams.fastato produce a freshRefCDS_custom.rda.DNDSRUN(dNdS_run.R) — run dNdScv on the cohort, producing*.cv.tsv,*.globaldnds.tsvand*.loc.tsvunderselection/dndscv/{cv,persample,local}/.
Instructions for regenerating the biomart TSV are in assets/build_datasets/dndscv/instructions.txt. The previously required dnds_ref_transcripts parameter has been removed.
When mutation density and the all-regions profile are computed, deepCSA also generates a quick dN/dS proxy per gene by taking the ratio of non-synonymous vs synonymous adjusted mutation densities. The implementation is in mut_density_adjusted_dnds.py and the results are published to selection/dndsproxy/ as *.gene_mutdensities_n_dnds.tsv.
This metric is intended as a fast sanity check and is independent of the R-based dNdScv run and of omega, both of which provide dN/dS estimates with significance testing. It is gated by run_mutdensity (which itself is enabled by either mutationdensity or omega) combined with profileall.
The qc/metrics_vs_depth/ directory is produced by PLOT_METRICS_VS_DEPTH_QC (in the plotting_qc subworkflow) and is always generated. It joins per-gene/sample average depth (from the PLOTDEPTHSEXONSCONS step) with:
- raw mutation densities (
mutdensity/) - adjusted mutation densities (
mutdensity_adjusted/) - omega-globalloc estimates (
selection/omegagloballoc/)
Each combination yields a scatter PDF and a status TSV under *.metrics_depth_qc/, used to flag samples/genes whose metric values may be confounded by sequencing depth.
We provide two different strategies for signature analysis.
-
Using SigProfilerAssignment with a set of known SBS signatures
-
Using a Hierarchical Dirichlet Process algorithm developed by Nicola Robets and compacted by the McGranahan lab into a wrapped version.
- The outputs of the signature extraction process are then further processed downstream using SigProfilerAssignment to decompose the de novo signature and reassign mutational processes to samples.
-
Additionally we also output mutation count matrices that are ready to be run through MSA which is another method for mutational signature attribution.
Additionally one could run SigProfilerExtractor on the data but this needs to be done externally.
deepCSA defines container images directly in module files and conf/modules.config. For bbglab-maintained images (bbglab/*), Dockerfile recipes are tracked in the lab repository: https://github.com/bbglab/containers-recipes. External images (e.g., ferriolcalvet/*, rblancomi/*, biocontainers/*) should be mirrored locally if strict reproducibility is required.
Key images used by the pipeline:
| Component | Image |
|---|---|
| Core utilities | docker.io/bbglab/deepcsa-core:0.1.0 |
| Panel BED tools | docker.io/bbglab/deepcsa_bed:latest |
| Omega | docker.io/bbglab/omega:0.2.1 |
| Oncodrive3D | docker.io/bbglab/oncodrive3d:1.0.5 |
| Oncodrive3D (ChimeraX plots) | docker.io/spellegrini87/oncodrive3d_chimerax:latest |
| OncodriveFML | docker.io/ferriolcalvet/oncodrivefml:latest |
| OncodriveCLUSTL | docker.io/ferriolcalvet/oncodriveclustl:latest |
| SigProfilerAssignment | docker.io/ferriolcalvet/sigprofiler_assignment:1.1.3 |
| SigProfilerMatrixGenerator | docker.io/ferriolcalvet/sigprofilermatrixgenerator:1.3.5 |
| mSigHdp (HDP) | docker.io/ferriolcalvet/msighdp:latest |
| bbgregressions | docker.io/rblancomi/bbgregressions:dev |
| Ensembl VEP | biocontainers/ensembl-vep:111.0--pl5321h2a3209d_0 (version depends on vep_cache_version) |
| SAMtools | biocontainers/samtools:1.18--h50ea8bc_1 |
To override any image, set process.container or the relevant module label in your nextflow.config.