forked from snakemake/snakemake
/
Snakefile
54 lines (43 loc) · 1.19 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
import os
from snakemake.remote.GS import RemoteProvider as GSRemoteProvider
GS = GSRemoteProvider()
rule all:
input:
"landsat-data.txt.bz2",
"testdir",
rule copy:
input:
GS.remote(
"gcp-public-data-landsat/LC08/01/001/003/LC08_L1GT_001003_20170430_20170501_01_RT/LC08_L1GT_001003_20170430_20170501_01_RT_MTL.txt"
),
output:
"landsat-data.txt",
resources:
mem_mb=100,
disk_mb=301000
run:
# Nominally, we have attached a 375GB SSD to our underlying cluster node, and requested 301GB above.
stats = os.statvfs('.')
volume_gb = stats.f_bsize * stats.f_blocks / 1.0e9
assert volume_gb >= 300
shell("cp {input} {output}")
rule pack:
input:
"landsat-data.txt",
output:
"landsat-data.txt.bz2",
conda:
"envs/gzip.yaml"
singularity:
"docker://continuumio/miniconda3:4.4.10"
log:
"logs/pack.log",
shell:
"bzip2 -c {input} > {output}; echo successful > {log}"
rule directory:
output:
directory("testdir"),
log:
"logs/directory.log",
shell:
"mkdir -p {output}; touch {output}/test.txt"