## ------------------------------------------------------------------------ library('Anaquin') data(mixtureA) head(mixtureA) ## ------------------------------------------------------------------------ set.seed(1234) sim1 <- 1.0 + 1.2*log2(mixtureA$MXA) + rnorm(nrow(mixtureA),0,1) sim2 <- c(1.0 + rnorm(100,1,3), 1.0 + 1.2*log2(tail(mixtureA,64)$MXA) + rnorm(64,0,1)) ## ---- message=FALSE, results='hide', fig.align='center'------------------ names <- row.names(mixtureA) input <- log2(mixtureA$MXA) anaquin <- AnaquinData(analysis='PlotLinear', seqs=names, input=input, measured=sim1) title <- 'Isoform expression (Good)' xlab <- 'Input concentration (log2)' ylab <- 'Measured FPKM (log2)' plotLinear(anaquin, title=title, xlab=xlab, ylab=ylab) ## ---- message=FALSE, results='hide', fig.align='center'------------------ names <- row.names(mixtureA) input <- log2(mixtureA$MXA) anaquin <- AnaquinData(analysis='PlotLinear', seqs=names, input=input, measured=sim2) title <- 'Isoform expression (Bad)' xlab <- 'Input concentration (log2)' ylab <- 'Measured FPKM (log2)' plotLinear(anaquin, title=title, xlab=xlab, ylab=ylab) ## ------------------------------------------------------------------------ data(UserGuideData_5.4.5.1) head(UserGuideData_5.4.5.1) ## ---- message=FALSE, results='hide', fig.align='center'------------------ title <- 'Assembly Plot' xlab <- 'Input Concentration (log2)' ylab <- 'Sensitivity' # Sequin names names <- row.names(UserGuideData_5.4.5.1) # Input concentration input <- log2(UserGuideData_5.4.5.1$InputConcent) # Measured sensitivity measured <- UserGuideData_5.4.5.1$Sn anaquin <- AnaquinData(analysis='PlotLogistic', seqs=names, input=input, measured=measured) plotLogistic(anaquin, title=title, xlab=xlab, ylab=ylab, showLOA=TRUE) ## ------------------------------------------------------------------------ data(UserGuideData_5.4.6.3) head(UserGuideData_5.4.6.3) ## ---- message=FALSE, fig.align='center'---------------------------------- title <- 'Gene Expression' xlab <- 'Input Concentration (log2)' ylab <- 'FPKM (log2)' # Sequin names names <- row.names(UserGuideData_5.4.6.3) # Input concentration input <- log2(UserGuideData_5.4.6.3$InputConcent) # Measured FPKM measured <- log2(UserGuideData_5.4.6.3$Observed1) anaquin <- AnaquinData(analysis='PlotLinear', seqs=names, input=input, measured=measured) plotLinear(anaquin, title=title, xlab=xlab, ylab=ylab, showLOQ=TRUE) ## ---- message=FALSE, fig.align='center'---------------------------------- title <- 'Gene Expression' xlab <- 'Input Concentration (log2)' ylab <- 'FPKM (log2)' # Sequin names names <- row.names(UserGuideData_5.4.6.3) # Input concentration input <- log2(UserGuideData_5.4.6.3$InputConcent) # Measured FPKM measured <- log2(UserGuideData_5.4.6.3[,2:4]) anaquin <- AnaquinData(analysis='PlotLinear', seqs=names, input=input, measured=measured) plotLinear(anaquin, title=title, xlab=xlab, ylab=ylab, showLOQ=TRUE) ## ------------------------------------------------------------------------ data(UserGuideData_5.6.3) head(UserGuideData_5.6.3) ## ---- fig.align='center'------------------------------------------------- title <- 'Gene Fold Change' xlab <- 'Expected fold change (log2)' ylab <- 'Measured fold change (log2)' # Sequin names names <- row.names(UserGuideData_5.6.3) # Expected log-fold input <- UserGuideData_5.6.3$ExpLFC # Measured log-fold measured <- UserGuideData_5.6.3$ObsLFC anaquin <- AnaquinData(analysis='PlotLinear', seqs=names, input=input, measured=measured) plotLinear(anaquin, title=title, xlab=xlab, ylab=ylab, showAxis=TRUE, showLOQ=FALSE) ## ---- fig.align='center'------------------------------------------------- title <- 'ROC Plot' # Sequin names names <- row.names(UserGuideData_5.6.3) # Expected ratio ratio <- UserGuideData_5.6.3$ExpLFC # How the ROC points are ranked (scoring function) score <- 1-UserGuideData_5.6.3$Pval # Classified labels (TP/FP) label <- UserGuideData_5.6.3$Label anaquin <- AnaquinData(analysis='PlotROC', seqs=names, ratio=ratio, score=score, label=label) plotROC(anaquin, title=title, refRats=0) ## ---- fig.align='center'------------------------------------------------- xlab <- 'Average Counts' ylab <- 'P-value' title <- 'LODR Curves' # Sequin names names <- row.names(UserGuideData_5.6.3) # Measured mean measured <- UserGuideData_5.6.3$Mean # Expected log-fold ratio <- UserGuideData_5.6.3$ExpLFC # P-value pval <- UserGuideData_5.6.3$Pval # Q-value qval <- UserGuideData_5.6.3$Qval anaquin <- AnaquinData(analysis='PlotLODR', seqs=names, measured=measured, ratio=ratio, pval=pval, qval=qval) plotLODR(anaquin, xlab=xlab, ylab=ylab, title=title, FDR=0.1)