R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R是自由软件,不带任何担保。 在某些条件下你可以将其自由散布。 用'license()'或'licence()'来看散布的详细条件。 R是个合作计划,有许多人为之做出了贡献. 用'contributors()'来看合作者的详细情况 用'citation()'会告诉你如何在出版物中正确地引用R或R程序包。 用'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或 用'help.start()'通过HTML浏览器来看帮助文件。 用'q()'退出R. > > ss <- function(TP,TN,FP,FN,bet=1){ + if (is.na(TP)) TP=0 + if (is.na(TN)) TN=0 + if (is.na(FP)) FP=0 + if (is.na(FN)) FN=0 + sen=TP/(TP+FN) + spe=TN/(TN+FP) + pre=TP/(TP+FP) + f = (1+bet^2)*pre*sen/(bet^2*pre+sen) + return(c(sen,spe,pre,f)) + } > > log_up <- function(x){ + ids = which(x<=0) + x[ids] = 0.0000001 + return(log10(x)) + } > library(ggplot2) > > args = (commandArgs(trailingOnly = T)) > print (args) [1] "finput=\"giremi_out\"" "fout=\"giremi_out.res\"" > for (i in 1:length(args)){ + eval(parse(text=args[[i]])) + } > > #dat <- read.table(file=finput,header=F,row.names=1,comment.char="") > dat <- read.table(file=finput,header=T,comment.char="") > rownames(dat) = paste(dat[,"chr"],dat[,"coor"],dat[,"strand"],sep="|") > dat = cbind(dat,0) > colnames(dat) <- c("chr","coordinate","strand","ifSNP","gene","reference_base","upstream_1base","downstream_1base","major_base","major_count","tot_count","major_ratio","if_MI","MI","pvalue_MI","estimated_allelic_ratio","ifNEG","if_GLM","pvalue_GLM","RNAE_t","A","C","G","T","ifRNAE") > ids = which(dat[,"major_base"]=="N") > if (length(ids)>0) dat = dat[-ids,] > dat[rownames(subset(dat,pvalue_MI>0 & pvalue_MI<=0.05 & ifSNP==0)),"ifRNAE"]= 1 > dat.pos <- subset(dat, pvalue_MI>0 & pvalue_MI <= 0.01 & ifSNP==0 & RNAE_t == "AG") > if (nrow(dat.pos)==0){ + dat.pos <- subset(dat, pvalue_MI>0 & pvalue_MI <= 0.05 & ifSNP==0 & RNAE_t == "AG") + } > dat.neg <- subset(dat,ifNEG == 1) > #dat.neg <- subset(dat,ifNEG == 1 & RNAE_t=="AG") > dat.unknown = subset(dat,ifRNAE==0 & ifSNP ==0 & RNAE_t=="AG") > > dat.pos <- cbind(dat.pos[,c("upstream_1base","downstream_1base")],abs(dat.pos[,"major_ratio"]-dat.pos[,"estimated_allelic_ratio"]),1) Error in data.frame(..., check.names = FALSE) : 参数值意味着不同的行数: 0, 1 Calls: cbind -> cbind -> data.frame 停止执行