R: 'cytoSet': a class for storing raw data from a quantitative...
cytoSet-class
R Documentation
'cytoSet': a class for storing raw data from
a quantitative cell-based assay
Description
This class is a container for a set of
cytoFrame objects
Creating Objects
Objects can be created using the function
readCytoSet or via new('cytoSet', frames = ...., # environment with cytoFrames phenoData = .... # object of class phenoData colnames = .... # object of class character )
Slots
frames:
An environment
containing one or more cytoFrame objects.
phenoData:
A
phenoData. Each row
corresponds to one of the cytoFrames in the frames slot.
It is mandatory that the pData has column named name
colnames:
A character object with the
(common) column names of all the data matrices in the cytoFrames.
Methods
[, [[
subsetting. If x is cytoSet, then x[i]
returns a cytoSet object, and x[[i]] a cytoFrame
object. The semantics is similar to the behavior of the subsetting
operators for lists.
colnames, colnames<-
extract or replace the colnames slot.
phenoData, phenoData<-
extract or replace the phenoData slot.
show
display summary.
plot
Scatterplot of one or all (consecutively) cytoFrame
objects. The additional argument gate can be used to plot
subsets of the data defined by an object of class
gate or gateSet.
hist
Draw histogram of the data. The additional argument
variable can be used to subset to one variable prior to plotting.
Important note on storage and performance
The bulk of the data in a cytoSet object is stored in an
environment, and is therefore not
automatically copied when the cytoSet object is copied. If
x is an object of class cytoSet, then the code
y <- x
will create a an object y that contains
copies of the phenoData and
administrative data in x, but refers to the same
environment with the actual fluorescence data. See below for how to
create proper copies.
The reason for this is performance. The pass-by-value semantics of
function calls in R can result in numerous copies of the same
data object being made in the course of a series of nested function
calls. If the data object is large, this can result in a considerable
cost of memory and performance. cytoSet objects are intended to
contain experimental data in the order of hundreds of Megabytes,
which can effectively be treated as read-only: typical tasks
are the extraction of subsets and the calculation of summary statistics.
This is afforded by the design of the cytoSet
class: an object of that class contains a phenoData slot,
some administrative information, and a reference to an
environment with the fluorescence data; when it is copied, only the
reference is copied, but not the potentially large set of fluorescence
data themselves.
However, note that subsetting operations, such as
y <- x[i]
do create proper copies, including a copy of the appropriate part of the
fluorescence data, as it should be expected. Thus, to make a proper copy
of a cytoSetx, use
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(prada)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Loading required package: RColorBrewer
Loading required package: grid
Loading required package: rrcov
Loading required package: robustbase
Attaching package: 'robustbase'
The following object is masked from 'package:Biobase':
rowMedians
Scalable Robust Estimators with High Breakdown Point (version 1.3-11)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/prada/cytoSet-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: cytoSet-class
> ### Title: 'cytoSet': a class for storing raw data from a quantitative
> ### cell-based assay
> ### Aliases: cytoSet cytoSet-class [,cytoSet,ANY,missing,missing-method
> ### [[,cytoSet,ANY,missing-method [[<-,cytoSet-method show,cytoSet-method
> ### length,cytoSet-method pData,cytoSet-method colnames,cytoSet-method
> ### colnames<-,cytoSet-method phenoData,cytoSet-method
> ### phenoData<-,cytoSet,AnnotatedDataFrame-method
> ### plot,cytoSet,missing-method hist,cytoSet-method
> ### split,cytoSet,ANY,ANY-method split,cytoSet,ANY-method
> ### split,cytoSet-method
> ### Keywords: classes
>
> ### ** Examples
>
> cset<-readCytoSet(path=system.file("extdata", package="prada"),
+ pattern="[A-Z][0-9][0-9]$")
> cset
cytoSet object with 6 cytoFrames and colnames
FSC-H SSC-H FL1-H FL2-H FL3-H FL2-A FL4-H Time
> pData(cset)
name
1 fas-Bcl2-plate323-04-04.A01
2 fas-Bcl2-plate323-04-04.A02
3 fas-Bcl2-plate323-04-04.A03
4 fas-Bcl2-plate323-04-04.B01
5 fas-Bcl2-plate323-04-04.B02
6 fas-Bcl2-plate323-04-04.B03
> cset[[1]]
cytoFrame object with 2115 cells and 8 observables:
FSC-H SSC-H FL1-H FL2-H FL3-H FL2-A FL4-H Time
slot 'description' has 148 elements
> cset[["fas-Bcl2-plate323-04-04.A02"]]
cytoFrame object with 2400 cells and 8 observables:
FSC-H SSC-H FL1-H FL2-H FL3-H FL2-A FL4-H Time
slot 'description' has 148 elements
> cset["fas-Bcl2-plate323-04-04.A02"]
cytoSet object with 1 cytoFrames and colnames
FSC-H SSC-H FL1-H FL2-H FL3-H FL2-A FL4-H Time
> cset[1:3]
cytoSet object with 3 cytoFrames and colnames
FSC-H SSC-H FL1-H FL2-H FL3-H FL2-A FL4-H Time
>
> cset[[1]] <- exprs(cset[[1]])[1:100, ]
>
> ## Not run:
> ##D plot(cset[2])
> ## End(Not run)
>
>
>
>
>
>
> dev.off()
null device
1
>