R package for Poisson Hierarchical Markov Random Field model for analysis of spatial dependency on count data.
Hierarchical Markov Random Field model captures spatial dependency in gene expression, demonstrating regulation via the 3D genome
Naihui Zhou, Iddo Friedberg, Mark S. Kaiser
bioRxiv 2019.12.16.878371;
doi: https://doi.org/10.1101/2019.12.16.878371
Spatial neighborhoods are represented by networks, and thus not limited to regular lattices.
The MCMC process is written in C and takes advantage of BLAS and LAPACK routines. OpenMP enables parallel computation.
The package has special functions that handles large matrices that would otherwise crash your R.
To apply PhiMRF on gene expression and HiC data, see bioMRF.
See Vignettes
Update: Docker image now available through Github packages!
The Docker image has all prerequisites and the PhiMRF R package already installed and ready to use.
1. Lapacke
Lapacke is a C interface to LAPACK routines. To install on linux if you don't already have lapack and openblas:
sudo apt install liblapack3
sudo apt install liblapack-dev
sudo apt install libopenblas-base
sudo apt install libopenblas-dev
sudo apt install liblapacke-dev
sudo apt install liblapack-dev
See here for instructions for Windows.
Rmath enables the use of common R functions such as rnorm()
in C.
Here is a brief outline:
-
Find your R home directory by running
R.home()
within R. -
Go to your R home directory (
$R_HOME
) and see if the the directory$R_HOME/src/nmath/standalone/
exists
-
If yes, run
make
in that directory. -
If not, install R from source, and then go to the steps above.
- Link the Rmath library to the default path
ln -s $R_HOME/src/nmath/standalone/libRmath.so /usr/lib/libRmath.so
Detailed installation instructions for Rmath can be found here for Linux, MacOS and Windows.
In a command-line console, type:
ldconfig -p | grep liblapacke
ldconfig -p | grep libRmath
ldconfig -p | grep liblapack
ldconfig -p | grep libblas
Install the package in R using the devtools
package.
library(devtools)
devtools::install_github("https://github.com/ashleyzhou972/PhiMRF")