Skip to content

Shell command incorrectly shows as None for dryrun when using run directive in snakemake rule #3653

@tbenavi1

Description

@tbenavi1

Snakemake version
My version of snakemake is 9.5.1.

Describe the bug
Here is an example rule that triggers the bug:

rule link_or_gzip:
  input:
    get_hap
  output:
    "results/{sample}/{sample}.{hap}.fasta.gz"
  threads: 1
  resources:
    mem_mb=50000
  run:
    if str(input).endswith(".gz"):
      shell("ln -sr {input} {output}")
    else:
      shell("bgzip -c {input} > {output}")

This rule will run one of two shell commands depending on whether the input is already gzipped. However, when doing a dryrun "-np" the output for this rule shows "Shell command: None". Obviously, the pipeline knows what shell command it is supposed to run. It would be great if the dryrun could also show what shell command it is going to run. Thanks.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions