Skip to content
Snippets Groups Projects
Commit 470e4c90 authored by Sajjad Ghaffarinasabsharabiani's avatar Sajjad Ghaffarinasabsharabiani
Browse files

Upload New File

parent 82008f75
Branches
No related tags found
No related merge requests found
compareReactionsFromDifferentModels <- function(models, id){
if(length(id)==1){
id <- rep(id, length(models))
}
names(id) <- models
stopifnot(length(models)==length(id))
s <- lapply(models,
function(m){
sm <- shrinkMatrix(allModels[[m]], j=id[m])
sm[order(rownames(sm)), ,drop=F]
}
)
# are rownames equal!?
rn <- lapply(s, rownames)
if(!all(table(unlist(rn))==length(models))){
print(models)
print(id)
print(table(unlist(rn)))
stop("reaction definition differ in checked models")
}
s <- do.call(cBind, s)
# print(s)
check <- apply(s, 1, function(x){
length(unique(x))==1
})
return(all(check))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment