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

Feature/function bug #313

Merged
merged 2 commits into from
May 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions optinist/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ from optinist.api.utils.filepath_creater import join_filepath
configfile: join_filepath([DIRPATH.ROOT_DIR, 'config.yaml'])

for rule, details in config["rules"].items():
rule_file = details["rule_file"]
include: rule_file
include: details["rule_file"]

rule all:
input: [join_filepath([DIRPATH.OUTPUT_DIR, x]) for x in config["last_output"]]
24 changes: 15 additions & 9 deletions optinist/api/snakemake/smk_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@


def smk_input(config, name):
output_list = []
for value in config["rules"].values():
if value["type"] == name:
if value["type"] in [FILETYPE.IMAGE]:
return [
output_list.append([
join_filepath([DIRPATH.INPUT_DIR, x])
for x in value["input"]
]
])
elif value["type"] in [FILETYPE.CSV, FILETYPE.BEHAVIOR, FILETYPE.HDF5]:
return join_filepath([DIRPATH.INPUT_DIR, value["input"]])
output_list.append(join_filepath([DIRPATH.INPUT_DIR, value["input"]]))
else:
return [
join_filepath([DIRPATH.OUTPUT_DIR, x])
for x in value["input"]
]
output_list.append([
join_filepath([
DIRPATH.OUTPUT_DIR, x
]) for x in value["input"]
])
return output_list


def smk_output(config, name):
for value in config["rules"].values():
output_list = []
for key, value in config["rules"].items():
if value["type"] == name:
return join_filepath([DIRPATH.OUTPUT_DIR, value["output"]])
output_list.append(join_filepath([DIRPATH.OUTPUT_DIR, value["output"]]))

return output_list