snakemake / snakemake/snakemake

Access to rule level information like inputs/outputs, rules, descriptions

Open
#792 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
2.9k
Forks
656
Avg merge
4d 12h
Merged PRs (30d)
9

Description

Is your feature request related to a problem? Please describe.
I am trying to automate parts of our documentation generation

Describe the solution you'd like
A function (in the API?) to get access to all input and output files of a rule for a certain Snakefile (for all rules, put into a dictionary for example?). So like:

rules_input_output = snakemake.snakemake(os.path.join(workdir, 'Snakefile'), workdir=workdir).get_rules_details()

Describe alternatives you've considered
I tried to use listrules=True and then somehow cycle thorough the rules to get more info but there is no rule level info it seems. I also considered capturing the full output of a --dry-run, and then writing a little parse to extract the info myself. In fact, I may still do that if nobody replies here with an option that already exists. If you are interested in this feature, some pointers for implementing it in the API myself would also be nice, then I could make PR out of it.

Additional context
Maybe if a "descriptions" field could be added to the rules, it could be part of this solution?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the public snakemake.snakemake(...).get_rules_details() entry point proposed in the issue, then inspect how listrules=True and dry-run output expose rule data. Done means the API provides per-rule input and output files, rule information, and descriptions in a form that documentation generation can consume without parsing CLI output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.