File size: 5,141 Bytes
02c4c2b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM rocker/r-ver:4.2.0

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libcurl4-openssl-dev \
    libssl-dev \
    libxml2-dev \
    libgsl-dev \
    libglpk-dev \
    libgmp3-dev \
    libjq-dev \
    libv8-dev \
    libudunits2-dev \
    libgdal-dev \
    libproj-dev \
    libfontconfig1-dev \
    libharfbuzz-dev \
    libfribidi-dev \
    libfreetype6-dev \
    libpng-dev \
    libtiff5-dev \
    libjpeg-dev \
    jags

# Install R packages
RUN R -e "install.packages(c('plumber', \
    'aggregation', 'aides', 'altmeta', 'amanida', 'baggr', 'bamdit', 'BayesCombo', 'bayesmeta', 'BayesMultMeta', 'bipd', 'bnma', 'boot.heterogeneity', 'boutliers', 'bspmma', 'CAMAN', 'catmap', 'CausalMetaR', 'CBnetworkMA', 'CIAAWconsensus', 'citationchaser', 'coefa', 'CohensdpLibrary', 'compute.es', 'corrmeta', 'CoTiMA', 'CPBayes', 'crossnma', 'crwbmetareg', 'dfmeta', 'diagmeta', 'digitize', 'dmetatools', 'dosresmeta', 'DTAplots', 'ecoreg', 'effectsize', 'effsize', 'epiR', 'es.dif', 'esci', 'estimraw', 'estmeansd', 'EValue', 'EvidenceSynthesis', 'forestly', 'forestmodel', 'forestplot', 'forestploter', 'forplo', 'fsn', 'gap', 'GENMETA', 'getmstatistic', 'getspres', 'GMCM', 'harmonicmeanp', 'heterometa', 'jarbes', 'joint.Cox', 'juicr', 'KenSyn', 'MAd', 'mada', 'MBNMAdose', 'MBNMAtime', 'mc.heterogeneity', 'MendelianRandomization', 'meta.shrinkage', 'meta4diag', 'MetaAnalyser', 'metabias', 'metaBLUE', 'metaBMA', 'metabolic', 'metabup', 'metacart', 'metaconfoundr', 'metadat', 'metaDigitise', 'metaforest', 'metafuse', 'metagam', 'metaGE', 'metagear', 'metainc', 'MetaIntegration', 'MetaIntegrator', 'metaLik', 'metaMA', 'metamedian', 'metamicrobiomeR', 'metamisc', 'metansue', 'metap', 'metapack', 'metaplus', 'metapower', 'metapro', 'metarep', 'metaRNASeq', 'metasens', 'MetaSKAT', 'MetaStan', 'MetaSubtract', 'metaSurvival', 'metatest', 'metaumbrella', 'MetaUtility', 'metavcov', 'metaviz', 'metawho', 'miniMeta', 'mixmeta', 'MOTE', 'multibiasmeta', 'multinma', 'mvmeta', 'MVPBT', 'mvtmeta', 'NMA', 'nmadb', 'NMADiagT', 'nmaINLA', 'NMAoutlier', 'nmaplateplot', 'nmarank', 'nmathresh', 'ofGEM', 'OssaNMA', 'pcnetmeta', 'pema', 'phacking', 'pimeta', 'PINMA', 'POMADE', 'poolr', 'PRISMA2020', 'PRISMAstatement', 'psychmeta', 'psymetadata', 'PublicationBias', 'publipha', 'puniform', 'ra4bayesmeta', 'RandMeta', 'rankinma', 'ratesci', 'RBesT', 'RcmdrPlugin.EZR', 'RcmdrPlugin.MA', 'RcmdrPlugin.RMTCJags', 'reappraised', 'rema', 'remaCor', 'revtools', 'rma.exact', 'rmeta', 'rnmamod', 'RoBMA', 'RobustBayesianCopas', 'robustmeta', 'RobustRankAggreg', 'RTSA', 'SCMA', 'selectMeta', 'SingleCaseES', 'smd', 'SPAtest', 'ssifs', 'TFisher', 'vcmeta', 'viscomp', 'weightr', 'xmeta', \
    'brms', 'clubSandwich', 'dmetar', 'dplyr', 'esc', 'extraDistr', 'forcats', 'gemtc', 'ggplot2', 'ggridges', 'glue', 'igraph', 'meta', 'metafor', 'metaSEM', 'netmeta', 'openxlsx', 'osfr', 'PerformanceAnalytics', 'rjags', 'robvis', 'semPlot', 'stringr', 'tidybayes', 'tidyverse', 'wildmeta'), \
    repos='https://cloud.r-project.org/')"

# Install specific versions of packages
RUN R -e "devtools::install_version('brms', version = '2.18.0')"
RUN R -e "devtools::install_version('clubSandwich', version = '0.5.6')"
RUN R -e "devtools::install_version('dplyr', version = '1.0.10')"
RUN R -e "devtools::install_version('esc', version = '0.5.1')"
RUN R -e "devtools::install_version('extraDistr', version = '1.9.1')"
RUN R -e "devtools::install_version('forcats', version = '0.5.1')"
RUN R -e "devtools::install_version('gemtc', version = '0.8-6')"
RUN R -e "devtools::install_version('ggplot2', version = '3.3.5')"
RUN R -e "devtools::install_version('ggridges', version = '0.5.2')"
RUN R -e "devtools::install_version('glue', version = '1.4.1')"
RUN R -e "devtools::install_version('igraph', version = '1.2.5')"
RUN R -e "devtools::install_version('meta', version = '6.1.0')"
RUN R -e "devtools::install_version('metafor', version = '3.8.1')"
RUN R -e "devtools::install_version('metaSEM', version = '1.3.0')"
RUN R -e "devtools::install_version('metasens', version = '1.5.1')"
RUN R -e "devtools::install_version('netmeta', version = '2.1.0')"
RUN R -e "devtools::install_version('openxlsx', version = '4.2.5')"
RUN R -e "devtools::install_version('osfr', version = '0.2.8')"
RUN R -e "devtools::install_version('PerformanceAnalytics', version = '2.0.4')"
RUN R -e "devtools::install_version('robvis', version = '0.3.0')"
RUN R -e "devtools::install_version('semPlot', version = '1.1.5')"
RUN R -e "devtools::install_version('stringr', version = '1.4.0')"
RUN R -e "devtools::install_version('tidybayes', version = '2.1.1')"
RUN R -e "devtools::install_version('tidyverse', version = '1.3.1')"
RUN R -e "devtools::install_version('wildmeta', version = '0.1.0')"

# Install dmetar from GitHub
RUN R -e "remotes::install_github('MathiasHarrer/dmetar')"

# Copy the API script
COPY meta_analysis_api.R /app/meta_analysis_api.R

# Set the working directory
WORKDIR /app

# Expose the port the app runs on
EXPOSE 7860

# Run the API
CMD ["R", "-e", "library(plumber); r <- plumb('meta_analysis_api.R'); r$run(host='0.0.0.0', port=7860)"]