diff --git a/Snake.config.json b/Snake.config.json index f54db59b144003f86164aa589f014dd4ef6d84f9..d6e157c8476989d6a76dfdf508d04000dcc2b0e2 100644 --- a/Snake.config.json +++ b/Snake.config.json @@ -35,6 +35,7 @@ "simulation_max_reads_per_library" : 1000000, "simulation_window_sizes" : [50000, 100000], "simulation_cell_count" : 200, + "simulation_alpha" : 0.02, "genome_size" : 3e9 diff --git a/Snakefile b/Snakefile index 503af095e15dd79b3cbe2f6a38223364240ded96..b0e14031c2541779d329105aef2547cf7add89fa 100644 --- a/Snakefile +++ b/Snakefile @@ -89,16 +89,19 @@ rule simulate_counts: min_coverage = min_coverage, max_coverage = max_coverage, cell_count = config["simulation_cell_count"], + alpha = config["simulation_alpha"], log: "log/simulate_counts/genome{seed}-{window_size}.txt" shell: """ {params.mc_command} simulate \ -w {wildcards.window_size} \ + --seed {wildcards.seed} \ -n {params.cell_count} \ -p {params.neg_binom_p} \ -c {params.min_coverage} \ -C {params.max_coverage} \ + -a {params.alpha} \ -V {output.variants} \ -i {output.info} \ -o {output.counts} \ @@ -121,6 +124,20 @@ rule link_to_simulated_counts: info_file = os.path.basename(output.info) shell("cd {d} && ln -s ../../{input.counts} {count_file} && ln -s ../../{input.info} {info_file} && cd ../..") + +rule link_to_simulated_strand_states: + input: + sce="simulation/sce/genome{seed}-{window_size}.txt", + output: + states="strand_states/simulation{seed}-{window_size}/final.txt", + run: + d = os.path.dirname(output.states) + f = os.path.basename(output.states) + shell("cd {d} && ln -s ../../{input.sce} {f} && cd ../..") + +ruleorder: link_to_simulated_counts > mosaic_count_fixed +ruleorder: link_to_simulated_strand_states > convert_strandphaser_output + ################################################################################ # Plots # ################################################################################ @@ -187,11 +204,10 @@ rule generate_exclude_file_2: print(line.strip(), file = out) - rule mosaic_count_fixed: input: - bam = lambda wc: expand("bam/" + wc.sample + "/{bam}.bam", bam = BAM_PER_SAMPLE[wc.sample]), - bai = lambda wc: expand("bam/" + wc.sample + "/{bam}.bam.bai", bam = BAM_PER_SAMPLE[wc.sample]), + bam = lambda wc: expand("bam/" + wc.sample + "/{bam}.bam", bam = BAM_PER_SAMPLE[wc.sample]) if wc.sample in BAM_PER_SAMPLE else "FOOBAR", + bai = lambda wc: expand("bam/" + wc.sample + "/{bam}.bam.bai", bam = BAM_PER_SAMPLE[wc.sample]) if wc.sample in BAM_PER_SAMPLE else "FOOBAR", excl = "log/exclude_file" output: counts = "counts/{sample}/{window}_fixed.txt.gz", @@ -239,10 +255,6 @@ rule mosaic_count_variable: """ - - - - ################################################################################ # Segmentation # ################################################################################