Skip to content

Commit

Permalink
Use conda environment and Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bebatut committed Mar 6, 2024
1 parent 5e013b1 commit 8eb9f4a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: microgalaxy_technical_paper
channels:
- conda-forge
- defaults
dependencies:
- jupyter
- pandas

0 comments on commit 8eb9f4a

Please sign in to comment.