rabiafidan/pure-faf
Formalin artefact filtering of tumour sample VCF files
Overview
Latest release: deepsomatic, Last update: 2026-11-24
Share link: https://snakemake.github.io/snakemake-workflow-catalog?wf=rabiafidan/pure-faf
Quality control: linting: failed formatting: failed
Topics: cancer-genomics ffpe variant-filtration
Deployment
Step 1: Install Snakemake and Snakedeploy
Snakemake and Snakedeploy are best installed via the Conda package manager. It is recommended to install conda via Miniforge. Run
conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy
to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via
conda activate snakemake
For other installation methods, refer to the Snakemake and Snakedeploy documentation.
Step 2: Deploy workflow
With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:
mkdir -p path/to/project-workdir
cd path/to/project-workdir
In all following steps, we will assume that you are inside of that directory. Then run
snakedeploy deploy-workflow https://github.com/rabiafidan/pure-faf . --tag deepsomatic
Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.
Step 3: Configure workflow
To configure the workflow, adapt config/config.yml to your needs following the instructions below.
Step 4: Run workflow
The deployment method is controlled using the --software-deployment-method (short --sdm) argument.
To run the workflow using a combination of conda and apptainer/singularity for software deployment, use
snakemake --cores all --sdm conda apptainer
Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.
For further options such as cluster and cloud execution, see the docs.
Step 5: Generate report
After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using
snakemake --report report.zip
Configuration
The following section is imported from the workflow’s config/README.md.
Workflow overview
This workflow is a best-practice workflow for variant filtering of formalin fixed tumour samples. The workflow is built using snakemake and consists of the following steps:
Annotating rhe VCF with a custom panel of normals (PON)
Applying a general quality filter with creteria including PON, AD and ROQ
Splitting variants into confidence tiers using an AD threshold
Intersecting low-confidence indels with a second tool’s indel calls. Intersection is indel type-specific (insertion or deletion), and only position-based (alt allele doesn’t matter).
Running microsec twice with different parameters for low-confidence and high-confidence tiers
Merging the results back annotating VCF with microsec results
Applyying different filtering methods on the annotated VCF
Applying a post-filter VAF filter
Quality control using FFPEsig repaired and unrepaired signatures
See the worflow diagram.
Running the workflow
Input data
You need these following files:
Mutect2 VCF files (with AD, DP and ROQ annotations)
Strelka2 indel VCF (or any other secondary variant caller should theoratically work)
Sample bam/cram file
Human reference genome fasta you used for alignment and variant calling
You need the following information:
tumour and normal sample names
Sequencing read length
Sequencing adapters
Using the input files and information, you need to create a sample sheet as follows:
tumour_name |
normal_name |
Mutect2_vcf |
Strelka2_indel_vcf |
tumour_bam_cram |
sequencing_read_length |
sequencing_adapter_1 |
sequencing_adapter_2 |
|---|---|---|---|---|---|---|---|
K1058_K1058_HB005_D02 |
K1058_K1058_BC001_D01 |
path/to/ROQ_flagged_K1058_HB005_D02.vcf.gz |
path/to/K1058_HB005_D02_vs_K1058_BC001_D01/K1058_HB005_D02_vs_K1058_BC001_D01.strelka.somatic_indels.vcf.gz |
path/to/K1058_HB005_D02/K1058_HB005_D02.recal.cram |
300 |
AGCGAGAT-CCAGTATC |
AGCGAGAT-CCAGTATC |
K1058_K1058_HB003_D02 |
K1058_K1058_BC001_D01 |
path/to/ROQ_flagged_K1058_HB003_D02.vcf.gz |
path/to/K1058_HB003_D02_vs_K1058_BC001_D01/K1058_HB003_D02_vs_K1058_BC001_D01.strelka.somatic_indels.vcf.gz |
path/to/K1058_HB003_D02/K1058_HB003_D02.recal.cram |
300 |
CTTGCTAG-TCATCTCC |
CTTGCTAG-TCATCTCC |
Parameters
You then need to configure the workflow by updating the config/config.yaml. This table lists all parameters that can be used to run the workflow. All parameters except exclude_samples are mandatory.
parameter |
type |
details |
VAULT setup |
|---|---|---|---|
samplesheet |
|||
path |
str |
path to samplesheet. |
|
ref_genome |
|||
ref_genome_version |
str |
choose one of GRCh38 or GRCh37, case-insensitive. |
|
ref_genome_fasta |
str |
path to the human reference genome. |
|
VCF quality filter thresholds |
|||
AD |
num |
minimum alternative allele count |
4 |
ROQ |
num |
ROQ threshold for read orientation quality |
20 |
DP |
num |
minimum read depth |
0 - no seperate DP filtering |
PON parameters |
|||
PON_alpha |
num |
Beta test significance level |
0.05 |
Microsec parameters |
|||
AD_tier_threshold |
num |
maximum AD for low-confidence tier |
10 |
pval_threshold_high_AD |
num |
pvalue threshold for |
1e-4 |
pval_threshold_low_AD |
num |
pvalue threshold for |
1e-6 |
Post-filter thresholds |
|||
VAF |
array |
a list of VAF values you want to apply after formalin filtering. All will appear in the QC plot. |
|
Other parameters |
|||
odir |
str |
output directory. This will appear under results/ |
|
exclude_samples |
array |
a list of sample names you want to exclude from the analysis. Default is empty list. |
Output
results/odir/
├── logs
├── 1-step1_sample1.log
├── 2-step2_sample1.log
├── ...
├── filtered_vcf #MAIN OUTPUT FOLDER
├── 1-sample1_msec_all_filtered.vcf.gz #passing all microsec filters
├── 1-sample2_vault_filtered.vcf.gz #filtering creteria used in VAULT paper
├── 1-sample1__vault_plus_SR_filtered.vcf.gz #VAULT createria + simple repeat filter (relevant if whole genome data, otherwise almost no difference)
├── 2-..... #various VAF filtered VCFs
├── 2-..... #various VAF filtered VCFs
├── microsec_input # sample info and mutation info files for microsec
├── microsec_output #microsec tsv output files for samples and tiers
├── ffpe_sig #QC plots and tables using FFPEsig repaired and unrepaired signatures
├── temp # intermediate files. Most is automatically deleted after workflow completion. Remaining ones may be useful or can be deleted manually.
└── PON # custom RepSeq panel of normals annotation and beta distribution testing results. Kind of intermediate, can be deleted if not needed.
Workflow parameters
The following table is automatically parsed from the workflow’s config.schema.y(a)ml file.
Parameter |
Type |
Description |
Required |
Default |
|---|---|---|---|---|
samplesheet |
string |
path to sample-sheet TSV file |
yes |
|
ref_genome_version |
string |
pick from Grch37 or Grch38, case insensitive |
yes |
|
reference_genome_fasta |
string |
Path to the human reference genome FASTA file that you used for alignment and variant calling |
yes |
|
ROQ |
integer |
Read orientation bias filtering ROQ threshold for Mutect2 variants |
yes |
|
AD |
integer |
AD filtering threshold for Mutect2 variants |
yes |
|
DP |
integer |
DP filtering threshold for Mutect2 variants |
yes |
|
PON_alpha |
number |
significance level threshold for beta distribution testing |
yes |
|
AD_tier_threshold |
integer |
AD threshold for determining low-AD and high-AD variant tiers |
yes |
|
pval_threshold_high_AD |
number |
significance level threshold for microsec filtering of high AD tier variants |
yes |
|
pval_threshold_low_AD |
number |
significance level threshold for microsec filtering of low AD tier variants |
yes |
|
VAF |
array |
comma seperated list of VAF filtering threshold values you want to try for the formalin filtered variants |
yes |
|
odir |
string |
output directory name under results/ |
yes |
|
exclude_samples |
array |
comma seperated list of tumour samples to exclude from the sample sheet |
Linting and formatting
Linting results
1/home/runner/work/snakemake-workflow-catalog/snakemake-workflow-catalog/.pixi/envs/default/lib/python3.13/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
2 warnings.warn(
3ModuleNotFoundError in file "/tmp/tmp7q2y5mh7/rabiafidan-pure-faf-4e2e0ba/workflow/rules/common.smk", line 5:
4No module named 'cyvcf2'
5 File "/tmp/tmp7q2y5mh7/rabiafidan-pure-faf-4e2e0ba/workflow/rules/common.smk", line 5, in <module>
Formatting results
1[DEBUG]
2[DEBUG] In file "/tmp/tmp7q2y5mh7/rabiafidan-pure-faf-4e2e0ba/workflow/Snakefile": Formatted content is different from original
3[DEBUG]
4[DEBUG] In file "/tmp/tmp7q2y5mh7/rabiafidan-pure-faf-4e2e0ba/workflow/rules/common.smk": Formatted content is different from original
5[INFO] 2 file(s) would be changed 😬
6
7snakefmt version: 0.11.5