Snakefile 2.08 KB
Newer Older
Philipp Spohr's avatar
Philipp Spohr committed
1
2
3
4
5
6
7
8
9
10
11
12
include: "scripts/shared.py"

from snakemake.utils import validate

#Validate configuration files

configfile: "config.yaml"
validate(config, "schemas/config.schema.yaml")


#Generate Input/Output Files from specified folder

Jan Hoeckesfeld's avatar
Jan Hoeckesfeld committed
13
14
kmer_lengths = config['kmers']
dataset_inputIDs = {}
Philipp Spohr's avatar
Philipp Spohr committed
15
16

#kmer_lengths = [24]
Jan Hoeckesfeld's avatar
Jan Hoeckesfeld committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def get_inputs(dataset):
	run_dir = dataset
	inputIDs, = glob_wildcards('data/input/'+dataset+'/{id}'+config["datasets"][dataset]['input_read_1_ending'])
	dataset_inputIDs[dataset] = inputIDs

	possible_params = {'generative_model': expand('data/output/'+run_dir+'/kmers/{kmer}/predictions.probabilistic_gen.tsv',kmer=kmer_lengths),
	'probabilistic_model': expand('data/output/'+run_dir+'/kmers/{kmer}/predictions.probabilistic_cov.tsv',kmer=kmer_lengths),
	# if above:
	'plot_top3_fit': expand('data/output/'+run_dir+'/kmers/{kmer}/{id}_top3fit.svg',kmer=kmer_lengths,id=inputIDs),
	'distance_model': expand('data/output/'+run_dir+'/kmers/{kmer}/predictions.euclidean.tsv',kmer=kmer_lengths),
	'assembly_model': expand('data/output/'+run_dir+'/{id}/exactMatches.tsv',id=inputIDs),
	'calc_strand_bias': expand('data/output/'+run_dir+'/{id}/strandbias.txt',id=inputIDs),
	'mapping_diff_analysis': expand('data/output/'+run_dir+'/methodAnalysis/{id}/mapping.comparison',id=inputIDs),
	'map_filtered_reads': expand('data/output/'+run_dir+'/methodAnalysis/{id}/alignmentToGroundTruthType.sorted.bam.bai',id=inputIDs),
	'verifyUniqueness': expand('data/output/kmers/{kmer}/uniquenessTest.tsv',kmer=kmer_lengths),
	'kmer_stats_analysis': expand('data/auxiliary/'+run_dir+'/kmers/{kmer}/{id}/stats.tsv',kmer=kmer_lengths,id=inputIDs) + 
							expand('data/output/'+run_dir+'/kmers/{kmer}/{id}/spaTypesGroundTruthVennDia.svg',kmer=kmer_lengths,id=inputIDs)
	}

	return [possible_params[k] for k in possible_params.keys() if config[k]]
Philipp Spohr's avatar
Philipp Spohr committed
37
38
39

rule all:
	input:
Jan Hoeckesfeld's avatar
Jan Hoeckesfeld committed
40
		[get_inputs(dataset) for dataset in config["datasets"].keys()]
Philipp Spohr's avatar
Philipp Spohr committed
41
42
43


##### load rules #####
Jan Hoeckesfeld's avatar
Jan Hoeckesfeld committed
44
45
46
47
48
49
include: "rules/assembly.smk"
include: "rules/shared.smk"
include: "rules/kmerApproach.smk"
include: "rules/coverageBased.smk"
include: "rules/probabilistic.smk"
include: "rules/euclidean.smk"