Install R4 on ubuntu20

It has to be said that the version updates of various software systems are now so fast!

Generally speaking, the newly installed ubuntu system is too clean, lack a lot of library files, the following code runs first!

sudo apt install --fix-missing libcurl4-openssl-dev libxml2-dev libgdal-dev libssl-dev libglu1-mesa-dev libmagick++-dev libudunits2-dev 

sudo apt install -y libcurl4-gnutls-dev
sudo apt install -y  libxml2-dev
sudo apt install -y  openssl 
sudo apt install -y  libssl-dev

Install the latest version of R language

Use root privileges (system administrator) to install the latest version of R. Our ubuntu is 20, so ** choose the code name focal, and then cran40**, the entire code is as follows:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://mirrors.ustc.edu.cn/CRAN/bin/linux/ubuntu focal-cran40/'
sudo apt update
sudo apt install r-base

In fact, you need to install some R packages with root privileges (system administrator).

Install some R packages

Here we use root privileges (system administrator): sudo R

options()$repos 
options()$BioC_mirror
# options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/")options(BioC_mirror="http://mirrors.tuna.tsinghua.edu.cn/bioconductor/")options("repos"=c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))options()$repos 
options()$BioC_mirror

# https://bioconductor.org/packages/release/bioc/html/GEOquery.html
if(!requireNamespace("BiocManager", quietly = TRUE))
 install.packages("BiocManager")
BiocManager::install("KEGG.db",ask = F,update = F)

Generally speaking, no error will be reported, and then continue to install more packages:

BiocManager::install(c("GSEABase","GSVA","clusterProfiler"),ask = F,update = F)
BiocManager::install(c("GEOquery","limma","impute"),ask = F,update = F)
BiocManager::install(c("org.Hs.eg.db","hgu133plus2.db"),ask = F,update = F)options()$repos
install.packages('WGCNA')
install.packages(c("FactoMineR","factoextra"))
install.packages(c("ggplot2","pheatmap","ggpubr"))library("FactoMineR")library("factoextra")library(GSEABase)library(GSVA)library(clusterProfiler)library(ggplot2)library(ggpubr)library(hgu133plus2.db)library(limma)library(org.Hs.eg.db)library(pheatmap)

BiocManager::install("ChAMP")

I have to say that some R packages are really difficult to install, and I spent an afternoon, such as ChAMP, a methylation chip data processing package, as follows;

My blank ubuntu system, after all the above codes are run, there are 327 packages:

( base) jmzeng@biotrainee:/usr/local/lib/R/site-library$ du -h -d 1|tail
404 K ./ruv
3.2 M ./biovizBase
4.5 M ./colorspace
1.8 M ./prettydoc
444 K ./lazyeval
392 K ./statmod
5.2 M ./WGCNA
156 K ./generics
8.0 M ./urltools
2.9 G .

Configure network services (optional)

sudo apt install  -y nginx curl

At the same time, you need to set the permissions of the /var/www/html folder, that is, you need to add a www-data user group, and all the users contained in it can access it.

sudo chgrp -R www-data /var/www
sudo usermod -a -G www-data  jmzeng
# sudo usermod -a -G www-data  ubuntu
sudo chmod -R 2770/var/www/html  

At the same time, you also need to manage the port of ubuntu. After Nginx is installed, the IP can be opened in the browser in theory, but it requires the opening of the web port 80.

Ufw is a host-side iptables firewall configuration tool

sudo ufw enable #Open firewall
sudo ufw allow 80 ##Open port
sudo ufw status ###View firewall status
sudo ufw allow 8787 ##Open port

Only open the port on the server side.

Install rstudio-server

Reference: https://rstudio.com/products/rstudio/download-server/debian-ubuntu/

Be sure to see the version of the ubuntu system!

sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.3.1056-amd64.deb
sudo gdebi rstudio-server-1.3.1056-amd64.deb

On this version, I wasted at least two hours. Install shiny and rsutdio server, find the latest version on the official website

Find the address by yourself!

Configure shiny permissions (optional)

This, basically only if you really need to develop your own web tools, you can use it!

sudo systemctl restart shiny-server

You may need to restart frequently, check the port opening after the installation is successful: netstat -tln

Configure user groups:

sudo groupadd shiny
sudo chgrp -R shiny  /srv/shiny-server/
sudo usermod -a -G shiny jmzeng  

Some self-developed web gadgets can be stored in the /srv/shiny-server/ directory.

sudo chmod -R 2775/srv/shiny-server/
cd /srv/shiny-server/
mkdir -p plot123
cd plot123
mkdir lineplot dotplot scatterplot boxplot barplot histplot pieplot density
mkdir violinplot qqplot errorplot 
mkdir veen upsetr heatmap circos volcano
mkdir genestructure 
 
cd /srv/shiny-server/ 
mkdir analysis 
cd analysis
mkdir deg det deu enrich gsea gsva wgcna timeseries pca tsne 
mkdir kmsurvival cox forest 

cd /srv/shiny-server/
mkdir database
cd database
mkdir tcga icgc ccle gtex encode roadmap 
mkdir ncbi ucsc ensembl 

cd /srv/shiny-server/
mkdir paper 
cd paper  

Recommended Posts

Install R4 on ubuntu20
How to install R on Ubuntu 20.04
install vscode on ubuntu18
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
Install docker on Ubuntu
Install Docker on ubuntu18.04
Install nodejs10 on Ubuntu16
Install mysql on Ubuntu 14.04
Install Django on ubuntu
Install Pytorch+CUDA on Ubuntu 16.04
Install Python3 on Ubuntu 14.04
Install rJava on Ubuntu18
Install JDK10+ on Ubuntu
Install Python3 on Ubuntu 16.04
Install KDE on Ubuntu16.04.2
Install Docker on Ubuntu18
Install Python3.7 on Ubuntu
Install flashplayer on Ubuntu
Install R package on UBUNTU virtual machine
Docker practice (1): install Docker on Ubuntu 16.04
Install gsl package in R language on ubuntu
Install ubuntu on virtual machine
Install OpenSSL 1.0.2 on Ubuntu Server 14.04
Install QQ robot on Ubuntu 16.04
How to install R on Ubuntu 18.04 [Quick Start]
Install Python 3.7 on Ubuntu 18.04 LTS
Install Android Studio on Ubuntu
Install scrapy framework on ubuntu
Install Mysql offline on Ubuntu
Install Oracle Java8 on Ubuntu
Install Odoo 11 stack on Ubuntu 16.04
Install Go locale on Ubuntu16
Install common software on Ubuntu 16.04
Install non-portable QQ on ubuntu
Install Docker on Ubuntu 18.04 offline
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install MySQL on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install R on CentOS 8
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
Install Tenda u12 driver on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install MySQL on Ubuntu 20.04
Install and configure MySQL on Ubuntu
Install Chef server workstation on Ubuntu 18.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
Install botan2 encryption library on ubuntu
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
Install 3 single-cell R packages under Ubuntu
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04