In order to enable users to work
with mvMAPIT without having to install all dependencies and libraries on
their local, we provide a docker build with all dependencies and an
installed R package mvMAPIT. Learn how to build your own
version of the docker image.
Follow the official guide to learn how to Get Docker. This is required for being able to follow this tutorial.
The github repository of mvMAPIT already comes
with a Dockerfile. To build the image, clone the github
repository and run the following commands.
This will produce an image named mvmapit that contains
Rstudio, mvMAPIT, and all dependencies.
With a local copy of the docker image mvmapit available,
run the following code.
This will start the docker container that serves an RStudio
application at localhost:8787. In this container,
mvMAPIT is already installed and can be imported and run in
the R console via the following code.
library(mvMAPIT)
mvmapit(t(simulated_data$genotype[1:100,1:10]),
t(simulated_data$trait[1:100,]),
cores = 2, logLevel = "DEBUG")## 2026-05-23 08:21:46.775076 DEBUG:mvmapit:Running in normal test mode.
## 2026-05-23 08:21:46.781651 DEBUG:mvmapit:Genotype matrix: 10 x 100
## 2026-05-23 08:21:46.78755 DEBUG:mvmapit:Phenotype matrix: 2 x 100
## 2026-05-23 08:21:46.788206 DEBUG:mvmapit:Number of zero variance variants: 0
## 2026-05-23 08:21:46.788901 DEBUG:mvmapit:Genotype matrix after removing zero variance variants: 10 x 100
## 2026-05-23 08:21:46.789356 DEBUG:mvmapit:Scale X matrix appropriately.
## 2026-05-23 08:21:46.790221 INFO:mvmapit:Running normal C++ routine.
## 2026-05-23 08:21:46.794405 DEBUG:mvmapit:Calculated mean time of execution. Return list.
## $pvalues
## # A tibble: 30 × 3
## id trait p
## <chr> <chr> <dbl>
## 1 snp_00001 p_01*p_01 0.435
## 2 snp_00001 p_02*p_01 0.476
## 3 snp_00001 p_02*p_02 0.909
## 4 snp_00002 p_01*p_01 0.510
## 5 snp_00002 p_02*p_01 0.606
## 6 snp_00002 p_02*p_02 0.326
## 7 snp_00003 p_01*p_01 0.452
## 8 snp_00003 p_02*p_01 0.536
## 9 snp_00003 p_02*p_02 0.140
## 10 snp_00004 p_01*p_01 0.688
## # ℹ 20 more rows
##
## $pves
## # A tibble: 30 × 3
## id trait PVE
## <chr> <chr> <dbl>
## 1 snp_00001 p_01*p_01 0.0615
## 2 snp_00001 p_02*p_01 0.0663
## 3 snp_00001 p_02*p_02 -0.00451
## 4 snp_00002 p_01*p_01 -0.0215
## 5 snp_00002 p_02*p_01 -0.0239
## 6 snp_00002 p_02*p_02 -0.0287
## 7 snp_00003 p_01*p_01 0.0579
## 8 snp_00003 p_02*p_01 0.0493
## 9 snp_00003 p_02*p_02 -0.0400
## 10 snp_00004 p_01*p_01 -0.0146
## # ℹ 20 more rows
##
## $duration
## process duration_ms
## 1 cov NaN
## 2 projections NaN
## 3 vectorize NaN
## 4 q NaN
## 5 S NaN
## 6 vc NaN
##
## $vc
## # A tibble: 30 × 4
## id trait VC SE
## <chr> <chr> <dbl> <dbl>
## 1 snp_00001 p_01*p_01 0.0724 0.0928
## 2 snp_00001 p_02*p_01 0.0393 0.0551
## 3 snp_00001 p_02*p_02 -0.00490 0.0430
## 4 snp_00002 p_01*p_01 -0.0249 0.0378
## 5 snp_00002 p_02*p_01 -0.0145 0.0282
## 6 snp_00002 p_02*p_02 -0.0318 0.0323
## 7 snp_00003 p_01*p_01 0.0693 0.0921
## 8 snp_00003 p_02*p_01 0.0304 0.0491
## 9 snp_00003 p_02*p_02 -0.0442 0.0300
## 10 snp_00004 p_01*p_01 -0.0177 0.0440
## # ℹ 20 more rows