Modifier and Type | Field and Description |
---|---|
protected parsebionet.biodata.BioNetwork |
bioNet
The metabolic network of the problem.
|
protected java.util.List<Objective> |
constraintObjectives
List used when several objectives are given in the condition file.
|
protected java.util.List<Constraint> |
constraints
All problem's constraints.
|
protected java.util.Collection<parsebionet.biodata.BioChemicalReaction> |
deadReactions
List of dead reactions.
|
protected java.util.Map<parsebionet.biodata.BioChemicalReaction,java.util.Map<parsebionet.biodata.BioEntity,java.lang.Double>> |
exchangeInteractions
Map used for rFBA to link exchange reactions to external metabolites.
|
protected boolean |
interactionInSolver
Decides if the interactions will be treated in ther solver or before.
|
protected java.util.Map<parsebionet.biodata.BioEntity,Relation> |
interactionsEntitiesCause |
protected java.util.Map<parsebionet.biodata.BioEntity,java.util.Map<Relation,double[]>> |
interactionsEntitiesConsequence
To handle time dependent interactions. the Relation is true if the
bioEntity is > 0 . double[0] corresponds to how long it takes for the
interactions to become active and double[1] corresponds to how long it
stays active.
|
protected InteractionNetwork |
intNet
The interaction network of the problem.
|
protected java.util.Map<Interaction,java.util.List<Constraint>> |
intToConstraint
Links an interactions to a list of constraints to check if the
interaction is true.
|
protected java.util.Map<java.lang.String,java.lang.Double> |
lastSolve
Contains the results of the last FBA performed.
|
private boolean |
loadObjective
Used for pareto analysis, if set to false, the objective in the condition
file is ignored.
|
protected Objective |
obj
Objective of the problem.
|
protected OperationFactory |
operationFactory
Will permit to create the right operations.
|
protected java.util.Map<parsebionet.biodata.BioEntity,Relation> |
reactionToActiveGPR
Link a reaction to it's GPR interaction.
|
protected RelationFactory |
relationFactory
To create the right relations.
|
protected java.util.Map<parsebionet.biodata.BioEntity,Constraint> |
simpleConstraints
Contains the constraints of just one entity and with coeff = 1, it make
it easier to get and change them.
|
private boolean |
solverPrepared
If false the fba cannot strat.
|
protected java.util.Map<parsebionet.biodata.BioEntity,java.lang.Object> |
solverSimpleConstraints
The solver constraint objcet corresponding to an entity.
|
protected java.util.Map<parsebionet.biodata.BioEntity,java.util.List<Constraint>> |
steadyStateConstraints
Contains all the constraints caused by the steady state assumption.
|
protected ThreadFactory |
threadFactory
To create the right type of thread.
|
Constructor and Description |
---|
Bind(boolean interactionInSolver) |
Bind(java.util.List<Constraint> constraints,
java.util.Map<parsebionet.biodata.BioEntity,Constraint> simpleConstraints,
InteractionNetwork intNet,
parsebionet.biodata.BioNetwork bioNet,
boolean interactionInSolver)
Constructor used to copy the bind.
|
Modifier and Type | Method and Description |
---|---|
private void |
addNetworkEntities()
Adds entities to the problem from the metaboblic network.
|
private void |
addRightEntityType(parsebionet.biodata.BioEntity b,
boolean integer,
boolean binary)
Adds an entity to the problem.
|
abstract void |
changeObjVarValue(parsebionet.biodata.BioEntity e,
double d)
Changes the coefficient of an entity in the objective.
|
protected abstract void |
changeVarBounds(java.lang.String entity,
double[] bounds)
Changes the bounds of an entity.
|
java.util.Map<Constraint,Interaction> |
checkInteractions()
Checks all interactions.
|
java.util.List<Constraint> |
checkInteractionsForEntities(java.util.Map<parsebionet.biodata.BioEntity,double[]> entititesMap)
Returns list of true interactions when setting the given entities to the
given values. double[0]=lb, double[1]=ub.
|
protected abstract void |
clear()
Clears the solver's model.
|
protected void |
clearSolver()
Clears the solver.
|
protected void |
constraintsToSolverConstraints()
Transforms all problem's constraints into solver constraints.
|
parsebionet.biodata.BioEntity |
createFluxesSummation() |
protected abstract void |
deleteConstraints(java.util.List<java.lang.Object> solverConstraints)
Deletes solver constraints.
|
void |
displayConstraints()
Prints the constraints
|
abstract void |
end() |
abstract void |
entitiesToSolverVars()
Transforms problem entities into the right solver variables.
|
DoubleResult |
FBA(boolean saveResults,
boolean chechInt)
Checks the interactions if it has to, and performs the FBA.
|
DoubleResult |
FBAWithConstraints(java.util.List<Constraint> constraintsToAdd,
boolean saveResults,
boolean chechInt)
Takes constraints, checks interactions for those constraints, and
performs FBA.
|
parsebionet.biodata.BioNetwork |
getBioNetwork() |
java.util.List<Constraint> |
getConstraints() |
java.util.Collection<parsebionet.biodata.BioChemicalReaction> |
getDeadReactions() |
java.util.Map<parsebionet.biodata.BioChemicalReaction,java.util.Map<parsebionet.biodata.BioEntity,java.lang.Double>> |
getExchangeInteractions() |
InteractionNetwork |
getInteractionNetwork() |
java.util.Map<parsebionet.biodata.BioEntity,java.util.Map<Relation,double[]>> |
getInteractionsEntities() |
java.util.Map<parsebionet.biodata.BioEntity,Relation> |
getInteractionsEntitiesCause() |
java.util.Map<Interaction,java.util.List<Constraint>> |
getIntToConstraint() |
Objective |
getObjective() |
java.util.Map<parsebionet.biodata.BioEntity,Constraint> |
getSimpleConstraints() |
double |
getSolvedValue(parsebionet.biodata.BioEntity ent)
Return the value of the last solve for a given entity.
|
ThreadFactory |
getThreadFactory() |
protected abstract DoubleResult |
go(boolean saveResults)
Make the solver perform the solves.
|
private DoubleResult |
goWithConstraints(java.util.List<Constraint> constraints,
boolean saveResults)
Performs the solver solve with constraints.
|
private void |
gprInteractions(boolean ext)
Adds GPR interactions to the problem.
|
protected abstract void |
interactionsToSolverConstraints(java.util.List<Interaction> interactions)
Transforms problem interactions into solver constraints.
|
boolean |
isInteractionInSolver() |
boolean |
isLastSolveEmpty() |
abstract boolean |
isMIP() |
void |
loadConditionsFile(java.lang.String path)
Loads the objective, creates variables and constraints from the condition
file
|
void |
loadInteractionsFile(java.lang.String path)
Creates interactions from the interaction file.
|
void |
loadSbmlNetwork(java.lang.String path,
boolean ext)
Loads an SBML file.
|
private java.util.Map<parsebionet.biodata.BioEntity,java.lang.Double> |
makeFormulaFromString(java.lang.String s)
Creates an equation from a string.
|
Objective |
makeObjectiveFromString(java.lang.String expr,
boolean maximize,
java.lang.String name)
* creates an objective from a string.
|
private Relation |
makeRelationFromString(java.lang.String line,
int nbLine)
Creates a Relation from a string.
|
protected abstract void |
makeSolverConstraint(Constraint c,
java.util.List<java.lang.Object> toRemoveFromModel,
java.util.Map<java.lang.String,double[]> oldBounds)
Creates a constraint for the solver.
|
abstract void |
makeSolverObjective()
Transforms the porblem's objective into a solver objective.
|
private void |
makeSteadyStateConstraints()
Adds steady-state constraints to the problem from the metabolic network.
|
private Unique |
makeUniqueFromCondition(java.lang.String condition,
int nbLine)
Creates a Unique from a string.
|
void |
prepareSolver()
Transforms all problem entities, constraints an interaction into solver
entities, constraints an interactions.
|
void |
setLoadObjective(boolean load) |
void |
setNetwork(parsebionet.biodata.BioNetwork network,
boolean ext)
Sets the problem's network and adds constraints and interactions included
in it.
|
void |
setObjective(Objective obj)
Sets the objective.
|
abstract void |
setObjSense(boolean maximize)
Sets the sense of the objective function.
|
private void |
setReactionsBounds()
Sets the bounds of reaction entities from the bioNetwork values.
|
private void |
setRightEntityType(parsebionet.biodata.BioEntity entity,
boolean integer,
boolean binary)
Changes the type of an entity to a new one.
|
private boolean loadObjective
protected Objective obj
protected java.util.List<Objective> constraintObjectives
protected OperationFactory operationFactory
protected RelationFactory relationFactory
protected ThreadFactory threadFactory
protected InteractionNetwork intNet
protected parsebionet.biodata.BioNetwork bioNet
protected java.util.List<Constraint> constraints
protected java.util.Map<Interaction,java.util.List<Constraint>> intToConstraint
protected java.util.Collection<parsebionet.biodata.BioChemicalReaction> deadReactions
protected java.util.Map<java.lang.String,java.lang.Double> lastSolve
protected java.util.Map<parsebionet.biodata.BioEntity,Constraint> simpleConstraints
protected java.util.Map<parsebionet.biodata.BioEntity,java.util.List<Constraint>> steadyStateConstraints
protected java.util.Map<parsebionet.biodata.BioEntity,java.lang.Object> solverSimpleConstraints
protected boolean interactionInSolver
private boolean solverPrepared
protected java.util.Map<parsebionet.biodata.BioChemicalReaction,java.util.Map<parsebionet.biodata.BioEntity,java.lang.Double>> exchangeInteractions
protected java.util.Map<parsebionet.biodata.BioEntity,java.util.Map<Relation,double[]>> interactionsEntitiesConsequence
protected java.util.Map<parsebionet.biodata.BioEntity,Relation> interactionsEntitiesCause
protected java.util.Map<parsebionet.biodata.BioEntity,Relation> reactionToActiveGPR
public Bind(java.util.List<Constraint> constraints, java.util.Map<parsebionet.biodata.BioEntity,Constraint> simpleConstraints, InteractionNetwork intNet, parsebionet.biodata.BioNetwork bioNet, boolean interactionInSolver)
constraints
- Constraints to copy.simpleConstraints
- Simple constraints to copy.intNet
- Interaction network to copy.bioNet
- BioNetwork to copy.interactionInSolver
- Determines if interactions will be treated by the solver of
before.public Bind(boolean interactionInSolver)
public abstract void entitiesToSolverVars()
protected abstract void interactionsToSolverConstraints(java.util.List<Interaction> interactions)
protected abstract void makeSolverConstraint(Constraint c, java.util.List<java.lang.Object> toRemoveFromModel, java.util.Map<java.lang.String,double[]> oldBounds)
c
- Constraint to createtoRemoveFromModel
- is used to come back to how it was before.oldBounds
- is used to come back to how it was before.protected abstract void deleteConstraints(java.util.List<java.lang.Object> solverConstraints)
solverConstraints
- protected abstract void changeVarBounds(java.lang.String entity, double[] bounds)
entity
- The entity to changebounds
- New boundspublic abstract void makeSolverObjective()
public abstract void changeObjVarValue(parsebionet.biodata.BioEntity e, double d)
e
- The entityd
- The coefficientpublic abstract void setObjSense(boolean maximize)
maximize
- if true : maximize, if false : minimizeprotected abstract void clear()
protected void clearSolver()
public abstract boolean isMIP()
protected abstract DoubleResult go(boolean saveResults)
saveResults
- public DoubleResult FBA(boolean saveResults, boolean chechInt)
public DoubleResult FBAWithConstraints(java.util.List<Constraint> constraintsToAdd, boolean saveResults, boolean chechInt)
constraintsToAdd
- List of constraints to add before the FBA.saveResults
- Determines if the results will be saved.chechInt
- Determines if all interactions will be checked.private DoubleResult goWithConstraints(java.util.List<Constraint> constraints, boolean saveResults)
constraints
- Constraints to add before the FBA is done.saveResults
- Determines if the results will be saved.public void loadSbmlNetwork(java.lang.String path, boolean ext)
path
- Path to the SBML file.ext
- If true : uses extended SBML format.public void setNetwork(parsebionet.biodata.BioNetwork network, boolean ext)
network
- Network to give the problem.ext
- If true : uses extended SBML format.public void loadInteractionsFile(java.lang.String path)
path
- Path to the interaction file.private void addRightEntityType(parsebionet.biodata.BioEntity b, boolean integer, boolean binary)
b
- Entity to add.integer
- If it is an integer entity.binary
- If it is a binary entity.public void loadConditionsFile(java.lang.String path)
path
- Path to the condition file.private void setRightEntityType(parsebionet.biodata.BioEntity entity, boolean integer, boolean binary)
entity
- Entity to change.integer
- If it is an integer entity.binary
- If it is a binary entity.public parsebionet.biodata.BioEntity createFluxesSummation()
public Objective makeObjectiveFromString(java.lang.String expr, boolean maximize, java.lang.String name)
expr
- string used to create the objective.maximize
- Boolean that determines if the objectives maximizes of
minimizes the function.name
- The name of the objective.private java.util.Map<parsebionet.biodata.BioEntity,java.lang.Double> makeFormulaFromString(java.lang.String s)
s
- String to create the equation from.public void prepareSolver()
private void addNetworkEntities()
private void makeSteadyStateConstraints()
private void setReactionsBounds()
private void gprInteractions(boolean ext)
ext
- true : uses extended SBML format.protected void constraintsToSolverConstraints()
public parsebionet.biodata.BioNetwork getBioNetwork()
public InteractionNetwork getInteractionNetwork()
public java.util.List<Constraint> getConstraints()
public void displayConstraints()
private Relation makeRelationFromString(java.lang.String line, int nbLine)
line
- String to create the Relation from.nbLine
- Line number of the interaction file.private Unique makeUniqueFromCondition(java.lang.String condition, int nbLine)
condition
- The string to create the Unique from.nbLine
- Line number of the interaction file.public void setObjective(Objective obj)
obj
- Objective to set.public abstract void end()
public Objective getObjective()
public java.util.Map<Constraint,Interaction> checkInteractions()
public java.util.List<Constraint> checkInteractionsForEntities(java.util.Map<parsebionet.biodata.BioEntity,double[]> entititesMap)
entititesMap
- Entities and the values they will be set to.public boolean isInteractionInSolver()
public java.util.Map<Interaction,java.util.List<Constraint>> getIntToConstraint()
public ThreadFactory getThreadFactory()
public java.util.Map<parsebionet.biodata.BioChemicalReaction,java.util.Map<parsebionet.biodata.BioEntity,java.lang.Double>> getExchangeInteractions()
public java.util.Map<parsebionet.biodata.BioEntity,Constraint> getSimpleConstraints()
public boolean isLastSolveEmpty()
public double getSolvedValue(parsebionet.biodata.BioEntity ent)
ent
- The entity to get the value.public java.util.Map<parsebionet.biodata.BioEntity,java.util.Map<Relation,double[]>> getInteractionsEntities()
public java.util.Map<parsebionet.biodata.BioEntity,Relation> getInteractionsEntitiesCause()
public void setLoadObjective(boolean load)
public java.util.Collection<parsebionet.biodata.BioChemicalReaction> getDeadReactions()