File: Snakefile

package info (click to toggle)
snakemake 7.32.4-8.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 25,836 kB
  • sloc: python: 32,846; javascript: 1,287; makefile: 247; sh: 163; ansic: 57; lisp: 9
file content (27 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (7)
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
from pytools.persistent_dict import PersistentDict


storage = PersistentDict("mystorage")

storage.store("var1", 100)

rule all:
	input: expand("test.{i}.out", i=range(3))


rule:
	input: "test.in"
	output: "test.{i}.out"
	run:
		assert storage.fetch("var1") == 100
		with open(output[0], "w") as out:
			v = storage.fetch("var2")
			assert v == 1
			print(v, file=out)


rule:
	output: temp("test.in")  # mark output as temp, since var1 has to be stored in each run
	run:
		storage.store("var2", 1)
		shell("touch {output}")