CorrSample: Sample correlations for random pairs of genes

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/maCorrPlot.R

Description

CorrSample calculates the correlations, standard deviations and some auxiliary variables for random pairs of genes. A plot of the resulting object that shows that these correlations dependend systematically on the genes' variability, suggests a lack of normalization.

RandPairs is a helper function for generating random pairs from a list of genes.

Usage

1
2
3
CorrSample(x, np, seed, rp, ndx)

RandPairs(probes, number)

Arguments

x

a gene expression matrix, with samples as columns and genes as rows; missing values are accepted.

np, number

the number of random pairs

seed

an optional seed for the random sampling

rp

an optional matrix with two columns specifying the random pairs, see Details.

ndx

an optional logical matrix of the same dimension as x that allows to eliminate a subset of the expression values from the calculation of the correlations, standard deviations and auxiliary variables.

probes

a vector of genes from which to draw random pairs; can be integer, as a vector of row indices, or character, as a vector of row names.

Details

The sample of random pairs can be specified in a replicable manner either via np and seed, or by using the output from RandPairs for the parameter rp. In case we want to use the same set of random pairs (e.g. when comparing different expression measures on the same data set), the second option will be faster.

Value

An object of class corr.sample; this is just a data frame with an extra class tag to allow for a plotting method.

The data frame has np rows and nine columns:

Correlation

the correlation between the two genes across samples

StdDev

the geometric mean of the standard deviations of the two genes

sd1,sd2

the standard deviations of the genes

m1,m2

the means of the genes

ndx1,ndx2

the indices of the two genes; by default, these will be the corresponding row indices of x, but if rp is specified, they might be gene names.

Author(s)

Alexander Ploner Alexander.Ploner@ki.se

References

Ploner A, Miller LD, Hall P, Bergh J, Pawitan Y. Correlation test to assess low-level processing of high-density oligonucleotide microarray data. BMC Bioinformatics, 2005, 6(1):80 http://www.pubmedcentral.gov/articlerender.fcgi?tool=pubmed&pubmedid=15799785

See Also

plot.corr.sample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Get small example data
data(oligodata)
dim(datA.rma)

# Compute the correlations for 500 random pairs, 
# that is ca. 1/1000 of all possible pairs 
# Larger numbers are reasonable for larger data sets
cs1 = CorrSample(datA.rma, 500, seed=210)
cs1[1:5,]

# Clear correlation for pairs of genes with low average variability 
plot(cs1)

# A different way of specifying the same 
set.seed(210)
rp = RandPairs(rownames(datA.rma), 500)
cs2 = CorrSample(datA.rma, rp=rp)
cs2[1:5,]
plot(cs2)

maCorrPlot documentation built on Nov. 8, 2020, 5:06 p.m.