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 (37 lines) | stat: -rw-r--r-- 947 bytes parent folder | download | duplicates (3)
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
import os

# This test file is adapted from this one:
# https://github.com/snakemake/snakemake/blob/758fabdb64255f8ca79e9c1483ceab67eb39ff07/tests/test_google_lifesciences/Snakefile
from snakemake.remote.GS import RemoteProvider as GSRemoteProvider
GS = GSRemoteProvider()

rule all:
    input:
        "landsat-data.txt.bz2"

checkpoint 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
    run:
        shell("cp {input} {output}")

def get_pack_input(wildcards):
    output = checkpoints.copy.get().output[0]
    return output


rule pack:
    input:
        get_pack_input
    output:
        "landsat-data.txt.bz2"
    conda:
        "env.yml"
    log:
        "logs/pack.log"
    shell:
        "bzip2 -c {input} > {output}; echo successful > {log}"