|
1 | 1 | #!/bin/bash
|
2 |
| -#Script to run implied alingment data sets |
3 | 2 |
|
4 |
| -#load Haskell dependencies |
5 |
| -which stack || curl -sSL https://get.haskellstack.org/ | sh |
6 | 3 |
|
7 |
| -#load Python3 dependencies |
8 |
| -which python3 || apt-get install python3 --yes |
9 |
| -which pip3 || apt-get install python3-pip --yes |
10 |
| -pip3 show matplotlib || pip3 install --upgrade matplotlib |
| 4 | +# # # # # |
| 5 | +# |
| 6 | +# Script to reproduce the results of the paper from a clean environment. |
| 7 | +# Installs all required dependencies. Builds the required binaries. |
| 8 | +# Run the experimental algorithm on datasets to generate the empirical results. |
| 9 | +# |
| 10 | +# # # # # |
11 | 11 |
|
12 |
| -#load R dependencies |
13 |
| -which R || sudo apt install r-base |
14 | 12 |
|
15 |
| -#build binaries |
16 |
| -stack install |
| 13 | +# Install dependencies required to replicate results: |
| 14 | +# * Load Python3 dependencies |
| 15 | +which python3 &> /dev/null || apt-get install python3 --yes |
| 16 | +which pip3 &> /dev/null || apt-get install python3-pip --yes |
| 17 | +pip3 show matplotlib &> /dev/null || pip3 install --upgrade matplotlib |
17 | 18 |
|
18 |
| -#ensure target directories exist |
| 19 | +# * Load R dependencies |
| 20 | +which R &> /dev/null || sudo apt install r-base |
| 21 | + |
| 22 | +# * Load Haskell dependencies |
| 23 | +which ghcup &> /dev/null || curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh |
| 24 | + |
| 25 | + |
| 26 | +# Build binaries |
| 27 | +ghcup run \ |
| 28 | + --ghc 9.2.1 \ |
| 29 | + --cabal 3.6.2.0 \ |
| 30 | + -- cabal update && \ |
| 31 | + cabal install \ |
| 32 | + --installdir=./bin \ |
| 33 | + --install-method=copy |
| 34 | + |
| 35 | + |
| 36 | +# Ensure output directories exist to place results data |
19 | 37 | mkdir -p replicate-results/csv
|
20 | 38 | mkdir -p replicate-results/data
|
21 | 39 | mkdir -p replicate-results/img
|
22 | 40 | mkdir -p replicate-results/taxa
|
23 | 41 | mkdir -p replicate-results/tree
|
24 | 42 |
|
25 |
| -#run data sets |
26 |
| -./bin/generate-timings \ |
27 |
| - --data data-sets/fungi.afasta \ |
28 |
| - --tree data-sets/fungi.tree \ |
29 |
| - --tcm data-sets/tcm-11.tcm \ |
30 |
| - --output fungi-11 \ |
31 |
| - -n [25,50,100,200,400,800,1553] \ |
32 |
| - -k [1%1,1%2,1%4,1%8,1%16,1%32] |
33 |
| -python3 plot-figure.py replicate-results/csv/fungi-11.preorder.csv replicate-results/img/fungi-preorder.eps |
34 |
| -python3 plot-figure.py replicate-results/csv/fungi-11.postorder.csv replicate-results/img/fungi-postorder.eps |
35 | 43 |
|
36 |
| -./bin/generate-timings \ |
37 |
| - --data data-sets/metazoa.afasta \ |
38 |
| - --tree data-sets/metazoa.tree \ |
39 |
| - --tcm data-sets/tcm-11.tcm \ |
40 |
| - --output metazoa-11 \ |
41 |
| - -n [25,50,100,200,400,800,1766] \ |
42 |
| - -k [1%1,1%2,1%4,1%8,1%16,1%32] |
43 |
| -python3 plot-figure.py replicate-results/csv/metazoa-11.preorder.csv replicate-results/img/metazoa-preorder.eps |
44 |
| -python3 plot-figure.py replicate-results/csv/metazoa-11.postorder.csv replicate-results/img/metazoa-postorder.eps |
| 44 | +# Run data sets to produce the results data |
| 45 | +function generate() |
| 46 | +{ |
| 47 | + ./bin/generate-timings $5 \ |
| 48 | + --data "data-sets/$1.afasta" \ |
| 49 | + --tree "data-sets/$1.tree" \ |
| 50 | + --tcm "data-sets/tcm-${2}.tcm" \ |
| 51 | + --output "$1-$2" \ |
| 52 | + -n "$3" \ |
| 53 | + -k "$4" |
| 54 | + |
| 55 | + python3 plot-figure.py \ |
| 56 | + "replicate-results/csv/${1}-${2}.preorder.csv" \ |
| 57 | + "replicate-results/img/${1}-preorder.eps" |
45 | 58 |
|
46 |
| -./bin/generate-timings \ |
47 |
| - --data data-sets/pathological.afasta \ |
48 |
| - --tree data-sets/pathological.tree \ |
49 |
| - --tcm data-sets/tcm-12.tcm \ |
50 |
| - --output pathological-12 \ |
51 |
| - -n [4,8,16,32,64,128,256] \ |
52 |
| - -k [1%1,1%2,1%4,1%8,1%16,1%32,1%64] |
53 |
| -python3 plot-figure.py replicate-results/csv/pathological-12.preorder.csv replicate-results/img/pathological-12-preorder.eps |
54 |
| -python3 plot-figure.py replicate-results/csv/pathological-12.postorder.csv replicate-results/img/pathological-12-postorder.eps |
| 59 | + python3 plot-figure.py \ |
| 60 | + "replicate-results/csv/${1}-${2}.postorder.csv" \ |
| 61 | + "replicate-results/img/${1}-postorder.eps" |
| 62 | +} |
55 | 63 |
|
56 |
| -./bin/generate-timings \ |
57 |
| - --no-generate \ |
58 |
| - --data data-sets/pathological.afasta \ |
59 |
| - --tree data-sets/pathological.tree \ |
60 |
| - --tcm data-sets/tcm-31.tcm \ |
61 |
| - --output pathological-31 \ |
62 |
| - -n [4,8,16,32,64,128,256] \ |
63 |
| - -k [1%1,1%2,1%4,1%8,1%16,1%32,1%64] |
64 |
| -python3 plot-figure.py replicate-results/csv/pathological-31.preorder.csv replicate-results/img/pathological-31-preorder.eps |
65 |
| -python3 plot-figure.py replicate-results/csv/pathological-31.postorder.csv replicate-results/img/pathological-31-postorder.eps |
| 64 | +generate 'fungi' '11' '[25,50,100,200,400,800,1553]' '[1%1,1%2,1%4,1%8,1%16,1%32]' |
| 65 | +generate 'metazoa' '11' '[25,50,100,200,400,800,1766]' '[1%1,1%2,1%4,1%8,1%16,1%32]' |
| 66 | +generate 'pathological' '12' '[4,8,16,32,64,128,256]' '[1%1,1%2,1%4,1%8,1%16,1%32,1%64]' |
| 67 | +generate 'pathological' '31' '[4,8,16,32,64,128,256]' '[1%1,1%2,1%4,1%8,1%16,1%32,1%64]' '--no-generate' |
0 commit comments