Skip to content

Commit a75a213

Browse files
committed
Installation instruction with ansible
1 parent 3417f51 commit a75a213

File tree

8 files changed

+72
-21
lines changed

8 files changed

+72
-21
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ __pycache__/
22
*pyc
33
.dropbox.attr
44
ansible/setup.retry
5+
my.key
6+
my.key.pub

ansible/hosts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
[tryminvar]
2-
172.23.10.154
1+
[minvarmachine]
2+
172.23.10.194

ansible/setup-host.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

ansible/setup-hosts.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
ansible-playbook setup.yml -i hosts --key-file=path_to_my_private_key -v

ansible/setup.retry

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
172.23.10.154
1+
172.23.10.194

ansible/setup.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
---
2-
########################
3-
# Test if MinVar works #
4-
########################
2+
#######################################
3+
# This provides everything for MinVar #
4+
#######################################
55

6-
- hosts: tryminvar
6+
- hosts: minvarmachine
77
remote_user: ubuntu
88
become: yes
99

1010
tasks:
1111

12-
- hostname:
13-
name: tryminvar
14-
1512
- name: Ensure sysadmin SSH keys are authorized for user 'ubuntu'
1613
authorized_key: user="ubuntu" key="{{ item }}"
1714
with_file:
18-
- ~/.ssh/oct2016.key.pub
19-
15+
- my.key.pub
2016

2117
# - name: Upgrade all installed packages to latest version
2218
# apt:
@@ -30,6 +26,7 @@
3026
with_items:
3127
- acl
3228
- automake
29+
- bedtools
3330
- build-essential
3431
- bwa
3532
- cmake
@@ -47,7 +44,6 @@
4744
- pkg-config
4845
- python-dev
4946
- python-setuptools
50-
- r-cran-ggplot2
5147
- seqtk
5248
- tabix
5349
- unzip
@@ -156,6 +152,18 @@
156152
owner: ubuntu
157153
mode: 0775
158154

155+
- name: Download pandoc packages
156+
get_url:
157+
url: https://github.com/jgm/pandoc/releases/download/1.19.2.1/pandoc-1.19.2.1-1-amd64.deb
158+
dest: /tmp/pandoc-1.19.2.1-1-amd64.deb
159+
register: get_pandoc
160+
161+
- name: Install pandoc
162+
shell: |
163+
if [ ! -x "$(command -v pandoc)" ]; then
164+
dpkg -i /tmp/pandoc-1.19.2.1-1-amd64.deb
165+
fi
166+
159167
- name: Download miniconda
160168
get_url:
161169
url: https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
@@ -171,7 +179,7 @@
171179
hash -r && \
172180
/opt/miniconda/bin/conda config --set always_yes yes --set changeps1 no && \
173181
/opt/miniconda/bin/conda update -q conda
174-
/opt/miniconda/bin/conda install -q Biopython pandas seaborn scipy
182+
/opt/miniconda/bin/conda install -q Biopython pandas
175183
fi
176184
args:
177185
executable: /bin/bash
@@ -194,3 +202,10 @@
194202
fi
195203
args:
196204
executable: /bin/bash
205+
206+
- name: Add directories to PATH
207+
lineinfile: dest=/home/{{item.user}}/.bash_profile
208+
line="export PATH=$PATH:/usr/local/edirect:/usr/local/vcflib:/opt/miniconda/bin"
209+
create=yes
210+
with_items:
211+
- { user: "ubuntu" }

minvar/annotate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def phase_mutations(muts, frame, bam_file):
343343
pass
344344
d_here = {'wt': 'XYZ', 'pos': t[0], 'mut': k, 'freq': freq_here}
345345
pm = pm.append(d_here, ignore_index=True)
346-
logging.info('%s %f %d', % (k, freq_here, t[0]))
346+
logging.info('%s %f %d' % (k, freq_here, t[0]))
347347
logging.info('<------>')
348348
muts = muts.reset_index()
349349
pm = pm.reset_index()

rtd/user-guide/installation.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Installation
1+
## Installation (work in progress)
22

33
A condensed list of dependencies
44

@@ -11,6 +11,12 @@ A condensed list of dependencies
1111
- bwa
1212
- lofreq
1313

14+
### Install GATK
15+
16+
GATK is not (yet?) included in the instructions below because you need
17+
to register online [here](https://software.broadinstitute.org/gatk/download/)
18+
in order to download it. Then, install it in `/usr/local/GATK`. MinVar expects
19+
to find the Java archive file `/usr/local/GATK/GenomeAnalysisTK.jar`.
1420

1521
### Setting up with Ansible
1622

@@ -23,11 +29,39 @@ its dependencies on a dedicated machine. The files therein define an
2329

2430
Ansible is a deployment tool that allows an automatic provisioning of machines
2531
on the cloud (it can be used on AWS, DigitalOcean, Google Cloud Platform etc.)
26-
The user install ansible on their own local machine (this can be your old laptop),
32+
The user installs ansible on a local machine (this can be your old laptop),
2733
defines ansible commands in specific files and uses them to set up a remote
2834
machine.
2935

3036
In the following we will assume that you have installed ansible on your local
31-
laptop and you want to set up MinVar on a remote machine running Ubuntu Linux.
37+
laptop and you want to set up MinVar on a remote machine running Linux Ubuntu 16.04.
38+
The access to this machine is provided by private-public SSH key pair that must be
39+
set up. Good instructions for this task can be found in this [help](https://help.ubuntu.com/community/SSH/OpenSSH/Keys).
40+
41+
#### How to proceed
42+
43+
1. Install ansible on your machine (on Mac OS X you can do it via the package
44+
manager [brew](https://brew.sh) with `brew install ansible`),
45+
2. clone MinVar from GitHub with `git clone https://github.com/ozagordi/MinVar.git`
46+
or download/unzip it,
47+
3. move to the directory `ansible` in the cloned repository and identify the file
48+
`hosts`. This file contains two lines `[minvarmachine]` and a fake ip address.
49+
Adapt to the name of the machine you want to setup and its address,
50+
4. in the same directory edit the file `setup-hosts.sh`: adapt
51+
`--key-file=path_to_your_private_key` to point to your personal *private* key,
52+
5. copy your personal *public* key into `my.key`,
53+
6. run `./setup-hosts.sh`.
54+
55+
#### What can go wrong
56+
57+
We assumed that you have an Ubuntu 16.04 available. Most of the stuff will work
58+
on Ubuntu 14.04, but you need to switch to a newer version of Java provided by
59+
Oracle in order to run `picard`. You can find
60+
[here](https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04)
61+
a good tutorial on this.
62+
63+
### If you don't want to use ansible
3264

33-
https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
65+
The ansible [playbook](https://github.com/ozagordi/MinVar/blob/master/ansible/setup.yml)
66+
reads almost as plain English. You can manually copy the instructions from there
67+
and install what you need.

0 commit comments

Comments
 (0)