| Title: | Shrinkage Covariance Estimation with Prior Knowledge |
|---|---|
| Description: | Estimates shrinkage covariance matrices from data using user-selected targets, including diagonal, constant-correlation, and knowledge-based targets informed by functional gene groups. The shrinkage intensity is computed analytically. |
| Authors: | Vincent Guillemot [aut, cre], Monika Jelizarow [aut] |
| Maintainer: | Vincent Guillemot <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 2.1.0 |
| Built: | 2026-10-15 11:20:08 UTC |
| Source: | https://github.com/vguillemot/ship |
Start with build.target to construct a target matrix, then
pass it to shrink.estim together with the data matrix.
Monika Jelizarow and Vincent Guillemot
J. Schaefer and K. Strimmer, 2005. A shrinkage approach to large-scale covariance matrix estimation and implications for functional genomics. Statist. Appl. Genet. Mol. Biol. 4:32.
M. Jelizarow, V. Guillemot, A. Tenenhaus, K. Strimmer, A.-L. Boulesteix, 2010. Over-optimism in bioinformatics: an illustration. Bioinformatics. Accepted.
Useful links:
data("expl") target <- build.target(expl$x, expl$genegroups, type = "G") estimate <- shrink.estim(expl$x, target) estimate$lambdadata("expl") target <- build.target(expl$x, expl$genegroups, type = "G") estimate <- shrink.estim(expl$x, target) estimate$lambda
The function build.target() is a wrapper function to build the various types
of covariance targets: diagonal ("D"), constant correlation ("F"),
knowledge based ("G", "Gpos", and "Gstar"), correlation ("cor").
build.target(x, genegroups = NULL, type)build.target(x, genegroups = NULL, type)
x |
An |
genegroups |
List of the groups each gene belongs to: each entry of the
list is dedicated to a gene (identified the same way as in |
type |
Character string specifying the wished target: "D" for a diagonal target, "cor" for a correlation target, "G", "Gpos" and "Gstar" for a G-type target (see Jelizarow et al, 2010) and "F" for a F-target. |
A target covariance matrix of a certain
type.
Vincent Guillemot
M. Jelizarow, V. Guillemot, A. Tenenhaus, K. Strimmer, A.-L. Boulesteix, 2010. Over-optimism in bioinformatics: an illustration. Bioinformatics. Accepted.
targetCor, targetD,
targetF, targetG, targetGpos,
targetGstar,.
Other main functions:
shrink.estim()
# Simulate dataset x <- matrix(rnorm(20*30), 20, 30) # Try different targets build.target(x, type = "D")# Simulate dataset x <- matrix(rnorm(20*30), 20, 30) # Try different targets build.target(x, type = "D")
Takes as arguments two vectors of IDs and test whether they have a common ID.
check.path(p1, p2)check.path(p1, p2)
p1 |
Vector of pathways that gene 1 belongs to. |
p2 |
Vector of pathways that gene 2 belongs to. |
Return 0 if the two genes don't belong to a common pathway, return 1
otherwise. This function is used by target.help.
Monika Jelizarow and Vincent Guillemot
g1 <- c("path1","path2","path3","path4") g2 <- c("path5","path6","path3","path11") g3 <- c("path10","path5","path12","path13") check.path(g1, g2) # 1 check.path(g1, g3) # 0g1 <- c("path1","path2","path3","path4") g2 <- c("path5","path6","path3","path11") g3 <- c("path10","path5","path12","path13") check.path(g1, g2) # 1 check.path(g1, g3) # 0
The microarray data set is the study on the prostate cancer by Singh et al. The collection of the microarray is hgu95av2, and the gene groups are thus given by the information in the hgu95av2.db Bioconductor library (see Carlson et al.).
data("expl")data("expl")
The dataset is a list containing:
a matrix of 100 genes randomly chosen from the data set of
Singh et al.,
a list ‘genegroups’ containing 100 vectors of KEGG pathway IDs (which each gene belongs to).
M. Carlson, S. Falcon, H. Pages, N. Li. hgu95av2.db: Affymetrix Human Genome U95 Set annotation data (chip hgu95av2). R package version 2.2.12.
D. Singh, P. G. Febbo, K. Ross, D. G. Jackson, J. Manola, C. Ladd, P. Tamayo, A. A. Renshaw, A. V. D'Amico, J. P. Richie, E. S. Lander, M. Loda, P. W. Kantoff, T. R. Golub, W. R. Sellers, 2002. Gene expression correlates of clinical prostate cancer behavior. Cancer Cell, Department of Adult Oncology, Brigham and Women's Hospital, Harvard Medical School, Boston, MA 02115, USA., 1, 203-209.
The estimator combines the sample covariance matrix with a
target matrix :
The estimated intensity is constrained to
. Values near zero keep more of the sample covariance;
values near one give more weight to the target.
shrink.estim(x, target)shrink.estim(x, target)
x |
A |
target |
A |
A list with components shrink.cov, the estimated covariance
matrix, and lambda, the estimated shrinkage intensity.
Monika Jelizarow and Vincent Guillemot
J. Schaefer and K. Strimmer, 2005. A shrinkage approach to large-scale covariance matrix estimation and implications for functional genomics. Statist. Appl. Genet. Mol. Biol. 4:32. Jelizarow, M., Guillemot, V., Tenenhaus, A., Strimmer, K. and Boulesteix, A.-L. (2010). Over-optimism in bioinformatics: an illustration. Bioinformatics.
Other main functions:
build.target()
# Simulate dataset x <- matrix(rnorm(20*30),20,30) # Try different targets shrink.estim(x, target = build.target(x, type = "D"))# Simulate dataset x <- matrix(rnorm(20*30),20,30) # Try different targets shrink.estim(x, target = build.target(x, type = "D"))
This function transforms a list of (one vector of pathway IDs per
gene) groups into a binary matrix.
target.help(genes)target.help(genes)
genes |
List of |
A binary matrix: the coefficient (i,j) is 1
if genes i and j belong to a common pathway and 0 otherwise.
Monika Jelizarow and Vincent Guillemot
targetF,targetG,targetGpos,
targetGstar.
g1 <- c("path1", "path2", "path3", "path4") g2 <- c("path5", "path6", "path3", "path11") g3 <- c("path10", "path5", "path12", "path13") target.help(list(g1, g2, g3))g1 <- c("path1", "path2", "path3", "path4") g2 <- c("path5", "path6", "path3", "path11") g3 <- c("path10", "path5", "path12", "path13") target.help(list(g1, g2, g3))
The target Cor is computed from the data matrix. It it a modified version of target G. In particular,
it tests the correlations (with a significance level of 0.05) and sets the
non-significant correlations to zero before the mean correlation
is computed.
targetCor(x, genegroups)targetCor(x, genegroups)
x |
A |
genegroups |
A list of genes obtained using the database KEGG, where each entry itself is a list of pathway names this genes belongs to. If a gene does not belong to any gene functional group, the entry is NA. |
For retained linked pairs, the off-diagonal target is
where is the mean correlation among links
whose correlation test p-value is below 0.05.
A matrix.
Monika Jelizarow and Vincent Guillemot
Other covariance targets:
targetD(),
targetF(),
targetG(),
targetGpos(),
targetGstar()
# A short example on a toy dataset # require(SHIP) data(expl) target_matrix <- targetCor(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !# A short example on a toy dataset # require(SHIP) data(expl) target_matrix <- targetCor(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !
The target keeps the sample variances and sets all covariances to zero. If
is the sample covariance matrix, the target
is
targetD(x, genegroups = NULL)targetD(x, genegroups = NULL)
x |
A |
genegroups |
The genegroups are not used for this target. |
A diagonal matrix.
Monika Jelizarow and Vincent Guillemot
Other covariance targets:
targetCor(),
targetF(),
targetG(),
targetGpos(),
targetGstar()
x <- matrix(rnorm(10*30),10,30) target_matrix <- targetD(x, NULL)x <- matrix(rnorm(10*30),10,30) target_matrix <- targetD(x, NULL)
The target keeps the sample variances and replaces every off-diagonal
correlation by their average. If is the
sample covariance matrix and is the mean sample
correlation, then
targetF(x, genegroups = NULL)targetF(x, genegroups = NULL)
x |
A |
genegroups |
The genegroups are not used for this target. |
A matrix.
Monika Jelizarow and Vincent Guillemot
Other covariance targets:
targetCor(),
targetD(),
targetG(),
targetGpos(),
targetGstar()
# A short example on a toy dataset # require(SHIP) data(expl) target_matrix <- targetF(expl$x, NULL) which(target_matrix[upper.tri(target_matrix)] != 0) # many non zero coefficients !# A short example on a toy dataset # require(SHIP) data(expl) target_matrix <- targetF(expl$x, NULL) which(target_matrix[upper.tri(target_matrix)] != 0) # many non zero coefficients !
This target applies the constant-correlation model only to pairs of genes
that share a functional group. Let be the
binary group matrix and let be the mean correlation
among linked pairs. Then
where means that genes and
share a functional group. Unlinked off-diagonal entries are zero.
targetG(x, genegroups)targetG(x, genegroups)
x |
A |
genegroups |
A list of genes obtained using the database KEGG, where each entry itself is a list of pathway names this genes belongs to. If a gene does not belong to any gene functional group, the entry is NA. |
A matrix.
Monika Jelizarow and Vincent Guillemot
Other covariance targets:
targetCor(),
targetD(),
targetF(),
targetGpos(),
targetGstar()
# require(SHIP) data(expl) target_matrix <- targetG(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !# require(SHIP) data(expl) target_matrix <- targetG(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !
This is a version of targetG() that estimates the common correlation from
positive linked correlations only. Negative linked correlations contribute
zero to the off-diagonal target.
for linked pairs with positive correlation, where
is their mean positive correlation.
targetGpos(x, genegroups)targetGpos(x, genegroups)
x |
A |
genegroups |
A list of genes obtained using the database KEGG, where each entry itself is a list of pathway names this genes belongs to. If a gene does not belong to any gene functional group, the entry is NA. |
A matrix.
Monika Jelizarow and Vincent Guillemot
Other covariance targets:
targetCor(),
targetD(),
targetF(),
targetG(),
targetGstar()
# require(SHIP) data(expl) target_matrix <- targetGpos(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !# require(SHIP) data(expl) target_matrix <- targetGpos(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !
The target Gstar is computed from the data matrix. It it a modified version of target G. In particular,
it involves two parameters for the correlation (a positive and a negative
one) instead of the single parameter in order to account
for negatively correlated genes within the same pathway.
targetGstar(x, genegroups)targetGstar(x, genegroups)
x |
A |
genegroups |
A list of genes obtained using the database KEGG, where each entry itself is a list of pathway names this genes belongs to. If a gene does not belong to any gene functional group, the entry is NA. |
The target uses separate mean correlations for positive and negative linked pairs:
Here and are the mean
positive and negative linked correlations.
A matrix.
Monika Jelizarow and Vincent Guillemot
Other covariance targets:
targetCor(),
targetD(),
targetF(),
targetG(),
targetGpos()
# require(SHIP) data(expl) target_matrix <- targetGstar(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !# require(SHIP) data(expl) target_matrix <- targetGstar(expl$x, expl$genegroups) which(target_matrix[upper.tri(target_matrix)] != 0) # not many non zero coefficients !