본문 바로가기

R관련

R4.x 도커 파일 (dockerfile for R 4.x) 1. 개요 R은 파이썬과 함께 데이터 분석에서 많이 사용되는 언어이다. 문제는 라이브러리의 상호성 문제 등으로 골치가 아플 때가 있다. root계정으로 환경을 조작하다보면 우분투를 아예 밀어버리는게 나은 상황이 올 수도 있다. 따라서, 도커 환경에서 R을 구동하는게 적절할 것이다. 이를 위해 ubuntu 20.04의 도커에서 R 4.x 버전에서 생명정보학 (bioinformatics) 분석을 할 때 최소한 (?)으로 필요한 패키지들을 설치한다. # R 4.x를 구동하기 위한 도커파일임. FROM ubuntu:20.04 # 이상한 메세지 블락하기 ARG DEBIAN_FRONTEND=noninteractive # 필요 라이브러리 설치 시작 # Working directory 설정 WORKDIR /home #.. 더보기
[conda] R 4.2.0설치하기 conda create -n R4.2 python=3.10 conda activate R4.2 conda search r-base conda install -c conda-forge r-base=4.2.0 conda install -c conda-forge/label/gcc7 r-base=4.2.0 conda deactivate conda activate R4.2 R # 이렇게하면 R4.2가 나오는 것을 볼 수 있을 것이다. # devtools 설치 conda -c r r-devtools conda deactivate conda activate R4.2 #R 킨후 install.packages('processx') 더보기
DESEQ2 normalization Count normalization with DESeq2 | Introduction to DGE (hbctraining.github.io) Count normalization with DESeq2 Approximate time: 60 minutes Learning Objectives Explore different types of normalization methods Become familiar with the DESeqDataSet object Understand how to normalize counts using DESeq2 Normalization The first step in the DE analysis workflow is count hbctraining.githu.. 더보기
Hexbin scatter plot #' scatterPlot_with_Cor.test #' #' This function is to draw and perform correlation test #' Input vector should be presorted. #' @param x(default=NULL) : Input vector for x-axis #' @param y(default=NULL) : Input vector for y-axis #' @param xlab(default=NULL) : Label of x-axis #' @param ylab(default=NULL) : Label of y-axis #' @param title(default=NULL) : title #' @param cex.lab(default=1) : Size .. 더보기
sig_barplot #' Drawing sig barplot #' #' This function is to draw barplot with significant p.value code #' ks.test, t.test and wilcox.test are available. #' @param input_list (default=NULL) : Input list object with names. #' @param test_method (default='t.test',character) : Test option parameter. You can also use ks.test and wilcox.test. #' @param one.sided (default=F) : Whether p-values should be obtained .. 더보기
CMScaller https://github.com/peterawe/CMScaller peterawe/CMScaller Contribute to peterawe/CMScaller development by creating an account on GitHub. github.com The CMScaller package provides Consensus Molecular Subtype (CMS) classification of colorectal cancer pre-clinical models [Guinney 2015; Eide 2017; Sveen 2017]. A small ensembl of functions for evaluating and visualizing results is also included. The c.. 더보기
Efficient R coding-data formatting tidyr : spread, gather data.table : setkey, dt[,lapply(.SD,function(k){~~~}),by='col.names'] dplyr 더보기
survival analysis function #' survival analysis and get Log-rank p.value #' #' This function is to get Log-rank p-value and Kaplan-meier plot for survival analysis. #' @param class (default=NULL,factor) : Input vector, 1st row drug response, 2nd mutation #' @param survival_time (default=NULL,numeric) : Input vector, put them as numeric. #' @param status (default=NULL,numeric) : Input vector, 0(alive) or 1(dead) #' @param .. 더보기