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

Support for scattergather directive #551

Open
iromeo opened this issue Oct 21, 2024 · 1 comment
Open

Support for scattergather directive #551

iromeo opened this issue Oct 21, 2024 · 1 comment

Comments

@iromeo
Copy link
Contributor

iromeo commented Oct 21, 2024

see https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#defining-scatter-gather-processes

Example: here scattergather defines split in scatter.split

scattergather:
    rule_a=4,
    rule_b=3,


rule all:
    input:
        "gathered/all_a.txt",
        "gathered/all_b.txt",


rule split_a:
    output:
        scatter.rule_a("split_a/{scatteritem}.txt"),
    shell:
        "touch {output}"


rule split_b:
    output:
        scatter.rule_b("split_b/{scatteritem}.txt"),
    shell:
        "touch {output}"


rule intermediate_a:
    input:
        "split_a/{scatteritem}.txt",
    output:
        "split_a/{scatteritem}.post.txt",
    shell:
        "cp {input} {output}"


rule intermediate_b:
    input:
        "split_b/{scatteritem}.txt",
    output:
        "split_b/{scatteritem}.post.txt",
    shell:
        "cp {input} {output}"


rule gather_a:
    input:
        gather.rule_a("split_a/{scatteritem}.post.txt"),
    output:
        "gathered/all_a.txt",
    shell:
        "cat {input} > {output}"


rule gather_b:
    input:
        gather.rule_b("split_b/{scatteritem}.post.txt"),
    output:
        "gathered/all_b.txt",
    shell:
        "cat {input} > {output}"

@iromeo
Copy link
Contributor Author

iromeo commented Oct 22, 2024

Need code completion for scatter and gatter objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant