| Processor-class {PreProcess} | R Documentation |
Class "Processor"
Description
A Processor represents a function that acts on the data of a some
object to process it in some way. The result is always another related
object, which should record some history about exactly how it was processed.
Usage
## S4 method for signature 'Channel,Processor'
process(object, action, parameter=NULL)
## S4 method for signature 'Processor'
summary(object, ...)
Arguments
object |
In the |
action |
A |
parameter |
Any object that makes sense as a parameter to the
function represented by the |
... |
Additional arguments are as in the underlying generic methods. |
Value
The return value of the generic function process is always
an object related to its Channel input, which keeps a record
of its history. The precise class of the result depends on the
function used to create the Processor.
Slots
f:A function that will be used to process microarray-related object
default:The default value of the parameters to the function
fname:A string containing the name of the object
description:A string containing a longer description of the object
Methods
- process(object, action, parameter)
Apply the function represented by
actionto theChannelobject, updating the history appropriately. If theparameterisNULL, then use the default value.- summary(object, ...)
Write out a summary of the object.
Pre-defined Processors
The library comes with several Processor objects already
defined; each one takes a Channel as input and produces a
modified Channel as output.
PROC.SUBTRACTORSubtracts a global constant (default: 0) from the data vector in the
Channel.PROC.THRESHOLDTruncates the data vector below, replacing the values below a threshold (default: 0) with the threshold value.
PROC.GLOBAL.NORMALIZATIONNormalizes the data vector in the
Channelby dividing by a global constant. If the parameter takes on its default value of 0, then divide by the 75th percentile.PROC.LOG.TRANSFORMPerforms a log transformation of the data vector. The parameter specifies the base of the logarithm (default: 2).
PROC.MEDIAN.EXPRESSED.NORMALIZATIONNormalizes the data vector by dividing by the median of the expressed genes, where “expressed” is taken to mean “greater than zero”.
PROC.SUBSET.NORMALIZATIONNormalizes the data vector by dividing by the median of a subset of genes. When the parameter has a default value of 0, then this method uses the global median. Otherwise, the parameter should be set to a logical or numerical vector that selects the subset of genes to be used for normalization.
PROC.SUBSET.MEAN.NORMALIZATIONNormalizes the data vector by dividing by the mean of a subset of genes. When the parameter has a default value of 0, then this method uses the global mean. Otherwise, the parameter should be set to a logical or numerical vector that selects the subset of genes to be used for normalization.
Author(s)
Kevin R. Coombes krc@silicovore.com
See Also
Channel,
CompleteChannel,
process,
Pipeline
Examples
showClass("Processor")
## simulate a moderately realistic looking microarray
nc <- 100
nr <- 100
v <- rexp(nc*nr, 1/1000)
b <- rnorm(nc*nr, 80, 10)
s <- sapply(v-b, max, 1)
ct <- ChannelType('user', 'random', nc, nr, 'fake')
subbed <- Channel(name='fraud', parent='', type=ct, vec=s)
rm(ct, nc, nr, v, b, s) # clean some stuff
## example of standard data processing
nor <- process(subbed, PROC.GLOBAL.NORMALIZATION)
thr <- process(nor, PROC.THRESHOLD, 25)
processed <- process(thr, PROC.LOG.TRANSFORM, 2)
summary(processed)
par(mfrow=c(2,1))
plot(processed)
hist(processed)
par(mfrow=c(1,1))
image(processed)
rm(nor, thr, subbed, processed)