Skip to content

Commit

Permalink
Merge pull request #80 from fmaguire/add_configurable_outputdir
Browse files Browse the repository at this point in the history
Add configurable optional output directory
  • Loading branch information
rdeborja authored May 4, 2021
2 parents fe4d7db + 8d46317 commit 38f39e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ completeness_threshold: 0.9
# or the path to a local VCF file.
# Built in lists: https://github.com/jts/ncov-watch/tree/master/ncov_watch/watchlists
mutation_set: spike_mutations
# user specifiable output directory
# defaults to just current working directory but otherwise
# will write output files to the specified directory
output_directory: run1_output
```

## Running
Expand Down
12 changes: 12 additions & 0 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
#
# Helper functions and rules
#
from pathlib import Path

include: "defaults.smk"

configfile: "config.yaml"

# to handle custom output directories make input paths in config absolute
# paths then assign snakemake workdir to the specified config workdir
# as data_root is built into the remaining input paths
if 'output_directory' in config:
for input_path_config in ['data_root', 'primer_bed', 'reference_genome', 'tree_include_consensus']:
if input_path_config in config:
config[input_path_config] = str(Path(config[input_path_config]).absolute())
workdir: config['output_directory']


def get_sample_names():

# if defined in the config, use that
Expand Down

0 comments on commit 38f39e4

Please sign in to comment.