-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7aa50ad
commit dacf2ee
Showing
7 changed files
with
229 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "demon_model"] | ||
path = resources/demon_model | ||
url = https://github.com/robjohnnoble/demon_model | ||
[submodule "demonanalysis"] | ||
path = resources/demonanalysis | ||
url = https://github.com/robjohnnoble/demonanalysis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
############################################################################### | ||
# | ||
# Create internal conda envs with all dependencies | ||
# | ||
# AUTHOR: Maciej_Bak | ||
# CONTACT: wsciekly.maciek@gmail.com | ||
# | ||
############################################################################### | ||
|
||
snakemake \ | ||
--snakefile="workflow/Snakefile" \ | ||
--configfile="tests/localtest/config-template.yml" \ | ||
--config workflow_repo_path="$PWD" \ | ||
--config workflow_analysis_outdir="$PWD/tests/localtest/output" \ | ||
--use-conda \ | ||
--conda-create-envs-only \ | ||
--cores 1 \ | ||
--nolock \ | ||
all | ||
|
||
for file in .snakemake/conda/*.yaml; do | ||
if [ -f "$file" ]; then | ||
if grep -q "name: warlock-r" "$file"; then | ||
ENVPATH="${file%.yaml}" | ||
break | ||
fi | ||
fi | ||
done | ||
|
||
eval "$(conda shell.bash hook)" | ||
conda deactivate | ||
conda activate $ENVPATH | ||
|
||
# strange error often appears, installation needs to be called twice | ||
Rscript -e "devtools::install('resources/demonanalysis', upgrade=TRUE)" | ||
Rscript -e "devtools::install('resources/demonanalysis', upgrade=TRUE)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
############################################################################### | ||
# | ||
# AUTHOR: Maciej_Bak | ||
# CONTACT: wsciekly.maciek@gmail.com | ||
# | ||
############################################################################### | ||
--- | ||
|
||
name: warlock-r | ||
|
||
channels: | ||
- conda-forge | ||
|
||
dependencies: | ||
- cmake=3.26.4 | ||
- compilers=1.3.0 | ||
- graphviz=2.50.0 | ||
- r-base=3.6.3 | ||
- r-devtools=2.4.1 | ||
- r-dplyr=1.0.6 | ||
- r-foreign=0.8_76 | ||
- r-ggplot2=3.3.3 | ||
- r-optparse=1.6.6 | ||
- r-readr=1.4.0 | ||
- r-rvaidememoire=0.9_79 | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
############################################################################### | ||
# | ||
# Small wrapper to plot all Muller plots for warlock simulations. | ||
# | ||
# AUTHOR: Maciek Bak | ||
# AFFILIATION: City, University of London | ||
# CONTACT: wsciekly.maciek@gmail.com | ||
# CREATED: 23.11.2022 | ||
# LICENSE: Apache_2.0 | ||
# | ||
############################################################################### | ||
|
||
Sys.setenv("LANGUAGE"="EN") | ||
|
||
# by default: suppress warnings | ||
options(warn = -1) | ||
|
||
# load libraries | ||
suppressPackageStartupMessages(suppressWarnings(library(demonanalysis))) | ||
suppressPackageStartupMessages(suppressWarnings(library(optparse))) | ||
|
||
# list the command-line arguments | ||
option_list <- list( | ||
make_option(c("--input"), | ||
action = "store_true", | ||
dest = "input_directory", | ||
type = "character", | ||
help = "Path to the warlock output directory." | ||
), | ||
make_option(c("--output"), | ||
action = "store_true", | ||
dest = "output_directory", | ||
type = "character", | ||
help = "Path for the output directory with plots." | ||
), | ||
make_option(c("--help"), | ||
action = "store_true", | ||
dest = "help", | ||
type = "logical", | ||
default = FALSE, | ||
help = "Show this information and exit." | ||
), | ||
make_option(c("--verbose"), | ||
action = "store_true", | ||
dest = "verbose", | ||
type = "logical", | ||
default = FALSE, | ||
help = "Run in verbose mode." | ||
) | ||
) | ||
|
||
# parse command-line arguments | ||
opt_parser <- OptionParser( | ||
usage = "Usage: %prog [OPTIONS] --message [STRING]", | ||
option_list = option_list, | ||
add_help_option = FALSE, | ||
description = "" | ||
) | ||
opt <- parse_args(opt_parser) | ||
|
||
# if verbose flag was set: print warnings | ||
if (opt$verbose) { | ||
options(warn = 0) | ||
} | ||
|
||
############################################################################### | ||
# MAIN | ||
############################################################################### | ||
|
||
plot_all_images( | ||
path = opt$input_directory, | ||
output_filename = "muller", | ||
output_dir = opt$output_directory | ||
) |