NanoStringRccSet-class | R Documentation |
The NanoStringRccSet
class extends the
ExpressionSet
class for NanoString Reporter Code Count
(RCC) data.
NanoStringRccSet(assayData,
phenoData = annotatedDataFrameFrom(assayData, byrow = FALSE),
featureData = annotatedDataFrameFrom(assayData, byrow = TRUE),
experimentData = MIAME(),
annotation = character(),
protocolData = annotatedDataFrameFrom(assayData, byrow = FALSE),
dimLabels = c("GeneName", "SampleID"),
signatures = SignatureSet(),
design = NULL,
...)
assayData |
A |
phenoData |
An |
featureData |
An |
experimentData |
An optional |
annotation |
A |
protocolData |
An |
dimLabels |
A |
signatures |
An optional |
design |
An optional one-sided formula representing the experimental
design based on columns from |
... |
Additional arguments for |
An S4 class containing NanoString Expression Level Assays
In addition to the standard ExpressionSet
accessor
methods, NanoStringRccSet
objects have the following:
extracts the data.frame
containing the
sample data, cbind(pData(object), pData(protocolData(object)))
.
extracts the sample data column names,
c(varLabels(object), varLabels(protocolData(object)))
.
extracts the column names to use as labels
for the features and samples in the autoplot
method.
replaces the dimLabels
of
the object
.
extracts the SignatureSet
of the object
.
replaces the
SignatureSet
of the object
.
extracts the matrix of computed signature scores.
extracts the one-sided formula representing
the experimental design based on columns from
phenoData
.
replaces the one-sided formula
representing the experimental design based on columns from
phenoData
.
returns the signature functions.
replaces the signature functions.
returns the signature groups.
replaces the signature groups.
When signatureScores = FALSE
, the marginal summaries of the
elt
assayData
matrix along either the
feature (MARGIN = 1
) or sample (MARGIN = 2
) dimension.
When signatureScores = TRUE
, the marginal summaries of the
elt
signatureScores
matrix along either the
signature (MARGIN = 1
) or sample (MARGIN = 2
) dimension.
When log2scale = FALSE
, the summary statistics are Mean, Standard
Deviation, Skewness, Excess Kurtosis, Minimum, First Quartile, Median,
Third Quartile, and Maximum.
When log2scale = TRUE
, the summary statistics are Geometric Mean
with thresholding at 0.5, Size Factor
(2^(`MeanLog2` - mean(`MeanLog2`))
), Mean of Log2 with
thresholding at 0.5, Standard Deviation of Log2 with thresholding at 0.5,
Minimum, First Quartile, Median, Third Quartile, and Maximum.
In addition to the standard ExpressionSet
subsetting
methods, NanoStringRccSet
objects have the following:
Subset the feature and sample
dimensions using the subset
and select
arguments
respectively. The subset
argument will be evaluated with
respect to the featureData
, while the
select
argument will be evaluated with respect to the
phenoData
and protocolData
.
Extracts the endogenous
barcode class feature subset of x
with optional additional
subsetting using subset
and select
.
Extracts the housekeeping
barcode class feature subset of x
with optional additional
subsetting using subset
and select
.
Extracts the negative
control barcode class feature subset of x
with optional additional
subsetting using subset
and select
.
Extracts the positive
control barcode class feature subset of x
with optional additional
subsetting using subset
and select
.
Extracts the feature subset
representing the controls of x
with optional additional
subsetting using subset
and select
.
Extracts the feature subset
representing the non-controls of x
with optional additional
subsetting using subset
and select
.
Extracts the feature subset
representing the genes in the signatures
of x
with
optional additional subsetting using subset
and select
.
Loop over
the feature (MARGIN = 1
) or sample (MARGIN = 2
) dimension
of assayDataElement(X, elt)
.
Loop
over the signature (MARGIN = 1
) or sample (MARGIN = 2
)
dimension of signatureScores(X, elt)
.
Split
X
by GROUP
column within featureData
,
phenoData
, or protocolData
and apply FUN
to each partition.
munge argument data
into a data.frame object for modeling and
visualization using the mapping
argument. Supplemental data can be
specified using the extradata
argument.
Similar to the
transform
generic in the base package, creates
or modifies one or more assayData
matrices based
upon name = value
pairs in ...
. The expressions in
...
are appended to the preprocessing list in
experimentData
, which can be extracted using the
preproc
method.
Evaluate expression expr
with
respect to assayData
,
featureData
, phenoData
,
and protocolData
;
c(as.list(assayData(data)), fData(data), sData(data))
.
the NanoStringRccSet
method for ggplot
.
Patrick Aboyoun
readNanoStringRccSet
,
writeNanoStringRccSet
,
ExpressionSet
# Create NanoStringRccSet from data files
datadir <- system.file("extdata", "3D_Bio_Example_Data",
package = "NanoStringNCTools")
rccs <- dir(datadir, pattern = "SKMEL.*\\.RCC$", full.names = TRUE)
rlf <- file.path(datadir, "3D_SolidTumor_Sig.rlf")
pheno <- file.path(datadir, "3D_SolidTumor_PhenoData.csv")
solidTumor <-
readNanoStringRccSet(rccs, rlfFile = rlf, phenoDataFile = pheno)
# Create a deep copy of a NanoStringRccSet object
deepCopy <- NanoStringRccSet(solidTumor)
all.equal(solidTumor, deepCopy)
identical(solidTumor, deepCopy)
# Accessing sample data and column names
head(sData(solidTumor))
svarLabels(solidTumor)
# Set experimental design
design(solidTumor) <- ~ BRAFGenotype + Treatment
design(solidTumor)
munge(solidTumor)
# Marginal summarizing of NanoStringRccSet assayData matrices
head(summary(solidTumor, 1)) # Marginal summaries along features
head(summary(solidTumor, 2)) # Marginal summaries along samples
# Subsetting NanoStringRccSet objects
# Extract the positive controls for wildtype BRAF
dim(solidTumor)
dim(subset(solidTumor, CodeClass == "Positive", BRAFGenotype == "wt/wt"))
# Extract by barcode class
with(solidTumor, table(CodeClass))
with(endogenousSubset(solidTumor), table(CodeClass))
with(housekeepingSubset(solidTumor), table(CodeClass))
with(negativeControlSubset(solidTumor), table(CodeClass))
with(positiveControlSubset(solidTumor), table(CodeClass))
with(controlSubset(solidTumor), table(CodeClass))
with(nonControlSubset(solidTumor), table(CodeClass))
# Looping over NanoStringRccSet assayData matrices
log1pCoefVar <- function(x){
x <- log1p(x)
sd(x) / mean(x)
}
# Log1p Coefficient of Variation along Features
head(assayDataApply(solidTumor, 1, log1pCoefVar))
# Log1p Coefficient of Variation along Samples
head(assayDataApply(solidTumor, 2, log1pCoefVar))
# Transforming NanoSetRccSet assayData matrices
# Subtract max count from each sample
# Create log1p transformation of adjusted counts
thresh <- assayDataApply(negativeControlSubset(solidTumor), 2, max)
solidTumor2 <-
transform(solidTumor,
negCtrlZeroed = sweep(exprs, 2, thresh),
log1p_negCtrlZeroed = log1p(pmax(negCtrlZeroed, 0)))
assayDataElementNames(solidTumor2)
# Evaluating expression using NanoStringRccSet data
meanLog1pExprs <-
with(solidTumor,
{
means <- split(apply(exprs, 1, function(x) mean(log1p(x))), CodeClass)
means <- means[order(sapply(means, median))]
boxplot(means, horizontal = TRUE)
means
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.