Skip to content

Commit

Permalink
Merge pull request #41 from iManGHD/master
Browse files Browse the repository at this point in the history
Matrix A
  • Loading branch information
mtefagh authored Jun 17, 2023
2 parents 558a922 + 194ba13 commit 9547742
Show file tree
Hide file tree
Showing 6 changed files with 457 additions and 199 deletions.
304 changes: 233 additions & 71 deletions example/distributedQFCA.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Consistency Checking/TheNaiveApproach.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ function find_blocked_reactions(myModel::StandardModel, Tolerance::Float64=1e-6,

## Homogenize the upper_bound and lower_bound of reactions

printstyled("Homogenization:\n"; color=:cyan)

# Set the maximum value for M:
M = getM()

Expand Down
12 changes: 7 additions & 5 deletions src/Data Processing/Pre_processing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function dataOfModel(myModel::StandardModel, printLevel::Int=1)
## Print out results if requested

if printLevel > 0
printstyled("Metabolic Network:\n"; color=:cyan)
println("Number of Metabolites : $m")
println("Number of Reactions : $n")
println("Number of Genes : $n_genes")
Expand Down Expand Up @@ -262,8 +263,9 @@ function reversibility(lb::Array{Float64,1}, printLevel::Int=1)
## Print out results if requested

if printLevel > 0
printstyled("Reversibility Checking:\n"; color=:cyan)
println("Number of irreversible reactions : $n_irr ")
println("Number of reversible reactions : $n_rev ")
println("Number of reversible reactions : $n_rev ")
end

# Return the IDs of the irreversible and reversible reactions:
Expand Down Expand Up @@ -362,16 +364,16 @@ function homogenization(lb::Array{Float64,1}, ub::Array{Float64,1}, printLevel::
end

# Set a large number for M:
M = getM()
M = getM(printLevel)

# If the lower bound is greater than zero, set it to zero:
lb[lb .>= 0] .= 0
# If the upper bound is greater than zero, set it to the constant M:
ub[ub .>= 0] .= M
ub[ub .> 0] .= M
# If the lower bound is less than zero, set it to the negative of the constant M:
lb[lb .< 0] .= -M
# If the upper bound is less than zero, set it to zero:
ub[ub .< 0] .= 0
ub[ub .<= 0] .= 0

# Return the homogenized lower and upper bounds as a tuple:
return lb, ub
Expand Down Expand Up @@ -487,7 +489,7 @@ function distributedReversibility_Correction(S::Union{SparseMatrixCSC{Float64,In
end

# Set the tolerance value:
Tolerance = getTolerance()
Tolerance = getTolerance(printLevel)

# Initialize empty arrays to store the IDs of blocked reversible reactions in the forward and backward directions:
rev_blocked_fwd = Array{Int64}([])
Expand Down
Loading

0 comments on commit 9547742

Please sign in to comment.