Skip to content

Commit

Permalink
adapted input specification in config
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesGawron committed Jun 7, 2024
1 parent 0ce2ee8 commit 4713c82
Show file tree
Hide file tree
Showing 5 changed files with 274 additions and 151 deletions.
2 changes: 2 additions & 0 deletions experiments/config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#sample: ['Lu2']
sample: ['Br11', 'Br7', 'Br61', 'Br38', 'LM2', 'Pr9', 'Br23','Br39', 'Br57', 'Lu2', 'Br16_AC', 'Br16_B', 'Br16_C', 'Br26', 'Br44', 'Lu7', 'Br30', 'Br45', 'Ov8', 'Br37', 'Br46', 'Brx50', 'Pr6']
author: Johannes Gawron
input: /cluster/work/bewi/members/jgawron/projects/CTC/input_folder
simulations: /cluster/work/bewi/members/jgawron/projects/CTC/simulations/simulations2
407 changes: 260 additions & 147 deletions experiments/data/htmls/Br38.html

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions experiments/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ PROJECT_DIR = Path(workflow.basedir).parent
SCRIPT_DIR = Path(workflow.basedir) / 'scripts'
RESOURCES_DIR = Path(workflow.basedir) / 'resources'
markdown_helper_functions = (RESOURCES_DIR / 'functions.R').resolve().as_posix().replace('/', '\\/')
input_folder = Path(config['input']).resolve().as_posix().replace('/','\\/')
simulations_folder = Path(config['simulations']).resolve().as_posix().replace('/','\\/')


print(markdown_helper_functions)

######Rules######
Expand Down
4 changes: 2 additions & 2 deletions experiments/workflow/resources/template.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ The analysis takes a list of trees sampled from its posterior distribution as in

## Configure the script
```{r config}
inputFolder <- "/Users/jgawron/Documents/projects/CTC_backup/input_folder"
simulationInputFolder <- "/Users/jgawron/Documents/projects/CTC_backup/simulations/simulations2"
inputFolder <- "__input_dir__"
simulationInputFolder <- "__sim_dir__"
treeName <- "__tree__"
nTreeSamplingEvents <- __nSamplingEvents__
nMutationSamplingEvents <- __nSamplingEvents__
Expand Down
8 changes: 6 additions & 2 deletions experiments/workflow/rules/base.smk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ rule prepare_markdown_file:
params:
sampling_depth = 1000,
script_dir = {markdown_helper_functions},
author = config['author']
author = config['author'],
input_dir = input_folder,
simulation_dir = simulations_folder,
log:
PROJECT_DIR / 'logs' / 'prepare_markdown_file.{SAMPLE}.log',
shell:
Expand All @@ -19,6 +21,8 @@ rule prepare_markdown_file:
-e "s/__date__/$(date +'%Y-%m-%d')/g" \
-e "s/__functionsScript__/{params.script_dir}/g" \
-e "s/__author__/{params.author}/g" \
-e "s/__input_dir__/{params.input_dir}/g" \
-e "s/__sim_dir__/{params.simulation_dir}/g" \
{input} > {output} ) &> {log}
"""

Expand All @@ -27,7 +31,7 @@ rule render_markdown_file:
PROJECT_DIR / 'data' / 'markdowns' / '{SAMPLE}.Rmd',
output:
PROJECT_DIR / 'data' / 'htmls' / '{SAMPLE}.html',
threads: 8
threads: 16
conda:
Path(workflow.basedir) / 'envs' / 'R.yml',
log:
Expand Down

0 comments on commit 4713c82

Please sign in to comment.