View source: R/combineBlocks.R
combineBlocks | R Documentation |
Combine DataFrames of statistics computed separately for each block. This usually refers to feature-level statistics and sample-level blocks.
combineBlocks(
blocks,
ave.fields,
pval.field,
method,
geometric,
equiweight,
weights,
valid
)
blocks |
A list of DataFrames containing blockwise statistics. These should have the same number of rows and the same set of columns. |
ave.fields |
Character vector specifying the columns of |
pval.field |
String specifying the column of |
method |
String specifying how p-values should be combined, see |
geometric |
Logical scalar indicating whether the geometric mean should be computed when averaging |
equiweight |
Logical scalar indicating whether each block should be given equal weight. |
weights |
Numeric vector of length equal to |
valid |
Logical vector indicating whether each block is valid.
Invalid blocks are still stored in the |
A DataFrame containing all fields in ave.fields
and the p-values,
where each column is created by combining the corresponding block-specific columns.
A per.block
column is also reported, containing a DataFrame of the DataFrames of blockwise statistics.
Aaron Lun
This function is used in modelGeneVar
and friends, combineVar
and testLinearModel
.
library(scuttle)
sce <- mockSCE()
y1 <- sce[,1:100]
y1 <- logNormCounts(y1) # normalize separately after subsetting.
results1 <- modelGeneVar(y1)
y2 <- sce[,1:100 + 100]
y2 <- logNormCounts(y2) # normalize separately after subsetting.
results2 <- modelGeneVar(y2)
# A manual implementation of combineVar:
combineBlocks(list(results1, results2),
ave.fields=c("mean", "total", "bio", "tech"),
pval.field='p.value',
method='fisher',
geometric=FALSE,
equiweight=TRUE,
weights=NULL,
valid=c(TRUE, TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.