Learn R Programming

CNPBayes (version 1.2.2)

collapseBatch: Estimate batch from a collection of chemistry plates or some other variable that captures the time in which the arrays were processed.

Description

In high-throughput assays, low-level summaries of copy number at copy number polymorphic loci (e.g., the mean log R ratio for each sample, or a principal-component derived summary) often differ between groups of samples due to technical sources of variation such as reagents, technician, or laboratory. Technical (as opposed to biological) differences between groups of samples are referred to as batch effects. A useful surrogate for batch is the chemistry plate on which the samples were hybridized. In large studies, a Bayesian hierarchical mixture model with plate-specific means and variances is computationally prohibitive. However, chemistry plates processed at similar times may be qualitatively similar in terms of the distribution of the copy number summary statistic. Further, we have observed that some copy number polymorphic loci exhibit very little evidence of a batch effect, while other loci are more prone to technical variation. We suggest combining plates that are qualitatively similar in terms of the Kolmogorov-Smirnov two-sample test of the distribution and to implement this test independently for each candidate copy number polymophism identified in a study. The collapseBatch function is a wrapper to the ks.test implemented in the stats package that compares all pairwise combinations of plates. The ks.test is performed recursively on the batch variables defined for a given CNP until no batches can be combined.

Usage

collapseBatch(object, plate, THR = 0.1)
"collapseBatch"(object)
"collapseBatch"(object, plate, THR = 0.1)
"collapseBatch"(object, plate, THR = 0.1)

Arguments

object
see showMethods(collapseBatch)
plate
a vector labelling from which batch each observation came from.
THR
threshold below which the null hypothesis should be rejected and batches are collapsed.

Value

The new batch value.

Examples

Run this code
bt <- collapseBatch(y(BatchModelExample), batch(BatchModelExample))
newBatchModel <- BatchModel(y(BatchModelExample), k(BatchModelExample),
                            bt, hyperParams(BatchModelExample),
                            mcmcParams(BatchModelExample))

Run the code above in your browser using DataLab