Installing BioConductor and seqinR, Biostrings, and GenomicRanges in R/R Studio on Linux

BioConductor is a package to analyze the huge genomic data. To install BioConductor run the following command in the R terminal (see here):

if (!requireNamespace("BiocManager", quietly = TRUE))
BiocManager::install(version = "3.12")

After installing the BiocManager we’ll installing some of it’s packages like ade4, seqinr, Biostrings, and GenomicRanges. But, before installing these packages you might run into some installing issues on linux, so run the following commands to install all the dependencies

$ sudo apt-get update
$ sudo apt-get install libblas-dev liblapack-dev libgfortran-8-dev

Now, run the following command to install the packages. Also, note that seqinr depends on the ade4 package, so it must be installed first:

BiocManager::install(c(“ade4”, “seqinR”, “Biostrings”, “GenomicRanges”))

If you get the following error in the terminal:

/usr/bin/ld: cannot find -lgfortran

Then run the following command and try the installing again. Also, make sure to look for the libgfortran file in the usr/lib/x86_64-linux-gnu and use the following command accordingly:

$ sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/

That’s it. You should have installed the above packages successfully and if you are facing any issues installing any packages look in the terminal most of the time a package cannot be installed because of some other package which it is dependent on.

A Graduate student, Full-Stack Developer and open-source contributor.