Skip to content

Commit 103ada1

Browse files
authored
Merge pull request #11 from MPUSP/dev
feat: various improvements to variant effect prediction + viz
2 parents b3529fd + 9cdc49a commit 103ada1

23 files changed

Lines changed: 1025 additions & 67 deletions

.test/config/config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,21 @@ variant_calling:
5757
extra: ""
5858
freebayes:
5959
extra: "--ploidy 1 --min-base-quality 20 --min-alternate-fraction 0.75"
60-
effect_prediction:
60+
61+
variant_annotation:
62+
tool: "vep"
63+
vep:
6164
convert_gff: True
6265
plugins: []
6366
extra: "--everything --species custom_bacteria --distance 0"
67+
snpeff:
68+
extra: "-nodownload -ud 0"
6469

6570
qc:
6671
multiqc:
6772
extra: "--verbose --dirs"
6873
fastqc:
6974
extra: "--quiet"
75+
76+
report:
77+
minimum_variant_count: 2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Detailed information about input data and workflow configuration can also be fou
2323

2424
If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this repository or its DOI.
2525

26-
*Workflow overview:*
26+
_Workflow overview:_
2727

2828
<!-- include overview-->
2929
<img src="resources/images/dag.png" align="center" />

config/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## Workflow overview
22

33
This workflow is a best-practice workflow for mapping of reads to reference genomes, minimalistic and simple.
4+
5+
It will attempt to map reads to the reference using one of the included mappers, report read and experiment statistics, create coverage profiles, quantify variants (such as SNPs) using two different tools, and predict the effect of these variants.
6+
All of this is performed with minimal input and without lookups to external databases (e.g. for variant effects), which makes the workflow ideal for bacteria and other low-complexity non-model organisms.
7+
48
The workflow is built using [snakemake](https://snakemake.readthedocs.io/en/stable/) and consists of the following steps:
59

610
1. Download genome reference from NCBI (`ncbi tools`), or use manual input (`fasta`, `gff` format)
@@ -13,8 +17,9 @@ The workflow is built using [snakemake](https://snakemake.readthedocs.io/en/stab
1317
5. Determine experiment type, get mapping stats (`rseqc`)
1418
6. Generate `bigwig` or `bedgaph` coverage profiles (`deeptools`)
1519
7. Quantify variations and SNPs (`bcftools`, `freebayes`)
16-
8. Predict effect of variants such as premature stop codons (`VEP`)
17-
9. Collect statistics from tool output (`MultiQC`)
20+
8. Predict effect of variants such as premature stop codons (`VEP` or `SnpEff`)
21+
9. Create consensus of variants and create a visual report (`R markdown`)
22+
10. Collect statistics from tool output (`MultiQC`)
1823

1924
## Running the workflow
2025

@@ -82,10 +87,14 @@ This table lists all parameters that can be used to run the workflow.
8287
| extra | string | additional arguments to BCFtools filter | |
8388
| _freebayes_ | | | |
8489
| extra | string | additional arguments to Freebayes call | |
85-
| _effect_prediction_ | | | |
90+
| **variant_annotation** | | | |
91+
| tool | string | annotation tool to use, one of 'vep', 'snpeff' | `vep` |
92+
| _vep_ | | | |
8693
| convert_gff | boolean | whether to convert NCBI GFF to Ensemble style GFF | `True` |
8794
| plugins | array | VEP plugins to use | `[]` |
8895
| extra | string | additional arguments to VEP | see config.yml |
96+
| _snpeff_ | | | |
97+
| extra | string | additional arguments to SnpEff | see config.yml |
8998
| **qc** | | | |
9099
| _fastqc_ | | | |
91100
| extra | string | additional arguments to FastQC | |

config/config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,21 @@ variant_calling:
5757
extra: ""
5858
freebayes:
5959
extra: "--ploidy 1 --min-base-quality 20 --min-alternate-fraction 0.75"
60-
effect_prediction:
60+
61+
variant_annotation:
62+
tool: "vep"
63+
vep:
6164
convert_gff: True
6265
plugins: []
6366
extra: "--everything --species custom_bacteria --distance 0"
67+
snpeff:
68+
extra: "-nodownload -ud 0"
6469

6570
qc:
6671
multiqc:
6772
extra: "--verbose --dirs"
6873
fastqc:
6974
extra: "--quiet"
75+
76+
report:
77+
minimum_variant_count: 2

config/schemas/config.schema.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: "http://json-schema.org/draft-07/schema#"
1+
$schema: "https://json-schema.org/draft/2020-12/schema"
22
description: configuration file for the analysis pipeline
33
properties:
44
samplesheet:
@@ -153,7 +153,19 @@ properties:
153153
extra:
154154
type: string
155155
description: additional arguments to pass to Freebayes
156-
effect_prediction:
156+
required:
157+
- bcftools_pileup
158+
- bcftools_call
159+
- bcftools_view
160+
- bcftools_filter
161+
- freebayes
162+
variant_annotation:
163+
type: object
164+
properties:
165+
tool:
166+
type: string
167+
description: annotation tool to use, one of 'vep', 'snpeff'
168+
vep:
157169
type: object
158170
properties:
159171
convert_gff:
@@ -167,13 +179,17 @@ properties:
167179
extra:
168180
type: string
169181
description: additional arguments to pass to VEP
182+
snpeff:
183+
type: object
184+
properties:
185+
extra:
186+
type: string
187+
description: additional arguments to pass to SnpEff
170188
required:
171-
- bcftools_pileup
172-
- bcftools_call
173-
- bcftools_view
174-
- bcftools_filter
175-
- freebayes
176-
- effect_prediction
189+
- tool
190+
- vep
191+
- snpeff
192+
177193
qc:
178194
type: object
179195
properties:
@@ -192,11 +208,19 @@ properties:
192208
required:
193209
- multiqc
194210
- fastqc
211+
report:
212+
type: object
213+
properties:
214+
minimum_variant_count:
215+
type: integer
216+
description: minimum number of samples/appearances for the same variant to be included in the final report
195217
required:
196218
- samplesheet
197219
- get_genome
198220
- fastp
199221
- mapping
200222
- mapping_stats
201223
- variant_calling
224+
- variant_annotation
202225
- qc
226+
- report

config/schemas/samples.schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: "http://json-schema.org/draft-07/schema#"
1+
$schema: "https://json-schema.org/draft/2020-12/schema"
22
description: entries for the sample sheet
33
properties:
44
sample:

workflow/Snakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ include: "rules/bcftools.smk"
1414
include: "rules/freebayes.smk"
1515
include: "rules/variant_annotation.smk"
1616
include: "rules/qc.smk"
17+
include: "rules/report.smk"
1718

1819

1920
# optional messages, log and error handling
@@ -35,4 +36,5 @@ onerror:
3536
rule all:
3637
input:
3738
"results/multiqc/multiqc_report.html",
39+
expand("results/report/{caller}_report.pdf", caller=["bcftools", "freebayes"]),
3840
default_target: True

workflow/envs/bcftools.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: bcftools
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- nodefaults
6+
dependencies:
7+
- bcftools=1.22

workflow/envs/report_html.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: report_html
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- nodefaults
6+
dependencies:
7+
- r-base 4.3.1
8+
- r-essentials=4.3
9+
- r-tidyverse=2.0.0
10+
- r-ggrepel=0.9.3
11+
- r-rstatix=0.7.2
12+
- r-ggpubr=0.6.0
13+
- r-ggupset=0.4.0
14+
- bioconductor-biostrings=2.68.1
15+
- bioconductor-genomicranges=1.52.0
16+
- bioconductor-genomicfeatures=1.52.1

workflow/envs/report_pdf.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: report_pdf
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- nodefaults
6+
dependencies:
7+
- python=3.9
8+
- weasyprint=62.3

0 commit comments

Comments
 (0)