pathway1sample: Penalized estimation of a pathyway's regulatory network from...

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

View source: R/pathwayFunctions.R

Description

The regulatory relationships between DNA copy number and gene expression within a pathway are modeled by a simulteneous-equations model. Parameters of this model are fitted by minimizing of a penalized least squares criterion. The employed penalty is that of the lasso, encouraging sparsity.

Usage

1
2
pathway1sample(Y, X, lambda1 = 1, constr = TRUE, startCis=numeric(), 
	startTrans=matrix(), verbose = FALSE)

Arguments

Y

matrix. Rows are assumed to represent the samples, and columns represent the samples' gene expression levels.

X

matrix. Rows are assumed to represent the samples, and columns represent the samples' genes or traits. The number of rows and columns of X must be identical to that of Y.

lambda1

numeric or matrix. The lasso parameter. In case lambda1 is of class numeric and its length equals one, the same penalty parameter is applied to all trans-effects. In case lambda1 is of class matrix its column and row dimension equal the number of columns of Y. A possibly different penalty parameter is applied to each trans-effect.

constr

logical. Should the cis-effect (the direct effect of a column of X on column of Y) be positive?

startCis

numeric. Starting values for the cis-effect.

startTrans

matrix. Starting values for the trans-effect.

verbose

logical. Should intermediate output be printed on the screen?

Details

The model is fitted equation-by-equation. This is warranted by the assumption of independent errors. The expression levels of one gene is regressed on its own DNA copy number data and the expression levels of all other genes in the pathway.

Value

Object of class pathwayFit.

Author(s)

Wessel N. van Wieringen: w.vanwieringen@vumc.nl

References

Van Wieringen, W.N., Van de Wiel, M.A. (2012), "Modeling the cis- and trans-effect of DNA copy number aberrations on gene expression levels in a pathway", submitted for publication.

See Also

See also pathwayFit and pathway2sample.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# set number of genes (p) and samples (n)
p <- 10
n <- 1000

# sample cis-effects
beta <- abs(rnorm(p))

# sample trans-effects
Theta <- matrix(sample(c(-1,1), p^2, replace=TRUE, prob=c(0.2, 0.8)), ncol=p) * 
		matrix(runif(p^2), ncol=p) / 4
diag(Theta) <- 1

# sample error variances
Sigma <- diag(rchisq(p, df=1)/5 + 0.5)

# sample DNA copy number data
X <- matrix(runif(n*p, min=-2, max=2), ncol=p)

# sample gene expression data
Y <- t(apply(X, 1, function(Y, beta){ Y * beta }, beta=beta)) %*% t(solve(Theta)) + 
	rmvnorm(n, sigma=solve(Theta) %*% Sigma %*% t(solve(Theta)))

# fit model
pFit <- pathway1sample(Y, X, lambda1=1, verbose=TRUE)

# compare fit to "truth" for cis-effects
plot(pFit@Cis ~ beta, pch=20)

# compare fit to "truth" for trans-effects
penFits <- c(pFit@Trans[upper.tri(Theta)], pFit@Trans[lower.tri(Theta)])
truth <- c(Theta[upper.tri(Theta)], Theta[lower.tri(Theta)])
plot(penFits ~ truth, pch=20)

sigaR documentation built on April 28, 2020, 6:05 p.m.