Skip to content

Commit

Permalink
update documentation and nextflow workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
priesgo committed Nov 10, 2021
1 parent c24683e commit a505fb2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,35 @@ Run as follows:
```
vafator --input-vcf /path/yo/your.vcf \
--output-vcf /path/yo/your_vafator.vcf \
--normal-bams /path/to/your_normal.bam \
--tumor-bams /path/to/your_primary_tumor.bam,/path/to/your_metastasis_tumor.bam
--bam normal /path/to/your_normal.bam \
--bam primary /path/to/your_primary_tumor.bam \
--bam metastasis /path/to/your_metastasis_tumor.bam
```

Both tumor and normal BAMs are optional, it can annotate only with the tumor BAMs or with the normal BAMs.
This will add annotations for each of the three samples `normal`, `primary` and `metastasis`: `normal_ac`,
`normal_dp`, `normal_af`, `primary_ac`, `primary_dp`, `primary_af`,
`metastasis_ac`, `metastasis_dp` and `metastasis_af`.

If more than one BAM is provided for either the tumor or the normal then the annotations are calculated across all BAMs
and for also each of them separately (eg: `tumor_af` provides the allele frequency across all tumor BAMs, `tumor_af_1`
and `tumor_af_2` provide the allele frequency on the first and second BAM respectively).
If more than one BAM is provided for any sample then the annotations are calculated across all BAMs
and for also each of them separately (eg: `primary_af` provides the allele frequency across all primary tumor BAMs,
`primary_af_1` and `primary_af_2` provide the allele frequency on the first and second BAM respectively).

Also, a `--prefix` parameter can be used to run VAFator multiple times over the same VCF without overwriting its
annotations. For instance, first `vafator [...] --prefix primary --tumor-bams /path/to/your_primary_tumor.bam` and
then `vafator [...] --prefix metastasis --tumor-bams /path/to/your_metastasis_tumor.bam`.
```
vafator --input-vcf /path/yo/your.vcf \
--output-vcf /path/yo/your_vafator.vcf \
--bam primary /path/to/your_primary_tumor_1.bam \
--bam primary /path/to/your_primary_tumor_2.bam
```

Alternatively, you can use `--normal-bams` and/or `--tumor-bams` and the sample names will be predefined to `normal`
and `tumor`respectively.

```
vafator --input-vcf /path/yo/your.vcf \
--output-vcf /path/yo/your_vafator.vcf \
--normal-bams /path/to/your_normal.bam \
--tumor-bams /path/to/your_tumor_1.bam,/path/to/your_tumor_2.bam
```

Use the parameters `--mapping-quality` and `--base-call-quality` to define the minimum quality values for each read.
All reads with quality values velow these thresholds will be filtered out.
Expand Down Expand Up @@ -77,7 +93,7 @@ VAFator is available as a Nextflow pipeline for convenience.

Run as follows:
```
nextflow run tron-bioinformatics/vafator -r 1.0.0 -profile conda --input_files /path/to/your.tsv
nextflow run tron-bioinformatics/vafator -r 1.1.0 -profile conda --input_files /path/to/your.tsv
```

where `--input_files` expects four tab-separated columns **without a header**:
Expand All @@ -94,8 +110,7 @@ Optional parameters:
variant at the same position is kept)
* `--base_call_quality`: minimum base call quality, reads with values below will be filtered out (default: 30)
* `--mapping_quality`: minimum mapping quality, reads with values below will be filtered out (default: 1)
* `--prefix`: when provided the annotations are preceded by this prefix (e.g.: <PREFIX>_tumor_ac, <PREFIX>_tumor_af, etc),
otherwise the annotations are named as tumor_af, normal_af, tumor_ac, normal_ac, tumor_dp and normal_d


## Support for indels

Expand Down
1 change: 0 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ params.output = "output"
params.mapping_quality = false
params.base_call_quality = false
params.skip_multiallelic_filter = false
params.prefix = false

if (params.help) {
log.info params.help_message
Expand Down
4 changes: 1 addition & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ process.shell = ['/bin/bash', '-euo', 'pipefail']
cleanup = true
conda.createTimeout = '1 h'

VERSION = '1.0.0'
VERSION = '1.1.0'

manifest {
name = 'TRON-Bioinformatics/vafator'
Expand Down Expand Up @@ -62,8 +62,6 @@ Optional input:
* skip_multiallelic_filter: skip the filtering of multiallelics by frequency in the tumor (only highest frequency variant at the same position is kept)
* base_call_quality: minimum base call quality, reads with values below will be filtered out (default: 30)
* mapping_quality: minimum mapping quality, reads with values below will be filtered out (default: 1)
* prefix: when provided the annotations are preceded by this prefix (e.g.: <PREFIX>_tumor_ac, <PREFIX>_tumor_af, etc),
otherwise the annotations are named as tumor_af, normal_af, tumor_ac, normal_ac, tumor_dp and normal_d
Output:
* Annotated VCF file
Expand Down
4 changes: 1 addition & 3 deletions nf_modules/vafator.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ params.output = ""
params.mapping_quality = false
params.base_call_quality = false
params.skip_multiallelic_filter = false
params.prefix = false
params.enable_conda = false


Expand All @@ -27,11 +26,10 @@ process VAFATOR {
tumor_bams_param = tumor_bams?.trim() ? "--tumor-bams " + tumor_bams.split(",").join(" ") : ""
mq_param = params.mapping_quality ? "--mapping-quality " + params.mapping_quality : ""
bq_param = params.base_call_quality ? "--base-call-quality " + params.base_call_quality : ""
prefix_param = params.prefix ? "--prefix " + params.prefix : ""
"""
vafator \
--input-vcf ${vcf} \
--output-vcf ${vcf.baseName}.vaf.vcf ${normal_bams_param} ${tumor_bams_param} ${mq_param} ${bq_param} ${prefix_param}
--output-vcf ${vcf.baseName}.vaf.vcf ${normal_bams_param} ${tumor_bams_param} ${mq_param} ${bq_param}
"""
}

Expand Down

0 comments on commit a505fb2

Please sign in to comment.