Skip to content

Paramspace: Hyphen in parameter name raises MissingInputError #1349

@pontushojer

Description

@pontushojer

Snakemake version

6.12.3

Describe the bug

Including a hyphen (-) in the column/parameter name in the dataframe used for parameter space exploration with the Paramspace helper raises MissingInputException. It is not clear that this is not allowed and the error is not helpful.

Logs

Output from running minimal example below.

MissingInputException in line 10 of /Users/pontus.hojer/analysis/BLR_Analysis/naibr_tuning/Snakefile:
Missing input files for rule all:
value-a~2.txt
value-a~1.txt

Minimal example

from snakemake.utils import Paramspace
import pandas as pd

paramspace = Paramspace(pd.DataFrame([
    {'value-a': 1},
    {'value-a': 2},
]))


rule all:
    input:
        expand("{params}.txt", params=paramspace.instance_patterns)
    

rule a:
    output:
        f"{paramspace.wildcard_pattern}.txt"
    params:
        params = paramspace.instance
    run:    
        with open(output[0], "w") as f:
            for parameter, value in params.params.items():
                print(parameter, value, file=f)

Additional context

Metadata

Metadata

Assignees

No one assigned

    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