@@ -14,52 +14,39 @@ Vagrant.configure("2") do |config|
14
14
# boxes at https://vagrantcloud.com/search.
15
15
config . vm . box = "ubuntu/bionic64"
16
16
17
- # Disable automatic box update checking. If you disable this, then
18
- # boxes will only be checked for updates when the user runs
19
- # `vagrant box outdated`. This is not recommended.
20
- # config.vm.box_check_update = false
21
-
22
- # Create a forwarded port mapping which allows access to a specific port
23
- # within the machine from a port on the host machine. In the example below,
24
- # accessing "localhost:8080" will access port 80 on the guest machine.
25
- # NOTE: This will enable public access to the opened port
26
- # config.vm.network "forwarded_port", guest: 80, host: 8080
27
-
28
- # Create a forwarded port mapping which allows access to a specific port
29
- # within the machine from a port on the host machine and only allow access
30
- # via 127.0.0.1 to disable public access
31
- # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
32
-
33
- # Create a private network, which allows host-only access to the machine
34
- # using a specific IP.
35
- # config.vm.network "private_network", ip: "192.168.33.10"
36
-
37
- # Create a public network, which generally matched to bridged network.
38
- # Bridged networks make the machine appear as another physical device on
39
- # your network.
40
- # config.vm.network "public_network"
17
+ # Increase CPUs and memory for the box
18
+ # https://stackoverflow.com/a/37335639/81658
19
+ config . vm . provider "virtualbox" do |v |
20
+ host = RbConfig ::CONFIG [ 'host_os' ]
21
+ # Give VM 3/4 system memory & access to all cpu cores on the host
22
+ if host =~ /darwin/
23
+ cpus = `sysctl -n hw.ncpu` . to_i
24
+ elsif host =~ /linux/
25
+ cpus = `nproc` . to_i
26
+ else # Windows folks
27
+ cpus = `wmic cpu get NumberOfCores` . split ( "\n " ) [ 2 ] . to_i
28
+ end
29
+
30
+ puts "Provisioning VM with #{ cpus } CPU"
31
+ v . customize [ "modifyvm" , :id , "--cpus" , cpus ]
32
+ end
33
+
34
+ # Need extra disk size for casper compilation
35
+ # Requires disksize plugin:
36
+ # vagrant plugin install vagrant-disksize
37
+ config . disksize . size = '15GB'
38
+
39
+ # Log in as root
40
+ #config.ssh.username = 'root'
41
+ #config.ssh.password = 'vagrant'
42
+ #config.ssh.insert_key = 'true'
41
43
42
44
# Share an additional folder to the guest VM. The first argument is
43
45
# the path on the host to the actual folder. The second argument is
44
46
# the path on the guest to mount the folder. And the optional third
45
47
# argument is a set of non-required options.
46
48
# config.vm.synced_folder "../data", "/vagrant_data"
47
49
48
- # Provider-specific configuration so you can fine-tune various
49
- # backing providers for Vagrant. These expose provider-specific options.
50
- # Example for VirtualBox:
51
- #
52
- # config.vm.provider "virtualbox" do |vb|
53
- # # Display the VirtualBox GUI when booting the machine
54
- # vb.gui = true
55
- #
56
- # # Customize the amount of memory on the VM:
57
- # vb.memory = "1024"
58
- # end
59
- #
60
- # View the documentation for the provider you are using for more
61
- # information on available options.
62
-
63
50
# Enable provisioning with a shell script. Additional provisioners such as
64
51
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
65
52
# documentation for more information about their specific syntax and use.
@@ -68,26 +55,156 @@ Vagrant.configure("2") do |config|
68
55
# apt-get install -y apache2
69
56
# SHELL
70
57
config . vm . provision "shell" , inline : <<-SHELL
58
+ set -e
59
+
71
60
# Install dependencies
72
61
apt-get update
73
62
apt-get -y dist-upgrade
74
- apt-get -y install python3 python3-pip unzip
63
+ apt-get -y install python3 python3-pip unzip openjdk-8-jre-headless cmake
75
64
pip3 install virtualenv
76
65
77
66
# reduce wget output during provisioning
78
67
echo 'verbose = off' >> ~/.wgetrc
79
68
69
+ # Assistive tech cause java problems
70
+ rm -f /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/accessibility.properties
71
+
80
72
cd /vagrant/easy_setup
81
73
82
74
# accept all licenses
83
- sed -i 's/ACCEPT_ALL=no/ACCEPT_ALL=yes/i' configTRAL_path.cfg
75
+ if grep -q ACCEPT_ALL configTRAL_path.cfg; then
76
+ sed -i 's/ACCEPT_ALL=no/ACCEPT_ALL=yes/i' configTRAL_path.cfg
77
+ else
78
+ echo ACCEPT_ALL=yes >> configTRAL_path.cfg
79
+ fi
84
80
85
81
86
82
# Install TRAL software
87
83
./setupTRAL.sh setup
84
+
85
+ # Config file
86
+ cat <<END > ~/.tral/config.ini
87
+ ###########################################
88
+ ### Configuration file for TRAL Vagrant ###
89
+ ###########################################
90
+
91
+ sequence_type = AA
92
+
93
+ [sequence]
94
+ [[repeat_detection]]
95
+ # AA includes all detectors used by default on protein sequence data.
96
+ AA = HHrepID, T-REKS, TRUST, XSTREAM
97
+ # DNA includes all detectors used by default on protein sequence data.
98
+ DNA = Phobos, TRED, T-REKS, TRF, XSTREAM
99
+ [[repeat_detector_path]]
100
+ # If the executable is in the system path, supply its name. Otherwise, supply the full path to the executable. Details are explained in TRAL's online docs.
101
+ PHOBOS = phobos
102
+ HHrepID = hhrepid_64
103
+ HHrepID_dummyhmm = ~/.tral/data/hhrepid/dummyHMM.hmm
104
+ T-REKS = T-REKS
105
+ TRED = tred
106
+ TRF = trf
107
+ TRUST = TRUST
108
+ TRUST_substitutionmatrix = ~/.tral/tral_external_software/TRUST_Align/Align/BLOSUM50
109
+ XSTREAM = XSTREAM
110
+
111
+ [hmm]
112
+ hmmbuild = hmmbuild
113
+ l_effective_max = 50
114
+
115
+ [filter]
116
+ [[basic]]
117
+ tag = basic_filter
118
+ [[[dict]]]
119
+ [[[[pvalue]]]]
120
+ func_name = pvalue
121
+ score = phylo_gap01
122
+ threshold = 0.1
123
+ [[[[n_effective]]]]
124
+ func_name = attribute
125
+ attribute = n_effective
126
+ type = min
127
+ threshold = 1.9
128
+
129
+
130
+ [repeat]
131
+ scoreslist = phylo_gap01, # score (the comma in the end is needed for TRAL)
132
+ calc_score = False # is the score calculated?
133
+ calc_pvalue = False # is the pvalue calculated?
134
+ precision = 10
135
+ ginsi = ginsi # integrated in MAFFT
136
+ Castor = Castor
137
+ [[castor_parameter]]
138
+ rate_distribution = constant # either constant or gamma
139
+ alfsim = alfsim
140
+
141
+ [repeat_list]
142
+ # Columns to include in repeat list TSV output
143
+ # Allowed values:
144
+ # - begin: position of the tandem repeats within the sequence,
145
+ # - pvalue: statistical significance of the tandem repeats
146
+ # - divergence: divergence of the tandem repeat units
147
+ # - l_effective: length of the tandem repeat units
148
+ # - n_effective: number of tandem repeat units
149
+ # - msa_original: multiple sequence alignment
150
+ # - score: score corresponding to the value of 'model'
151
+ # - repeat_region_length: total length of repeat region
152
+ output_characteristics = begin, msa_original, l_effective, n_effective, repeat_region_length, divergence, pvalue
153
+
154
+ # model for scoring repeats. Supported: entropy, parsimony, pSim, phylo, phylo_gap01, phylo_gap001
155
+ model = phylo_gap01
156
+
157
+ [repeat_score]
158
+ evolutionary_model = lg
159
+ [[indel]]
160
+ indel_rate_per_site = 0.01
161
+ ignore_gaps = True
162
+ gaps = row_wise
163
+ zipf = 1.821
164
+ [[optimisation]]
165
+ start_min = 0.5
166
+ start_max = 1.5
167
+ n_iteration = 14
168
+ [[K80]]
169
+ kappa = 2.59
170
+ [[TN93]]
171
+ alpha_1 = 0.3
172
+ alpha_2 = 0.4
173
+ beta = 0.7
174
+ [[score_calibration]]
175
+ scoreslist=phylo_gap01, # score (the comma at the end is needed)
176
+ save_calibration = False
177
+ precision = 10
178
+
179
+ [AA]
180
+ standard_chars = A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, V, W, Y
181
+ all_chars = A, B, C, D, E, F, G, H, I, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
182
+ [[ambiguous_chars]]
183
+ B = D,N
184
+ O = K,
185
+ U = C,
186
+ Z = E,Q
187
+ X = A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, V, W, Y
188
+ [DNA]
189
+ standard_chars = A, C, G, T
190
+ all_chars = A, C, G, T, N, X
191
+ [[ambiguous_chars]]
192
+ N = A, C, G, T
193
+ X = A, C, G, T
194
+
195
+ END
196
+
197
+
198
+ # All external software
199
+ ./install_ext_software.sh
200
+
201
+ cd /vagrant
202
+ # dev requirements are optional but useful for tests and docs
203
+ pip3 install -r requirements_dev.txt
204
+
88
205
echo
89
206
echo "THIS MACHINE CONTAINS PROPRIETARY SOFTWARE."
90
207
echo "Please check the licenses before using (e.g. no commercial use permitted)"
91
208
SHELL
92
-
209
+
93
210
end
0 commit comments