본문 바로가기

R관련/Rfunction

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 .. 더보기
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 .. 더보기
GSEA Enrichment Score calculation #' Calculate Enrichment score for GSEA plot#' #' This function is slightly modified from GSEA.1.0.R downloaded from msigDB.\cr#' Specific site address is below.\cr#' http://software.broadinstitute.org/gsea/msigdb/download_file.jsp?filePath=/resources/software/GSEA-P-R.1.0.zip\cr#' Original functions name are 'GSEA.EnrichmentScore' and 'GSEA.GeneRanking'\cr#' I combined two functions into single .. 더보기
scanning ks-test Scanning Kolmogorov-Smirnov statistic A modification to a Kolmogorov-Smirnov statistic, which we term a scanning ranked KS test, was used to determine which mutations alone or co-occurring combinations of mutation combinations can best predict a selective sensitivity to each unknown compound. In addition to single mutations, we also annotated a ‘RAS_Class’ metaclass in which we assigned a cell l.. 더보기
domain_annotation #------------------ # Protein domain annotation #------------------ domain_annot=function(pfam_id=c()){ if(is.null(pfam_id)){ print('pfam_id : input character vector for pfam_id') print('use biomart to get pfam id') print('try bellow') cat("ensembl=useMart(biomart='ensembl',dataset = 'hsapiens_gene_ensembl')\n") cat("tmp=getBM(attributes = c('hgnc_symbol','ensembl_peptide_id','pfam','pfam_start'.. 더보기
IC50, drc ic50=function( x=data.frame(),log=TRUE,base=10,plicated=2,sep="..",model=LL.4(),AUCmode='mean', file=NA,apch="T"){ if(nrow(x)==0&ncol(x)==0){ cat("Drug data is not available",sep='\n') cat("ic50(x, log, base, plicated, sep,model, AUCmode, file=apch)",sep='\n') cat("1. x : Drug numeric matrix 1st col should be dose concentration",sep='\n') cat(" from 2nd column, remaining columns should be drug r.. 더보기
multi_grep #-------------------- # Multi_grep #-------------------- multi_grep=function(input=c(),pattern=c(),ignore.case=T,fixed=F){ if(is.null(input)){ print('input : input character vector') print('pattern : pattern list character vector') print('ignore.case (default T) : same with ignore.case') print('Output will be unique list of sites') }else{ wh=c();for(j in 1:length(pattern)){ wh=c(wh,grep(input,pa.. 더보기