Learn R Programming

RDML (version 0.8-3)

AsTable: Represents fields of RDML object as data.frame

Description

Represents specified fields of RDML object as data.frame to overview, filter or pass them to GetFData and SetFData functions.

Arguments

.default
list of default columns
name.pattern
expression to form fdata.name (see Examples)
...
additional columns

Details

By default input this function forms data.frame with such columns: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] You can overload default columns list by parameter .default but note that columns exp.id, run.id, react.id, target are necessary for usage AsTable output as input for GetFData and SetFData. Additional columns can be introduced by specifying them at input parameter ... (see Examples). All default and additional columns accession expressions have to be named!!! Experiment, run, react and data to which belongs each fluorescence data vector can be accessed by experiment, run, react, data (see Examples).

Examples

Run this code
## 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