Skip to content

Commit

Permalink
Reorganize and rename config.yaml parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmig committed Jan 4, 2024
1 parent 77bb4ab commit 09f82a7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .test/targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CONTEXT_FASTA:
"data/context.fasta"
OUTPUT_NAME:
"test"
DIVERSITY_BOOTSTRAP_REPS:
DIVERSITY_REPS:
10
PLOTS:
"../config/design_plots.R"
Expand Down
9 changes: 6 additions & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ DEMIX:
WINDOW:
WIDTH: 1000
STEP: 50
GISAID_YAML:
"config/gisaid.yaml"
DIVERSITY_BOOTSTRAP_REPS:
GISAID:
CREDENTIALS: "config/gisaid.yaml"
DATE_COLUMN: "CollectionDate"
LOCATION_COLUMN: "ResidenceCity"
ACCESSION_COLUMN: "GISAIDEPI"
DIVERSITY_REPS:
1000
LOG_PY_FMT:
"%(asctime)s - %(name)s - %(levelname)-8s - %(message)s"
Expand Down
4 changes: 2 additions & 2 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ OUTDIR.mkdir(parents=True, exist_ok=True)
## Set context to be fetched automatically if CONTEXT_FASTA=null
if "CONTEXT_FASTA" not in config.keys() or config["CONTEXT_FASTA"] is None:
CONTEXT_FASTA = OUTDIR/"context"/"sequences.fasta"
if not Path(config["GISAID_YAML"]).is_file():
sys.exit(f"Tried to download a context dataset, but no GISAID credentials were found at '{config['GISAID_YAML']}' (see README.md).")
if not Path(config["GISAID"]["CREDENTIALS"]).is_file():
sys.exit(f"Tried to download a context dataset, but no GISAID credentials were found at '{config['GISAID']['CREDENTIALS']}' (see README.md).")
elif Path(config["CONTEXT_FASTA"]).is_file():
CONTEXT_FASTA = config["CONTEXT_FASTA"]
else:
Expand Down
10 changes: 5 additions & 5 deletions workflow/rules/context.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ rule download_context:
metadata = config["METADATA"],
pango_report = OUTDIR/f"{OUTPUT_NAME}.lineage_report.csv"
params:
gisaid_creds = config["GISAID_YAML"],
gisaid_creds = config["GISAID"]["CREDENTIALS"],
date_window_span = 0.95,
date_window_paddding_days = 14,
date_column = "CollectionDate",
location_column = "ResidenceCity",
samples_gisaid_accession_column = "GISAIDEPI",
date_column = config["GISAID"]["DATE_COLUMN"],
location_column = config["GISAID"]["LOCATION_COLUMN"],
samples_gisaid_accession_column = config["GISAID"]["ACCESSION_COLUMN"],
context_gisaid_accession_column = "accession_id",
host = "Human",
exclude_low_coverage = True,
Expand All @@ -21,7 +21,7 @@ rule download_context:
min_sleep = 1,
max_sleep = 3,
chunk_length = 3000,
min_theoretical_combinations = config["DIVERSITY_BOOTSTRAP_REPS"]
min_theoretical_combinations = config["DIVERSITY_REPS"]
output:
fasta = temp(OUTDIR/"context"/"sequences.fasta"),
metadata = temp(OUTDIR/"context"/"metadata.csv"),
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/report.smk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rule diversity:
conda: "../envs/renv.yaml"
params:
design = config["PLOTS"],
bootstrap_reps = config["DIVERSITY_BOOTSTRAP_REPS"],
bootstrap_reps = config["DIVERSITY_REPS"],
plot_width = 159.2,
plot_height = 119.4
input:
Expand Down

0 comments on commit 09f82a7

Please sign in to comment.