Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sybil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
general
ccb
sybil
Commits
ac370ff5
Commit
ac370ff5
authored
10 years ago
by
Claus Jonathan Fritzemeier
Browse files
Options
Downloads
Patches
Plain Diff
bug in doubleFluxDel
parent
9a6ae39e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/doubleFluxDel.R
+28
-23
28 additions, 23 deletions
R/doubleFluxDel.R
inst/NEWS.Rd
+1
-0
1 addition, 0 deletions
inst/NEWS.Rd
with
29 additions
and
23 deletions
R/doubleFluxDel.R
+
28
−
23
View file @
ac370ff5
...
@@ -60,8 +60,8 @@ doubleFluxDel <- function(model, react1, react2, lb = NULL, ub = NULL,
...
@@ -60,8 +60,8 @@ doubleFluxDel <- function(model, react1, react2, lb = NULL, ub = NULL,
}
}
}
}
react1
<-
sort
(
react_pos
(
react1
))
react1
<-
(
react_pos
(
react1
))
# removed sort here
react2
<-
sort
(
react_pos
(
react2
))
react2
<-
(
react_pos
(
react2
))
# removed sort here
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
...
@@ -94,6 +94,11 @@ doubleFluxDel <- function(model, react1, react2, lb = NULL, ub = NULL,
...
@@ -94,6 +94,11 @@ doubleFluxDel <- function(model, react1, react2, lb = NULL, ub = NULL,
# print(react2)
# print(react2)
if
(
isTRUE
(
allComb
))
{
if
(
isTRUE
(
allComb
))
{
# if allComb is used, duplicated entries in react1 or react2 dont make
# sense:
react1
<-
unique
(
react1
)
react2
<-
unique
(
react2
)
# Compute Boolean matrix with TRUE in the upper triangonal
# Compute Boolean matrix with TRUE in the upper triangonal
# (the maximum number of comparisons)
# (the maximum number of comparisons)
...
@@ -130,38 +135,38 @@ doubleFluxDel <- function(model, react1, react2, lb = NULL, ub = NULL,
...
@@ -130,38 +135,38 @@ doubleFluxDel <- function(model, react1, react2, lb = NULL, ub = NULL,
# The number of TRUE's in tmpMAT is equal to the number of optimizations
# The number of TRUE's in tmpMAT is equal to the number of optimizations
num_opt
<-
sum
(
tmpMAT
==
TRUE
)
num_opt
<-
sum
(
tmpMAT
==
TRUE
)
}
else
{
tmpMAT
<-
matrix
(
FALSE
,
nrow
=
react_num
(
model
),
ncol
=
react_num
(
model
))
for
(
i
in
1
:
num_react1
)
{
tmpMAT
[
react1
[
i
],
react2
[
i
]]
<-
TRUE
}
#tmpMAT[geneList1, geneList2] <- TRUE
num_opt
<-
num_react1
tmpMAT
<-
tmpMAT
[
react1
,
react2
]
}
rownames
(
tmpMAT
)
<-
react1
rownames
(
tmpMAT
)
<-
react1
colnames
(
tmpMAT
)
<-
react2
colnames
(
tmpMAT
)
<-
react2
deletions
<-
which
(
tmpMAT
==
TRUE
,
arr.ind
=
TRUE
)
koreactID
<-
cbind
(
react1
[
deletions
[,
"row"
]],
react2
[
deletions
[,
"col"
]])
}
else
{
koreactID
<-
cbind
(
react1
,
react2
)
# tmpMAT <- matrix(FALSE, nrow = react_num(model),
# ncol = react_num(model))
# for (i in 1:num_react1) {
# tmpMAT[react1[i], react2[i]] <- TRUE
# }
# #tmpMAT[geneList1, geneList2] <- TRUE
# browser()
# num_opt <- num_react1
# tmpMAT <- tmpMAT[react1, react2]
}
koreact
<-
lapply
(
seq_len
(
nrow
(
koreactID
)),
function
(
x
)
koreactID
[
x
,
])
browser
()
# The number of TRUE's in tmpMAT is equal to the number of optimizations
# The number of TRUE's in tmpMAT is equal to the number of optimizations
# print(num_opt)
# print(num_opt)
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# run optimization #
# run optimization #
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
deletions
<-
which
(
tmpMAT
==
TRUE
,
arr.ind
=
TRUE
)
koreactID
<-
cbind
(
react1
[
deletions
[,
"row"
]],
react2
[
deletions
[,
"col"
]])
koreact
<-
lapply
(
seq_len
(
nrow
(
koreactID
)),
function
(
x
)
koreactID
[
x
,
])
if
(
is.null
(
lb
))
{
if
(
is.null
(
lb
))
{
lb
<-
rep
(
0
,
length
(
koreact
))
lb
<-
rep
(
0
,
length
(
koreact
))
}
}
...
...
This diff is collapsed.
Click to expand it.
inst/NEWS.Rd
+
1
−
0
View file @
ac370ff5
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
\item \code{findExchangeReact} can now deal with real big matrices (>30.000 columns).
\item \code{findExchangeReact} can now deal with real big matrices (>30.000 columns).
\item additional example for readProb and writeProb.
\item additional example for readProb and writeProb.
\item modified \code{multiDel} to not use \code{require}
\item modified \code{multiDel} to not use \code{require}
\item \code{doubleFluxDel} had a bug if \code{react1} or \code{react2} contained duplicated entries.
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment