Installing DiffBind for R-3.6.2

To Install DiffBind, you can follow the instruction found at DiffBind

First thing first, you would need to install BiocManager and then install DiffBand

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("DiffBind")

At the end, you should get

To view Documentation,

browseVignettes("DiffBind")

 

Installing the Seurat Package on R-3.6.2

Step 1: Compiling R on CentOS 7

a. Download R Package from https://cran.r-project.org/

b. Untar and Compile the R-Package

$ tar -zxvf R-3.6.2.tar.gz
$ cd R-3.6.2
$ ./configure --prefix=/home/myuser/R-3.6.2
$ make
$ make install

Step 2: Compile multtest package
Seurat is dependent on mulltest. But if you try installing muttest using R, you will have this error.

$ cd /home/myuser/R-3.6.2
$ ./R
install.packages("multtest")
Warning message:
package ‘multtest’ is not available (for R version 3.6.2)

To solve the issue, you have to install BiocManager first and use BiocManager to install mulltest

install.packages("BiocManager")
BiocManager::install("multtest")

Step 3: Finally, you can install Seurat

install.packages("Seurat")

References:

    1. Resampling-based multiple hypothesis testing

 

Installing rgdal_1.4-8.tar.gz with R-3.6.0 on CentOS 7

I tried installing rgdal_1.4.8.tar.gz with R-3.6.0  and there were a number of issues. Even though I have followed and installed according to “Compile gdal-2.4.3 on CentOS 7” I have the follow error.

Issue 1: Error: Proj.h not found in standard or given locations

.....
.....
checking C++11 support for GDAL >= 2.3.0... yes
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5.0... yes
checking gdal: linking with --libs only... yes
checking GDAL: gdal-config data directory readable... yes
checking GDAL: /usr/local/gdal-2.4.3/share/gdal/pcs.csv readable... yes
checking proj_api.h presence and usability... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’
.....

Apparently R is not able to find inside pkconfig for proj.pc file. To resolve it, do the following to your ~.bashrc environment.

export PKG_CONFIG_PATH=/usr/local/proj-5.2.0/lib/pkgconfig

You can verify by using the command

# pkg-config proj --libs
-L/usr/local/proj-5.2.0/lib -lproj

You can get more information via the thread proj_api.h not found in standard or given locations #1092

Issue 2: Proj_LIB Path Issues

.....
checking proj_api.h presence and usability... yes
checking PROJ version >= 4.8.0... yes
checking projects.h presence and usability... yes
checking PROJ.4: epsg found and readable... no
Error: proj/epsg not found
Either install missing proj support files, for example
the proj-nad and proj-epsg RPMs on systems using RPMs,
or if installed but not autodetected, set PROJ_LIB to the
correct path, and if need be use the --with-proj-share=
configure argument.
ERROR: configuration failed for package ‘rgdal’
.....

To resolve the PROJ_LIB Issue

export PROJ_LIB=/usr/local/proj-5.2.0/share/proj

You can more information from https://github.com/r-spatial/lwgeom/issues/28

Finally, you should be able to compile rgdal_1.4-8.tar.gz with R-3.6.0

# R CMD INSTALL rgdal_1.4-8.tar.gz
.....
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rgdal)
.....

Final Step: Testing and Verification

Load both gdal and proj libaries. Make sure you have compile gdal and proj libraries using the tutorial Compile gdal-2.4.3 on CentOS 7

$ module load proj/5.2.0
$ module load R/3.6.0
$ module load gdal/2.4.3
$ R
library(rgdal)
Loading required package: sp
rgdal: version: 1.4-8, (SVN revision 845)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 2.4.3, released 2019/10/28
Path to GDAL shared files: /usr/local/gdal-2.4.3/share/gdal
GDAL binary built with GEOS: FALSE
Loaded PROJ.4 runtime: Rel. 5.2.0, September 15th, 2018, [PJ_VERSION: 520]
Path to PROJ.4 shared files: /usr/local/proj-5.2.0/share/proj
Linking to sp version: 1.3-2

 

Compiling R-3.4.2 on CentOS 6 with GNU

If you are compiling CentOS 6, you will notice that the R source will not compile without a updated version of zlib, pcre, bzip2. libcurl. There is a very good site on how to compile R on Red Hat Linux

Step 1: Compile R-3.4.2

Download R-3.4.2 from The R Project for Statistical Computing

$ tar -zxvf R-3.4.2.tar.gz
$ ./configure --prefix=/usr/local/RH6_apps/R-3.4.2

During configuring…. error surfaced.

checking for zlib.h... yes
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required

Step 2: Compile zlib 1.2.11

a. In your .bashrc

export CFLAGS="-I/usr/local/zlib-1.2.11/include"
export LDFLAGS="-L/usr/local/zlib-1.2.11/lib"

b. Compile zlib-1.2.11

$ wget http://zlib.net/zlib-1.2.11.tar.gz
$ tar -zxvf zlib-1.2.11
$ cd zlib-1.2.11
$ configure --prefix=/usr/local/zlib-1.2.11

Step 3: Compile bzip2
a. Download the bzip2

$ wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
$ tar xzvf bzip2-1.0.6.tar.gz
$ cd bzip2-1.0.6

b. Compile bzip2

$ make -f Makefile-libbz2_so
$ make clean
$ make -n install PREFIX=/usr/local/R-3.4.2
$ make install PREFIX=/usr/local/R-3.4.2

Step 4: Compile liblzma or xz

$ wget http://tukaani.org/xz/xz-5.2.3.tar.gz --no-check-certificate
$ tar xzvf xz-5.2.3.tar.gz
$ cd xz-5.2.3
$ ./configure --prefix=/usr/local/xz-5.2.3
$ make -j8
$ make install

Step 5: Compile pcre-8.40

$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
$ tar xzvf pcre-8.40.tar.gz
$ ./configure --prefix=/usr/local/pcre-8.40
$ make -j 8
$ make install

Step 6: Compile libcurl-7.47.1

$ wget  https://curl.haxx.se/download/curl-7.47.1.tar.gz --no-check-certificate
$ tar xzvf curl-7.47.1.tar.gz
$ cd curl-7.47.1
$ ./configure --prefix=/usr/local/curl-7.47.1
$ make -j 8
$ make install

Step 7: Update CFLAGS and LDFLAGS

export CFLAGS="-I/usr/local/zlib-1.2.11/include -I/usr/local/bzip2-1.0.6/include -I/usr/local/xz-5.2.3/include -I/usr/local/pcre-8.40/include -I/usr/local/curl-7.47.1/include/curl"
export LDFLAGS="-L/usr/local/zlib-1.2.11/lib -L/usr/local/bzip2-1.0.6/lib -L/usr/local/xz-5.2.3/lib -L/usr/local/pcre-8.40/lib -L/usr/local/curl-7.47.1/lib"

Step 8: Compile R-3.4.2

$ ./configure --enable-utf8 --prefix=/usr/local/R-3.4.2
$ make -j 8
$ make install

References:

  1. Building R-devel on RedHat Linux 6

Compiling R-3.0.2 on CentOS 5

Do note that R-3.0.2 requires a higher version of gfortran 4.4.4 and above. To help ensure that the gfortran44 is installed, do check that the gnu44 are installed. For more information how to install, see Installing GNU 4.4 of C, C++ and gfortran for CentOS 5

Compiling R-3.0.2

# tar -zxvf 3.0.2.tar.gz 
# ./configure --prefix=/usr/local/R-3.0.2/ CC=gcc44 CXX=g++44 F77=gfortran44 FC=gfortran44
# make
# make install