Skip to content

Commit

Permalink
Tweak access to config in helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmig committed Jan 4, 2024
1 parent 09f82a7 commit d4e3a02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
def iter_files(file_type: str):
for sample_name in config["SAMPLES"].keys():
yield config["SAMPLES"][sample_name][file_type]
for sample_name in config.get("SAMPLES", {}).keys():
yield config.get("SAMPLES", {})[sample_name][file_type]


def iter_samples():
for sample_name in config["SAMPLES"].keys():
for sample_name in config.get("SAMPLES", {}).keys():
yield sample_name


def get_input_bam(wildcards):
return config["SAMPLES"][wildcards.sample]["bam"]
return config.get("SAMPLES", {})[wildcards.sample]["bam"]


def get_input_fasta(wildcards):
return config["SAMPLES"][wildcards.sample]["fasta"]
return config.get("SAMPLES", {})[wildcards.sample]["fasta"]


def get_repo_version(base_dir: str, default: str, warn=False) -> str:
Expand Down

0 comments on commit d4e3a02

Please sign in to comment.