-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
executable file
·64 lines (51 loc) · 1.84 KB
/
Snakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
This pipline runs the Measle SSPE variant analysis.
Author: Will Hannon
Date: 2022
"""
#### ----------------------- Imports ----------------------- ####
import pandas as pd
import numpy as np
import itertools
from os.path import join
from snakemake.utils import min_version
min_version('7.0') # require `snakemake` >= 7.0
#### -------------------- Configuration -------------------- ####
configfile: "config/config.yml"
#### ------------------------ Utils ------------------------ ####
include: "rules/common.smk"
#### ----------------------- Targets ----------------------- ####
SAMPLE_DF = pd.read_csv(config['samples']['file'])
samples = list(set(SAMPLE_DF['Run']))
rule all:
input:
join(config['notebook_dir'], "clique-snv-analysis.html"),
join(config['coverage_dir'], "merged.stats")
rule clean:
shell:
"""
rm -rf logs/
rm -rf tmp/
rm -f slurm*.out
"""
#### ------------------------ Rules ------------------------ ####
# 0. Download tool dependencies not available on conda
include: "rules/download-tools.smk"
# 1. Download, trim, and filter reads
include: "rules/preprocess-reads.smk"
# 2. Align reads to MevChiTok reference genome
include: "rules/first-alignment.smk"
# 3. Build and Align reads an 'SSPE' genome
include: "rules/second-alignment.smk"
# 4. Run piolt analysis on SSPE 1 sample
include: "rules/pilot-analysis.smk"
# 4. Calculate coverage of the sequencing reads
include: "rules/calculate-coverage.smk"
# 5. Call variants using the 'SSPE' reference genome
include: "rules/call-variants.smk"
# 6. Count reads that cover multiple variants
include: "rules/bridging-reads.smk"
# 7. Run R notebooks that cluster and haplotype variants by frequency
include: "rules/process-variants.smk"
# 8. Does strand origin (+/-) impact variant frequency?
include: "rules/strand-origin.smk"