plotLinear: Plot linear model for sequins

Description Usage Arguments Details Value Author(s) Examples

View source: R/plotLinear.R

Description

Create linear model for sequins, between input concentation on the x-axis and measurment on the y-axis.

Usage

1
2
plotLinear(seqs, x, y, std, title, xlab, ylab, showSD, showLOQ, showStats,
           xBreaks, yBreaks, errors, showLinear, showAxis)

Arguments

seqs

Sequin names

x

Input concentration on the x-axis

y

Measurement on the y-axis

std

Standard deviation. (Default to NULL).

title

Label of the plot. (Default to NULL).

xlab

Label for the x-axis. (Default to NULL).

ylab

Label for the y-axis. (Default to NULL).

xBreaks

Breaks for the x-axis. (Default to NULL).

yBreaks

Breaks for the y-axis. (Default to NULL).

showSD

Display vertical standard deviation bars. (Default to FALSE).

showLOQ

Display limit-of-quantification? Default to TRUE.

showStats

Display regression statistics? Default to TRUE.

errors

How errors bar should be calculated. SD or Range.

showLinear

Display regression line. (Default to TRUE).

showAxis

Display x-axis and y-axis. (Default to TRUE).

Details

The plotLinear function plots a scatter plot with input concentration on the x-axis, and measurement on the y-axis. The input concentration is typically the concentration level in ladder mixture, although other measures (such as expected copy number) are also possible. The function builds a linear regression between the two variables, and reports associated statistics (R2, correlation and regression parameters) on the plot.

The function also estimates limit-of-quantification (LOQ) breakpoint, and reports it on the plot if found. LOQ is defined as the lowest empirical detection limit, a threshold value beyond which stochastic behavior occur. LOQ is estimated by fitting segmented linear regression with two segments on the entire data set, while minimizing the total sum of squares of the differences between the variables.

Value

The function prints a scatter plot and return it's LOQ statistics.

Author(s)

Ted Wong [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(Anaquin)

#
# Data set generated by Cufflinks and Anaquin. described in Section 5.4.6.3 of
# the user guide.
#
data(UserGuideData_5.4.6.3)

title <- 'Gene Expression'
xlab  <- 'Input Concentration (log2)'
ylab  <- 'FPKM (log2)'

# Sequin names
seqs <- row.names(UserGuideData_5.4.6.3)

# Input concentration
x <- log2(UserGuideData_5.4.6.3$Input)

# Measured FPKM
y <- log2(UserGuideData_5.4.6.3[,2:4])

plotLinear(seqs, x, y, title=title, xlab=xlab, ylab=ylab, showLOQ=TRUE)

Anaquin documentation built on Nov. 17, 2017, 1:02 p.m.