Skip to content

Commit 79f36ee

Browse files
committed
Add Dockerfile and fix R notebook
Add installation description for docker
1 parent 9034866 commit 79f36ee

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM continuumio/miniconda
2+
3+
RUN apt-get update --fix-missing && apt-get install -y r-base && apt-get clean && rm -rf /var/lib/apt/lists/*
4+
5+
ADD environment.yml /tmp/environment.yml
6+
RUN conda env create -f /tmp/environment.yml
7+
8+
RUN Rscript -e 'install.packages(c("IRkernel","lme4"),repos="https://cran.rstudio.com")'
9+
RUN /bin/bash -c "source activate gwas-lecture && Rscript -e 'IRkernel::installspec()'"
10+
11+
# Pull the environment name out of the environment.yml
12+
RUN echo "source activate $(head -1 /tmp/environment.yml | cut -d' ' -f2)" > ~/.bashrc
13+
ENV PATH /opt/conda/envs/$(head -1 /tmp/environment.yml | cut -d' ' -f2)/bin:$PATH
14+
15+
RUN mkdir /root/gwas-lecture
16+
COPY . /root/gwas-lecture
17+
18+
EXPOSE 8888
19+
CMD ["/opt/conda/envs/gwas-lecture/bin/jupyter", "notebook", "--ip='0.0.0.0'","--allow-root","--port","8888","--no-browser","--notebook-dir","/root/gwas-lecture/"]

Lecture-0-Setup-of-Python-Environment.ipynb

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@
4646
"```\n",
4747
"\n",
4848
"\n",
49-
"#### Install conda on Windows \n",
50-
"\n",
51-
"Download EXE installer and install it.\n",
52-
"\n",
53-
"\n",
5449
"## Create a conda environment and install limix, jupyter notebook\n",
5550
"\n",
5651
"### For Linux, Mac OSX and WSL follow this:\n",
@@ -61,20 +56,17 @@
6156
"$ cd gwas-lecture\n",
6257
"$ conda env create -f environment.yml\n",
6358
"```\n",
64-
"### For Windows follow this:\n",
6559
"\n",
66-
"For Windows you also need the Windows Compiler for Python 2.7 which you can download [here](http://aka.ms/vcpython27) \n",
6760
"\n",
68-
"```bash\n",
69-
"$ git clone https://github.com/timeu/gwas-lecture.git \n",
70-
"$ # or download archive from and extract it from https://github.com/timeu/gwas-lecture/archive/master.zip\n",
71-
"$ cd gwas-lecture\n",
72-
"$ conda create -n gwas-lecture python=3\n",
73-
"$ activate gwas-lecture\n",
74-
"$ conda install -c conda-forge cython numpy jupyter matplotlib hcephes\n",
75-
"$ pip install liknorm numpy-sugar glimix-core joblib limix-legacy ncephes pandas-plink\n",
76-
"$ pip install limix\n",
61+
"## Docker container\n",
62+
"\n",
63+
"As a fallback if any of the installations above fail, it is possible to use a docker container that comes with all libraries pre-installed. First make sure to install [Docker](https://docs.docker.com/install/) on your machine.\n",
64+
"Once docker is installed just run: \n",
65+
"\n",
7766
"```\n",
67+
"$ docker run -it timeu/gwas-lecture\n",
68+
"```\n",
69+
"Open http://localhost:8888 in your browser\n",
7870
"\n",
7971
"\n",
8072
"## Start jupyter notebook\n",
@@ -98,10 +90,7 @@
9890
"\n",
9991
"In the terminal, type:\n",
10092
"* install.packages('IRkernel')\n",
101-
"* IRkernel::installspec() # to register the kernel in the current R installation\n",
102-
"\n",
103-
"Launch jupyter with the specified kernel:\n",
104-
"* jupyter console --kernel=ir"
93+
"* IRkernel::installspec() # to register the kernel in the current R installation"
10594
]
10695
}
10796
],

Lecture-6-BroadSenseHeritability.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@
6969
"source": [
7070
"## if lme4 isn't installed, install it first:\n",
7171
"if (!require(\"lme4\")) install.packages(\"lme4\");\n",
72-
"\n",
7372
"library(lme4);\n",
74-
"library(RLRsim);\n",
73+
"\n",
7574
"source(\"data/cmeyer_glucs2015/hdr.estimate_r2_mixedmodels.R\");\n",
7675
"\n",
7776
"glucosinolateFileName <- \"data/cmeyer_glucs2015/bmeyer_etal.txt\";\n",

0 commit comments

Comments
 (0)