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

should we use / default to using rules.<rulename> in snakefiles? #19

Open
ctb opened this issue Apr 8, 2023 · 1 comment
Open

should we use / default to using rules.<rulename> in snakefiles? #19

ctb opened this issue Apr 8, 2023 · 1 comment

Comments

@ctb
Copy link
Member

ctb commented Apr 8, 2023

See comment: https://genomic.social/@Lurk/110161475932927082

@ctb I don't see something that for me now is fundamental and will avoid a lot of pain : don't use file names as input but instead use :
rules.some_previous_rule.output.filename
It also works with expand, and you don't have to use ".filename" if your rule require all outputs from previous rule
https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#rule-dependencies
Basically, this allows to change a path only once if you want to change the structure of the pipeline

I rarely use this myself, but maybe I'm missing out?

One issue is that you now need to be careful about the order you define the rules in.

Are there any other drawbacks?

@ctb
Copy link
Member Author

ctb commented Apr 10, 2023

@bluegenes sez:

I tried that out a fair bit, though haven’t used it for a while now. IMO, the upside was more obvious rule interactions, and not having to be so explicit/repetitive with file names. But, since I then couldn’t always directly see which wildcards were in the input so I could use/change the filename for output, individual rules were a bit less intuitive. When troubleshooting wildcard/input issues, that can be frustrating, so I mostly use filenames

I think it’s something I’m less interested in using while developing a snakefile, but might consider transitioning to after the workflow is set, since it helps other people read the flow of rules? We use some in dammit 2.0, i think

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

1 participant