Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkpoints could be accessed as rules when using rules #262

Closed
iromeo opened this issue Sep 9, 2019 · 0 comments
Closed

Checkpoints could be accessed as rules when using rules #262

iromeo opened this issue Sep 9, 2019 · 0 comments
Assignees
Milestone

Comments

@iromeo
Copy link
Contributor

iromeo commented Sep 9, 2019

E.g here foo is accessed via checkpoints and rules

checkpoint foo:
    output:
        key1="{sample}.tsv",
        key2="{sample}.txt"


def boo_input(wildcards):
    path = checkpoints.foo.get(**wildcards).output.key1
    df = pd.read_csv(path, sep="\t")
    return tuple(df[df["mask"]]["File"])


rule boo:
    input: boo_input
    output: "too/{sample}.txt"
    log: "too/{sample}.txt.log"
    shell:
        "echo  {input:q} 1>{output} 2>{log}"

rule all:
    input:
        expand(
            [
                rules.foo.output.key1,
                rules.foo.output.key2,
                rules.boo.output
            ],
            sample=["A", "B"]
        ),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants