-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnakefile_test
48 lines (38 loc) · 1.9 KB
/
Snakefile_test
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
import os
configfile: "config/config.yml"
# Include rules
include: "rules/preprocessing.smk"
include: "rules/star_alignment.smk"
include: "rules/contaminants.smk"
# Define sample_list
sample_list_path = config['general']['sample_list']
sample_list = [line.strip() for line in open(sample_list_path, 'r')]
inputs = []
# Preliminary FastQC
if config['workflow']['preliminar_fastqc']:
inputs += expand([config['fastqc']['output_dir'] + "{sample}_R1_001_fastqc.html",
config['fastqc']['output_dir'] + "{sample}_R2_001_fastqc.html"],
sample=sample_list)
# Trimming
if config['workflow']['trimmgalore']:
inputs += expand([config['general']['output_dir'] + "trimmed/{sample}_R1_001_val_1.fq.gz",
config['general']['output_dir'] + "trimmed/{sample}_R2_001_val_2.fq.gz"],
sample=sample_list)
# Remove Contaminants
if config['workflow']['remove_contaminants']:
inputs += expand([config['general']['output_dir'] + "filtered/{sample}_R1_001_filtered.fastq",
config['general']['output_dir'] + "filtered/{sample}_R2_001_filtered.fastq",
config['general']['output_dir'] + "contaminants/{sample}_contaminants.sam"],
sample=sample_list)
# STAR alignment
if config['workflow']['star_alignment']:
inputs += expand([config['general']['output_dir'] + "star_alignment/processed_{sample}_Aligned.sortedByCoord.out.bam",
config['general']['output_dir'] + "star_alignment/processed_{sample}_Aligned.sortedByCoord.out.bam.bai"],
sample=sample_list)
# FeatureCounts
if config['workflow']['featureCounts']:
inputs += expand(config['general']['output_dir'] + "featureCounts/{sample}_GRCh38.geneCounts.txt",
sample=sample_list)
rule all:
input:
inputs