-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.R
More file actions
43 lines (39 loc) · 1.53 KB
/
setup.R
File metadata and controls
43 lines (39 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## 05/09/2014
## D.J. Bennett
## Download real trees from TreeBase and
## calculate their tree shape stats
## Note. the results of this run should be
## already be in /data
## Timestamp
cat (paste0 ('\nsetup.R started at [', Sys.time (), ']'))
## Parameters
rate.smooths <- c ('pathD8', 'chronoMPL', 'chronopl') # none, pathD8, chronoMPL, chronopl or vector
subsample <- FALSE # if numeric, take only subsample of trees for download
tree.dist <- 100 # the number of trees in a distribution for a polytomous tree
min.taxa <- 50 # the minimum tree size to be downloaded
max.taxa <- 500 # the maximum tree size to be downloaded
overwrite <- TRUE # delete all existing parsed trees and run again
ncpus <- 8 # number of processes for running parse in parallel
## Process
# download
cat ('\n--------------------------------')
cat (paste0 ('\n Download'))
cat ('\n--------------------------------\n')
#source (file.path ('stages', 'download.R'), print.eval = TRUE)
# parse
cat ('\n--------------------------------')
cat (paste0 ('\n Parsing'))
cat ('\n--------------------------------\n')
# parse with multiple rate smoothers
for (rate.smooth in rate.smooths) {
source (file.path ('stages', 'parse.R'), print.eval = TRUE)
}
# precalculate
cat ('\n--------------------------------')
cat (paste0 ('\n Precalculation'))
cat ('\n--------------------------------\n')
for (rate.smooth in rate.smooths) {
source (file.path ('stages', 'precalculate.R'), print.eval = TRUE)
}
## Timestamp
cat (paste0 ('\nsetup.R finished at [', Sys.time (), ']'))