From 7729df52fce9b87ab5e4e6941ab4552642e4015d Mon Sep 17 00:00:00 2001 From: Johannes Gawron Date: Wed, 26 Jun 2024 17:00:14 +0200 Subject: [PATCH] adapted output format --- .pre-commit-config.yaml | 2 -- experiments/config/config.yaml | 4 ++-- experiments/workflow/Snakefile | 4 +++- experiments/workflow/resources/template.Rmd | 3 ++- experiments/workflow/rules/base.smk | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1275aa8..9cf9fd5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,9 +7,7 @@ repos: rev: v0.4.2 hooks: - id: style-files - args: [--warn_only] - id: parsable-R - args: [--warn-only] - id: lintr args: [--warn_only] verbose: true diff --git a/experiments/config/config.yaml b/experiments/config/config.yaml index c2eadf3..137cc67 100644 --- a/experiments/config/config.yaml +++ b/experiments/config/config.yaml @@ -1,5 +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'] +sample: ['Br11'] +#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 diff --git a/experiments/workflow/Snakefile b/experiments/workflow/Snakefile index bd5dcbe..cbde19e 100644 --- a/experiments/workflow/Snakefile +++ b/experiments/workflow/Snakefile @@ -22,7 +22,9 @@ include: "rules/base.smk" all_files = [] for sample in SAMPLES: - all_files.append((PROJECT_DIR / "data" / "htmls" / f"{sample}.html").resolve()) + all_files.append( + (PROJECT_DIR / "data" / "htmls" / f"{sample}_treeSampling.html").resolve() + ) all_files.append( (PROJECT_DIR / "data" / "htmls" / f"{sample}_topSeparators.html").resolve() ) diff --git a/experiments/workflow/resources/template.Rmd b/experiments/workflow/resources/template.Rmd index 18abb2a..8376d43 100644 --- a/experiments/workflow/resources/template.Rmd +++ b/experiments/workflow/resources/template.Rmd @@ -32,6 +32,7 @@ simulationInputFolder <- params$simulationInputFolder treeName <- params$treeName nTreeSamplingEvents <- params$nSamplingEvents nMutationSamplingEvents <- params$nSamplingEvents +nSamplingEvents <- params$nSamplingEvents ``` ## Loading data @@ -155,7 +156,7 @@ for (clusterSize in 2:5) { nOligoclonalClusters2 <- nOligoclonalClusters2 + 1 oligoclonal <- TRUE } - splittingSummary2 <- rbind(splittingSummary2, data.frame(Color = color, Oligoclonal = oligoclonal, ClusterSize = clusterSize)) + splittingSummary2 <- rbind(splittingSummary2, data.frame(Color = color, Oligoclonal = oligoclonal, ClusterSize = clusterSize, cutoff = cutoffsBranchingProbabilities[(cutoffsBranchingProbabilities$clusterSize == clusterSize), 2], mean_splitting_score = branchingProbs)) } }) } diff --git a/experiments/workflow/rules/base.smk b/experiments/workflow/rules/base.smk index 3e94dc0..cdcb8c2 100644 --- a/experiments/workflow/rules/base.smk +++ b/experiments/workflow/rules/base.smk @@ -79,7 +79,7 @@ rule render_markdown_file: input_dir=INPUT_FOLDER, simulation_dir=SIMULATION_FOLDER, resources: - mem_mb=2048, + mem_mb_per_cpu=4096, runtime=2880, threads: 16 conda: @@ -88,7 +88,7 @@ rule render_markdown_file: PROJECT_DIR / "logs" / "render_markdown_file.{SAMPLE}.log", shell: """ - ( Rscript -e "rmarkdown::render('{input}', output_file = '{output}')", params = list(inputFolder = {params.input_dir}, nSamplingEvents = {params.sampling_depth}, simulationInputFolder = {params.simulation_dir}, treeName = {wildcard.SAMPLE}, functionsScript = {params.script_dir}) ) &> {log} + ( Rscript -e "rmarkdown::render('{input}', output_file = '{output}', params = list(inputFolder = '{params.input_dir}', nSamplingEvents={params.sampling_depth}, simulationInputFolder = '{params.simulation_dir}', treeName = '{wildcards.SAMPLE}', functionsScript = '{params.script_dir}'))" ) &> {log} """