Select Git revision
-
Claus Jonathan Fritzemeier authoredClaus Jonathan Fritzemeier authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
multiDel.R 8.82 KiB
# multiDel.R
# FBA and friends with R.
#
# Copyright (C) 2010-2014 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics,
# Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany.
# All right reserved.
# Email: geliudie@uni-duesseldorf.de
#
# This file is part of sybil.
#
# Sybil is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Sybil is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with sybil. If not, see <http://www.gnu.org/licenses/>.
################################################
# Function: multDel
#
#
#
#
multiDel <- function(model, nProc = 2,
todo = "oneGeneDel",
del1 = NA, del2 = NA, ...) {
# #unlistResult = FALSE, ...) {
if (!is(model, "modelorg")) {
stop("needs an object of class modelorg!")
}
if (nProc < 2) {
stop("argument nProc must be equal or greater than 2!")
}
#--------------------------------------------------------------#
# split delX to a list of length numCo
#--------------------------------------------------------------#
spDel <- function(del) {
if(is(del, "matrix")) {
nd <- ncol(del)
splitmat <- TRUE
}
else {
nd <- length(del)
splitmat <- FALSE
}
if (numCo > nd) {
numCo <- nd
}
if (isTRUE(splitmat)) {
gs <- floor(seq(1, nd, length.out = numCo+1))
dL <- vector(mode = "list", length = numCo)
for (i in seq(along = gs[1:numCo])) {
en <- ifelse(i == numCo, gs[i+1], gs[i+1]-1)
dL[[i]] <- del[, gs[i]:en, drop = FALSE]
#dL[[i]] <- c(gs[i], en)
}