## internal dataset stepone_std.rdml (in 'data' directory)
## generated by Applied Biosystems Step-One. Contains qPCR data.
library(chipPCR)
PATH <- path.package("RDML")
filename <- paste(PATH, "/extdata/", "stepone_std.rdml", sep ="")
stepone <- RDML$new(filename)
## Mark fluorescense data which Cq > 30 and add quantities to
## AsTable output.
## Names for fluorescense data will contain sample name and react
## positions
tab <- stepone$AsTable(
name.pattern = paste(react$sample, react$position),
cq30 = if(data$cq >= 30) ">=30" else "<30",
quantity = as.factor(sample[[react$sample]]$quantity$value)
)
## Show cq30 and quantities
tab[c("cq30", "quantity")]
## Get fluorescence values for 'std' type samples
## in format ready for ggplot function
library(dplyr)
fdata <- stepone$GetFData(
filter(tab, sample.type == "std"),
long.table = TRUE)
## Plot fdata with colour by cq30 and shape by quantity
library(ggplot2)
ggplot(fdata, aes(x = cyc, y = fluo,
group = fdata.name,
colour = cq30,
shape = quantity)) +
geom_line() + geom_point()
Run the code above in your browser using DataLab