epocA(Y, U=NULL, lambdas=NULL, thr=1.0e-10, trace=0, ...)
epocG(Y, U, lambdas=NULL, thr=1.0e-10, trace=0, ...)
epoc.lambdamax(X, Y, getall=F, predictorix=NULL)
as.graph.EPOCA(model,k=1)
as.graph.EPOCG(model,k=1)
write.sif(model, k=1, file="", append=F)
## S3 method for class 'EPOCA'
print(x,...)
## S3 method for class 'EPOCG'
print(x,...)
## S3 method for class 'EPOCA'
summary(object, k=NULL, ...)
## S3 method for class 'EPOCG'
summary(object, k=NULL,...)
## S3 method for class 'EPOCA'
coef(object, k=1, ...)
## S3 method for class 'EPOCG'
coef(object, k=1, ...)
## S3 method for class 'EPOCA'
predict(object, newdata,k=1,trace=0, ...)
## S3 method for class 'EPOCG'
predict(object, newdata,k=1,trace=0, ...)
Arguments
Y
N x p matrix of mRNA transcript levels for p genes and N samples for epocA and epocG. For epoc.lambdamaxY is a multi-response matrix
U
N x p matrix of DNA copy number
lambdas
Non-negative vector of relative regularization parameters for lasso. λ=0 means no regularization which give dense solutions (and takes longer to compute). Default=NULL means let EPoC create a vector
thr
Threshold for convergence. Default value is 1e-10. Iterations stop when max absolute parameter change is less than thr
trace
Level of detail for printing out information as iterations proceed.
Default 0 – no information
X
In epoc.lambdamaxX is the design matrix, i.e. predictors
predictorix
For epoc.lambdamax when using a multi-response matrix Y predictors are set to zero for each corresponding response. predictorix tells which of the responses that have a corresponding predictor in the network case
getall
Logical. For epoc.lambdamax get a vector of all inf-norms instead of a single maximum
file
either a character string naming a file or a connection open for writing. "" indicates output to the console
append
logical. Only relevant if file is a character string. If TRUE, the output is appended to the file. If FALSE, any existing file of the name is destroyed
model
Model set from epocA or epocG
k
Select a model of sparsity level k in [1,K]. In summary default (NULL) means all. In plot default is first model.
newdata
List of Y and U matrices required for prediction. epocG requires just U.
x
Model parameter to print and plot
object
Model parameter to summary, coef and predict
...
Parameters passed down to underlying function, e.g. print.default. For epocA and epocG... are reserved for experimental options.
Details
epocA and epocG estimates sparse matrices A or G using fast lasso regression from mRNA transcript levels Y and CNA profiles U. Two models are provided, EPoC A where
AY + U + R = 0
and EPoC G where
Y = GU + E.
The matrices R and E are so far treated as noise. For details see the reference section and the manual page of lassoshooting.
If you have different sizes of U and Y you need to sort your Y such that the U-columns correspond to the first Y-columns. Example: Y.new <- cbind(Y[,haveCNA], Y[, -haveCNA])
CHANGES: predictorix used to be a parameter with a vector of a subset of the variables 1:p of U corresponding to transcripts in Y, Default was to use all which mean that Y and U must have same size.
epoc.lambdamax returns the maximal λ value in a series of lasso regression models such that all coefficients are zero.
plot if type='graph' (default) plot graph of model using the Rgraphviz package
arrows only tell direction, not inhibit or stimulate. If type='modelsel' see modelselPlot.
Value
epocA and epocG returns an object of class ‘"epocA"’ and ‘"epocG"’ respectively.
The methods summary, print, coef, predict can be used as with other models. coef and predict take an extra optional integer parameter k (default 1) which gives the model at the given density level.
An object of these classes is a list containing at least the following components:
coefficients
list of t(A) or t(G) matrices for the different λs
links
the number of links for the different λs
lambdas
the λs used for this model
R2
R², coefficient of determination
Cp
Mallows Cp
s2
Estimate of the error variance
RSS
Residual Sum of Squares (SSreg)
SS.tot
Total sum of squares of the response
inorms
the infinity norm of predictors transposed times response for the different responses
d
Direct effects of CNA to corresponding gene
Note
The coef function returns transposed versions of the matrices A and G.
## Not run:
modelA <- epocA(X,U)
modelG <- epocG(X,U)
# plot sparsest A and G models using the igraph package
# arrows only tell direction, not inhibit or stimulate
par(mfrow=c(1,2))
plot(modelA)
plot(modelG)
# OpenGL 3D plot on sphere using the igraph and rgl packages
plot(modelA,threed=T)
# Write the graph to a file in SIF format for import in e.g. Cytoscape
write.sif(modelA,file="modelA.sif")
# plot graph in Cytoscape using Cytoscape XMLRPC plugin and
# R packages RCytoscape, bioconductor graph, XMLRPC
require('graph')
require('RCytoscape')
g <- as.graph.EPOCA(modelA,k=5)
cw <- CytoscapeWindow("EPoC", graph = g)
displayGraph(cw)
# prediction
N <- dim(X)[1]
ii <- sample(1:N, N/3)
modelG <- epocG(X[ii,], U[ii,])
K <- length(modelA$lambda) # densest model index index
newdata <- list(U=U[-ii,])
e <- X[-ii,] - predict(modelA, newdata, k=K)
RSS <- sum(e^2)
cat("RMSD:", sqrt(RSS/N), "\n")
## End(Not run)