From ed634d24faf51f7b64d6574016f6df3dcf61f5f8 Mon Sep 17 00:00:00 2001 From: AngryMaciek Date: Sat, 9 Mar 2024 00:41:20 +0100 Subject: [PATCH 1/6] info --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 08ba019..c64f970 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ We have prepared a dedicated [conda environment](https://docs.conda.io/projects/ bash prepare-environments.sh ``` +5. Finally, feel free to verify the installation with a small test script + ```bash + bash testscript.sh + ``` + ## Configuration For a detailed description of all available simulation parameters please inspect [GitHub repository](https://github.com/robjohnnoble/demon_model) of the core _demon_ model. @@ -117,12 +122,6 @@ Running large workflows with hundreds of cluster jobs might take very long; cons After each pipeline run the main output directory will contain three subdirectories: `configfiles`, `simulations` and `logs`. Each simulation run with a specific set of parameters is encoded by a 4-letter code. The first directory contains configuration files for each of the simulation runs; `simulations` contain all _demon_ output files; `logs` keep captured standard output and error streams for the commands. -## Example - -Feel free to run the pipeline and inspect the results yourself in an [interactive jupyter notebook](https://mybinder.org/v2/gh/AngryMaciek/warlock/master?labpath=notebook.ipynb) we prepared. -Alternatively, feel free to run a small test script on your local machine with -`bash testscript.sh`. - ## Community guidelines For guidelines on how to contribute to the project or report issues, please see [contributing instructions](/CONTRIBUTING.md). For other inquires feel free to contact project lead by email: [✉️](mailto:wsciekly.maciek@gmail.com) From 46ef5ac6cd9b46821a818ca1d589225b9f040d68 Mon Sep 17 00:00:00 2001 From: AngryMaciek Date: Sat, 9 Mar 2024 00:42:50 +0100 Subject: [PATCH 2/6] test gitpod --- .gitpod.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitpod.yml b/.gitpod.yml index b49587a..db47294 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -11,6 +11,7 @@ tasks: init: | echo "Building development environment..." mamba env create -f environment.yml --prefix ./.warlock + bash prepare-environments.sh echo "Development environment ready!" # adjust PS1 + activate dev. env. + compile demon command: | From 82ab107d665b9a6340258ca134505f57e2ec71b8 Mon Sep 17 00:00:00 2001 From: AngryMaciek Date: Sat, 9 Mar 2024 00:47:17 +0100 Subject: [PATCH 3/6] fix path --- .gitpod.yml | 2 +- notebook.ipynb | 292 ------------------------------------------------- 2 files changed, 1 insertion(+), 293 deletions(-) delete mode 100644 notebook.ipynb diff --git a/.gitpod.yml b/.gitpod.yml index db47294..fff417a 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -11,7 +11,7 @@ tasks: init: | echo "Building development environment..." mamba env create -f environment.yml --prefix ./.warlock - bash prepare-environments.sh + bash -c 'CONDA_PREFIX="/workspace/warlock/.warlock" ./prepare-environments.sh' echo "Development environment ready!" # adjust PS1 + activate dev. env. + compile demon command: | diff --git a/notebook.ipynb b/notebook.ipynb deleted file mode 100644 index d6f9d88..0000000 --- a/notebook.ipynb +++ /dev/null @@ -1,292 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "1928a2a5", - "metadata": { - "tags": [] - }, - "source": [ - "### _warlock_ vignette" - ] - }, - { - "cell_type": "markdown", - "id": "4450695b", - "metadata": {}, - "source": [ - "The following notebook demonstrates workflow execution with a simple set of simulation parameters." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "89b9ced8", - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "from IPython.display import Image" - ] - }, - { - "cell_type": "markdown", - "id": "0a4b57d1", - "metadata": {}, - "source": [ - "## Prepare files for the workflow" - ] - }, - { - "cell_type": "markdown", - "id": "9f7ed01b", - "metadata": {}, - "source": [ - "In the example below we will prepare a configuration file varying one specific parameter: deme carrying capacity.\n", - "\n", - "All dependencies have been already installed while building a container for this notebook." - ] - }, - { - "cell_type": "markdown", - "id": "63403efe", - "metadata": {}, - "source": [ - "Compile _demon_" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "90a4c46c", - "metadata": {}, - "outputs": [], - "source": [ - "%%bash\n", - "\n", - "g++ resources/demon_model/src/demon.cpp -o resources/demon_model/bin/demon -I/srv/conda/envs/notebook/include/ -lm" - ] - }, - { - "cell_type": "markdown", - "id": "cb706573", - "metadata": {}, - "source": [ - "Prepare configfile for the workflow (based on a template)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3aa3277f", - "metadata": {}, - "outputs": [], - "source": [ - "with open(\"tests/binder/config-template.yml\") as f:\n", - " configlines = f.read().splitlines()\n", - "\n", - "configlines[17] = \"workflow_repo_path: \\\"\" + os.getcwd() + \"\\\"\"\n", - "\n", - "outdir = os.path.join(\n", - " os.getcwd(),\n", - " \"tests\",\n", - " \"binder\",\n", - " \"output\"\n", - ")\n", - "\n", - "configlines[22] = \"workflow_analysis_outdir: \\\"\" + outdir + \"\\\"\"\n", - "\n", - "with open(\"tests/binder/config.yml\", \"w\") as f:\n", - " for line in configlines:\n", - " f.write(line + os.linesep)" - ] - }, - { - "cell_type": "markdown", - "id": "5298889a", - "metadata": {}, - "source": [ - "## Execute the workflow" - ] - }, - { - "cell_type": "markdown", - "id": "59834894", - "metadata": {}, - "source": [ - "We trigger the snakemake workflow via our main bash script (~5min runtime)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6f9a1e6a", - "metadata": {}, - "outputs": [], - "source": [ - "%%bash\n", - "\n", - "time \\\n", - "bash warlock.sh \\\n", - "--configfile tests/binder/config.yml \\\n", - "--environment local \\\n", - "--cores 3" - ] - }, - { - "cell_type": "markdown", - "id": "b6b91cc3", - "metadata": {}, - "source": [ - "## Example post-processing" - ] - }, - { - "cell_type": "markdown", - "id": "90a8045e", - "metadata": {}, - "source": [ - "In order to quickly glance over simulations' results we shall utilize a [previously developed package](https://github.com/robjohnnoble/demonanalysis) (which is outside the scope if this repository)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ecdd65e6", - "metadata": {}, - "outputs": [], - "source": [ - "%load_ext rpy2.ipython" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b02b223b", - "metadata": {}, - "outputs": [], - "source": [ - "%%R\n", - "\n", - "library('demonanalysis')\n", - "\n", - "plot_all_images(\n", - " path=\"tests/binder/output/simulations/00000000\",\n", - " output_filename=\"summary\",\n", - " output_dir=\"tests/binder/output/simulations/00000000\"\n", - ")\n", - "\n", - "plot_all_images(\n", - " path=\"tests/binder/output/simulations/00000001\",\n", - " output_filename=\"summary\",\n", - " output_dir=\"tests/binder/output/simulations/00000001\"\n", - ")\n", - "\n", - "plot_all_images(\n", - " path=\"tests/binder/output/simulations/00000002\",\n", - " output_filename=\"summary\",\n", - " output_dir=\"tests/binder/output/simulations/00000002\"\n", - ")" - ] - }, - { - "cell_type": "markdown", - "id": "7317904e", - "metadata": {}, - "source": [ - "### Inspect the summary plots:" - ] - }, - { - "cell_type": "markdown", - "id": "01c72cb9", - "metadata": {}, - "source": [ - "$\\log_2$[deme carrying capacity] = 8" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2b0f8217", - "metadata": {}, - "outputs": [], - "source": [ - "Image(filename=\"tests/binder/output/simulations/00000000/summary.png\") " - ] - }, - { - "cell_type": "markdown", - "id": "518dde2c", - "metadata": {}, - "source": [ - "$\\log_2$[deme carrying capacity] = 9" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0e4a74b6", - "metadata": {}, - "outputs": [], - "source": [ - "Image(filename=\"tests/binder/output/simulations/00000001/summary.png\") " - ] - }, - { - "cell_type": "markdown", - "id": "123529a1", - "metadata": {}, - "source": [ - "$\\log_2$[deme carrying capacity] = 10" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "018e1056", - "metadata": {}, - "outputs": [], - "source": [ - "Image(filename=\"tests/binder/output/simulations/00000002/summary.png\") " - ] - }, - { - "cell_type": "markdown", - "id": "dfdd7551", - "metadata": {}, - "source": [ - "**The simple example above highlights that the higher the deme carrying capacity is the sooner the tumor evolves within the population.**" - ] - }, - { - "cell_type": "markdown", - "id": "782ed072", - "metadata": {}, - "source": [ - "---" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.0" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From e2effb54c02e905d769eddf52db1205b351b9dae Mon Sep 17 00:00:00 2001 From: AngryMaciek Date: Sat, 9 Mar 2024 00:58:47 +0100 Subject: [PATCH 4/6] remove gitpod --- .gitpod.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index fff417a..0000000 --- a/.gitpod.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This configuration file was automatically generated by Gitpod. -# Please adjust to your needs (https://www.gitpod.io/docs/config-gitpod-file). - -image: condaforge/mambaforge:22.9.0-1 - -tasks: - - - name: main - - # build with mamba in cwd (backed-up) - init: | - echo "Building development environment..." - mamba env create -f environment.yml --prefix ./.warlock - bash -c 'CONDA_PREFIX="/workspace/warlock/.warlock" ./prepare-environments.sh' - echo "Development environment ready!" - # adjust PS1 + activate dev. env. + compile demon - command: | - conda config --set changeps1 False - parse_git_branch() { git branch --show-current ; } - export PS1="\e[1;37m(\$(parse_git_branch)) \e[0;33m\w \e[1;37m$\e[0m " - echo "Activating the environment..." - conda activate ./.warlock - echo "Compiling demon..." - g++ resources/demon_model/src/demon.cpp -o resources/demon_model/bin/demon -I.warlock/include -lm - echo "Ready to work!" - echo "Remember to switch to a feature branch before starting the development :)" From a6bca8a5088ba88dcd4cc3611cf831934e48f6fb Mon Sep 17 00:00:00 2001 From: AngryMaciek Date: Sat, 9 Mar 2024 01:00:20 +0100 Subject: [PATCH 5/6] clea --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index c64f970..f3aa70d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/AngryMaciek/warlock) [![ci-pipeline](https://github.com/AngryMaciek/warlock/workflows/ci-pipeline/badge.svg)](https://github.com/AngryMaciek/warlock/actions?query=workflow%3Aci-pipeline) [![CodeFactor](https://www.codefactor.io/repository/github/angrymaciek/warlock/badge/master)](https://www.codefactor.io/repository/github/angrymaciek/warlock/overview/master) [![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://hub.docker.com/r/angrymaciek/warlock) From 10925899bd4405c574889a26c8cc21d06f781d2b Mon Sep 17 00:00:00 2001 From: AngryMaciek Date: Sat, 9 Mar 2024 01:01:55 +0100 Subject: [PATCH 6/6] fix contributing instructions --- CONTRIBUTING.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33ff1e0..0fbb8f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,20 +12,6 @@ If you have an idea for improvement, you can submit your proposal in the *Issues Please follow instructions specified in the [README](README.md#installation) file and you are good to code! -## Ephemeral development environment - -You are more then welcome to contribute to our codebase from the cloud! -We set up an ephemeral [Gitpod](https://www.gitpod.io) environment for all the developers who prefer coding from a remote server. - -Just click on this cool button below: -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/AngryMaciek/warlock) - -See more information on how to start up a _Gitpod_ environment dedicated to a specific remote branch [here](https://www.gitpod.io/docs/introduction/learn-gitpod/context-url#branch-and-commit-contexts), specific issue [here](https://www.gitpod.io/docs/introduction/learn-gitpod/context-url#issue-context) and a specific pull request [here](https://www.gitpod.io/docs/introduction/learn-gitpod/context-url#pullmerge-request-context). - -However, please remember that such luxury is limitted: -> Gitpod offers a free plan for new users which includes 50 hours of standard workspace usage. ->If you need more hours, you can upgrade to one of the paid plans in your personal settings. - ## Branch naming convention You can read about git branching [under this address](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging). The branch names should follow the convention specified below: