From 8eb9f4a4dbeaf19825c1ade259ac10aab96563d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Wed, 6 Mar 2024 10:37:12 +0100 Subject: [PATCH] Use conda environment and Makefile --- Makefile | 33 +++++++++++++++++++++++++++++++++ README.md | 24 ++++++++++++++++++++++++ environment.yml | 7 +++++++ 3 files changed, 64 insertions(+) create mode 100644 Makefile create mode 100644 environment.yml diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..137b879 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +# Settings +CONDA_ENV=microgalaxy_technical_paper +SHELL=bash + +CONDA=$(shell which conda) +ifeq ($(CONDA),) + CONDA=${HOME}/miniconda3/bin/conda +endif + +default: help + +install-conda: ## install Miniconda + curl -L $(MINICONDA_URL) -o miniconda.sh + bash miniconda.sh -b +.PHONY: install-conda + +create-env: ## create conda environment + if ${CONDA} env list | grep '^${CONDA_ENV}'; then \ + ${CONDA} env update -f environment.yml; \ + else \ + ${CONDA} env create -f environment.yml; \ + fi +.PHONY: create-env + +ACTIVATE_ENV = source $(shell dirname $(dir $(CONDA)))/bin/activate $(CONDA_ENV) + +run-jupyter: ## run jupyter notebooks + $(ACTIVATE_ENV) && \ + jupyter notebook + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' +.PHONY: help diff --git a/README.md b/README.md index fb82e9e..f2c3f7f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,27 @@ # microGalaxy Technical Paper 2024 Preparation This repository includes all the scripts written to produce figures in the paper along with the resulted figures + +# Requirements + +- Install [conda](https://conda.io/miniconda.html) + + ``` + $ make install-conda + ``` + +- Create the conda environment + + ``` + $ make create-env + ``` + +# Usage + +- Launch [Jupyter](https://jupyter.org/) to access the notebooks to generate graphs + + ``` + $ make run-jupyter + ``` + +- Go to [http://localhost:8888](http://localhost:8888) (a page should open automatically in your browser) diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..ac1e687 --- /dev/null +++ b/environment.yml @@ -0,0 +1,7 @@ +name: microgalaxy_technical_paper +channels: +- conda-forge +- defaults +dependencies: +- jupyter +- pandas \ No newline at end of file