Try to search your question here, if you can't find : Ask Any Question Now ?

Wildcards in input and output not working

HomeCategory: stackoverflowWildcards in input and output not working
Avatarpragati asked 4 months ago

I added a rule get_timezone_periods with wildcards in the input and output but is not working with error Missing input files for rule all

Manual typing the paths works

"data/raw/test1/ros/timezone.csv",
"data/raw/test3/t02/timezone.csv"

Using wildcards does not

"data/raw/{{db}}/{{user}}/timezone.csv"

My code:

SENSORS=["timezone", "touch"]
DBS_USERS={"test1":["ros"],
            "test3":["t02"]}

def db_user_path(paths):
    new_paths = []
    for db, users in DBS_USERS.items():
        for user in users:
            for path in paths:
                new_paths.append(path.replace("db/", db + "/").replace("user/", user+ "/"))
    return new_paths

rule all:
    input:
        sensors = db_user_path(expand("data/raw/db/user/{sensor}.csv", sensor=SENSORS)),
        timezone_periods = db_user_path(["data/processed/db/user/timezone_periods.csv"])

rule download_dataset:
    input:
        "data/external/{db}-{user}.participant"
    output:
        expand("data/raw/{{db}}/{{user}}/{sensor}.csv", sensor=SENSORS)
    script:
        "src/data/download_dataset.R"


rule get_timezone_periods:
    input:
        # This line below does not work
        # "data/raw/{{db}}/{{user}}/timezone.csv"
        # These two lines work
        "data/raw/test1/ros/timezone.csv",
        "data/raw/test3/t02/timezone.csv"
    output:
        # This line below does not work
        # "data/processed/{{db}}/{{user}}/timezone_periods.csv"
        # These two lines work
        "data/processed/test1/ros/timezone_periods.csv",
        "data/processed/test3/t02/timezone_periods.csv"
    script:
        "src/data/get_timezone_periods.R"
1 Answers
Best Answer
AvatarFernando answered 4 months ago
Your Answer

1 + 12 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com