|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.mng.AbstractProcessManager
sbrt.shell.mng.fba.FbaManager
sbrt.shell.mng.fba.FbaOptManager
public final class FbaOptManager
This class is used to manage basic FBA optimization processes.
Field Summary | |
---|---|
static java.lang.String |
CONSTRAINTS_FILE
The keyword used to denote a constraints file. |
static int |
DEFAULT_SAFETY_LEVEL
The default safety level used by getSafetyLevel(ManagerInput, PrintWriter). |
static java.lang.String |
OBJECTIVE_FUNCTION
The keyword used to denote an objective function. |
static java.lang.String |
OPTIMIZATION_SENSE
The keyword used to denote the optimization sense, or direction. |
static UnmodifiableSet<java.lang.String> |
optionalKeywords
The set of keywords understood, but not required, by instances of this class. |
static UnmodifiableSet<java.lang.String> |
requiredKeywords
The set of keywords required to be present in the ManagerInput
objects supplied to instances of this class. |
static java.lang.String |
SAFETY_LEVEL
The keyword used to denote the safety level. |
Fields inherited from class sbrt.shell.mng.fba.FbaManager |
---|
CONSTRAINT_TOLERANCE, DEFAULT_CONSTRAINT_TOLERANCE, FLUX_VECTOR_FILE, FLUX_VECTOR_FILE_NAME, RXN_CATALYST_FILE, RXN_FILE, SYSTEM_SOLUTION_FILE |
Fields inherited from class sbrt.shell.mng.AbstractProcessManager |
---|
ALGORITHM, COMPLETED, DATA_HEADERS, DEV_NULL, ELAPSED_TIME, FILE_FORMAT, INPUT_FILE, INPUT_FILE_FORMAT, INPUT_FILE_NAME_FILE, ITERATIONS, OUTPUT_FILE_FORMAT, OUTPUT_FILE_NAME, OUTPUT_FILE_NAME_FILE, PERCENT, PERCENT_COMPLETED, SEED, ZERO_CUTOFF |
Constructor Summary | |
---|---|
FbaOptManager()
|
Method Summary | ||
---|---|---|
void |
execute(java.io.PrintWriter out)
Executes the process this process manager controls, and writes the status or results of this process to the provided print writer. |
|
static FluxConstraints |
getConstraints(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
Fluxome fluxome,
double tolerance)
Opens the file denoted by CONSTRAINTS_FILE in the provided manager input and returns the set of flux constraints it contains. |
|
static FluxConstraints |
getConstraints(java.lang.String fileName,
Fluxome fluxome,
double tolerance)
Returns the set of constraints contained in the file with the provided name. |
|
static java.util.Set<java.lang.String> |
getDataHeaders(ManagerInput<java.lang.String,java.lang.String> input,
Fluxome fluxome)
Parses and returns the value for AbstractProcessManager.DATA_HEADERS in the provided manager input. |
|
static java.util.LinkedHashSet<java.lang.String> |
getDataHeaders(java.lang.String dataHeaders,
Fluxome fluxome)
Parses the provided data header string and returns the corresponding set. |
|
static FbaOptimizer<IrrevRxnFluxome> |
getIrrevRxnComp(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out)
Creates and returns an FBA optimization computer based on the provided input. |
|
static IrrevRxnFluxome |
getIrrevRxnFluxome(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out)
Creates and returns a fluxome based on the provided input. |
|
static IrrevRxnFluxome |
getIrrevRxnFluxome(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
double tolerance)
Creates and returns a fluxome based on the provided input. |
|
static FbaOptimizer<MixedFluxome> |
getMixedComp(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out)
Creates and returns an FBA optimization computer based on the provided input. |
|
static MixedFluxome |
getMixedFluxome(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out)
Creates and returns a fluxome based on the provided input. |
|
static MixedFluxome |
getMixedFluxome(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
double tolerance)
Creates and returns a fluxome based on the provided input. |
|
static
|
getMultiColOrOutputFiles(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
java.util.Iterator<java.lang.String> fileNameSource,
java.lang.String fileNameSourceName,
F fluxome)
Returns a source of column-oriented FBA optimization output files. |
|
static
|
getMultiFileOutput(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
java.util.Iterator<java.lang.String> fileNameSource,
java.lang.String fileNameSourceName,
F fluxome)
Returns a source of FBA optimization output files. |
|
static
|
getMultiResultsOutputFile(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
F fluxome)
Returns an empty output file that is suitable for storing multiple FBA optimization results. |
|
static
|
getMultiResultsOutputFile(java.lang.String fileName,
FileFormat fileFormat,
java.util.Set<java.lang.String> dataHeaders,
F fluxome)
Returns an empty output file that is suitable for storing multiple FBA optimization results. |
|
static
|
getMultiRowOrOutputFiles(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
java.util.Iterator<java.lang.String> fileNameSource,
F fluxome)
Returns a source of row-oriented FBA optimization output files. |
|
static
|
getMultiSerOutputFiles(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
java.util.Iterator<java.lang.String> fileNameSource,
java.lang.String fileNameSourceName,
F fluxome)
Returns a source of serialized FBA optimization output files. |
|
static LinearComb<java.lang.String> |
getObjFunc(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
Fluxome fluxome)
Parses and returns the value for OBJECTIVE_FUNCTION in the provided manager input. |
|
UnmodifiableSet<java.lang.String> |
getOptionalKeys()
Returns the set of keywords the provided ManagerInput object does
not necessarily have to contain. |
|
static OptSense |
getOptSense(ManagerInput<java.lang.String,java.lang.String> input)
Parses and returns the value for OPTIMIZATION_SENSE in the provided manager input. |
|
FbaOptProcess<MixedFluxome> |
getProcess()
Returns the process this process manager controls. |
|
UnmodifiableSet<java.lang.String> |
getRequiredKeys()
Returns the set of keywords the provided ManagerInput object must
contain. |
|
static int |
getSafetyLevel(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out)
Parses and returns the value for SAFETY_LEVEL in the provided manager input. |
|
static
|
getSingleResultOutputFile(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out,
F fluxome)
Returns an empty output file that is suitable for storing a single FBA optimization result. |
|
static
|
getSingleResultOutputFile(java.lang.String fileName,
FileFormat fileFormat,
java.util.Set<java.lang.String> dataHeaders,
F fluxome)
Returns an empty output file that is suitable for storing a single FBA optimization result. |
|
static ApplicationException |
interpret(ConstraintViolationException e,
FbaProcess<?,?> process)
Returns an ApplicationException whose message describes the error
that ocurred. |
|
static ApplicationException |
interpret(FbaOptException e,
FbaProcess<?,?> process)
Returns an ApplicationException whose message describes the error
that ocurred. |
|
static ApplicationException |
interpret(ProgramSolverException e)
Returns an ApplicationException whose message describes the error
that ocurred. |
|
static ApplicationException |
interpret(java.lang.RuntimeException e,
FbaProcess<?,?> process)
Returns an ApplicationException whose message describes the error
that ocurred. |
|
void |
setInput(ManagerInput<java.lang.String,java.lang.String> input,
java.io.PrintWriter out)
Uses the provided input to prepare this process manager for execution. |
Methods inherited from class sbrt.shell.mng.AbstractProcessManager |
---|
check, closeFile, closeRm, execute, getFileFormat, getFileFormat, getFileNameSource, getIterations, getSeed, getTextFileFormat, getTextFileFormat, getZeroCutoff, getZeroCutoff, parseInt, parseLong, printProgress, printProgress, printProgress, runProcess, setInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface sbrt.shell.mng.ProcessManager |
---|
check, execute, setInput |
Field Detail |
---|
public static final int DEFAULT_SAFETY_LEVEL
public static final java.lang.String OBJECTIVE_FUNCTION
public static final java.lang.String CONSTRAINTS_FILE
public static final java.lang.String OPTIMIZATION_SENSE
public static final java.lang.String SAFETY_LEVEL
public static final UnmodifiableSet<java.lang.String> requiredKeywords
ManagerInput
objects supplied to instances of this class.
public static final UnmodifiableSet<java.lang.String> optionalKeywords
Constructor Detail |
---|
public FbaOptManager()
Method Detail |
---|
public static LinearComb<java.lang.String> getObjFunc(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, Fluxome fluxome)
input
- keyword-value pairs.out
- the print writer to which a status message will be printed.fluxome
- the fluxome to which the objective function corresponds.
public static IrrevRxnFluxome getIrrevRxnFluxome(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out)
input
- keyword-value pairs.out
- the print writer to which status messages will be printed.
FbaManager.getIrrevRxnFluxome(ManagerInput, PrintWriter)
,
FbaManager.getConstraintTolerance(ManagerInput, PrintWriter)
,
getConstraints(ManagerInput, PrintWriter, Fluxome, double)
public static IrrevRxnFluxome getIrrevRxnFluxome(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, double tolerance)
input
- keyword-value pairs.out
- the print writer to which status messages will be printed.tolerance
- the constraint tolerance.
FbaManager.getIrrevRxnFluxome(ManagerInput, PrintWriter)
,
getConstraints(ManagerInput, PrintWriter, Fluxome, double)
,
Fluxome.replaceConstraints(FluxConstraints, double)
public static MixedFluxome getMixedFluxome(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out)
input
- keyword-value pairs.out
- the print writer to which status messages will be printed.
FbaManager.getMixedFluxome(ManagerInput, PrintWriter)
,
FbaManager.getConstraintTolerance(ManagerInput, PrintWriter)
,
getConstraints(ManagerInput, PrintWriter, Fluxome, double)
public static MixedFluxome getMixedFluxome(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, double tolerance)
input
- keyword-value pairs.out
- the print writer to which status messages will be printed.tolerance
- the constraint tolerance.
FbaManager.getMixedFluxome(ManagerInput, PrintWriter)
,
getConstraints(ManagerInput, PrintWriter, Fluxome, double)
,
Fluxome.replaceConstraints(FluxConstraints, double)
public static FluxConstraints getConstraints(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, Fluxome fluxome, double tolerance)
input
- keyword-value pairs.out
- the print writer to which a status message will be printed.fluxome
- the fluxome to which the constraints correspond.tolerance
- the constraint tolerance.
CONSTRAINTS_FILE
in the provided input; or, if the input does
not contain a value for CONSTRAINTS_FILE
, an empty set of flux
constraints.getConstraints(String, Fluxome, double)
public static FluxConstraints getConstraints(java.lang.String fileName, Fluxome fluxome, double tolerance)
fileName
- the name of the file to be read.fluxome
- the fluxome to which the constraints correspond.tolerance
- the constraint tolerance.
java.lang.NullPointerException
- if any argument is null
.RomiFile
public static FbaOptimizer<IrrevRxnFluxome> getIrrevRxnComp(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out)
input
- keyword-value pairs.out
- the print writer to which status messages will be printed.
getIrrevRxnFluxome(ManagerInput, PrintWriter)
,
getSafetyLevel(ManagerInput, PrintWriter)
,
FbaManager.getConstraintTolerance(ManagerInput, PrintWriter)
,
ProgramSolverFactory.make(ManagerInput, PrintWriter)
public static FbaOptimizer<MixedFluxome> getMixedComp(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out)
input
- keyword-value pairs.out
- the print writer to which status messages will be printed.
getMixedFluxome(ManagerInput, PrintWriter)
,
getSafetyLevel(ManagerInput, PrintWriter)
,
FbaManager.getConstraintTolerance(ManagerInput, PrintWriter)
,
ProgramSolverFactory.make(ManagerInput, PrintWriter)
public static int getSafetyLevel(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out)
input
- keyword-value pairs.out
- the print writer to which a status message will be printed.
public static OptSense getOptSense(ManagerInput<java.lang.String,java.lang.String> input)
input
- keyword-value pairs.
public static ApplicationException interpret(java.lang.RuntimeException e, FbaProcess<?,?> process)
ApplicationException
whose message describes the error
that ocurred.
e
- a runtime exception thrown during an FBA optimization.process
- the FBA process from which the exception was thrown.
ApplicationException
wrapping the provided exception.
java.lang.RuntimeException
- the original exception if it cannot be
intrepretted.public static ApplicationException interpret(ProgramSolverException e)
ApplicationException
whose message describes the error
that ocurred.
e
- a program solver exception.
ApplicationException
wrapping the provided exception.public static ApplicationException interpret(ConstraintViolationException e, FbaProcess<?,?> process)
ApplicationException
whose message describes the error
that ocurred.
e
- a constraint violation exception.process
- the FBA process from which the exception was thrown.
ApplicationException
wrapping the provided exception.public static ApplicationException interpret(FbaOptException e, FbaProcess<?,?> process)
ApplicationException
whose message describes the error
that ocurred.
e
- an FBA optimization exception.process
- the FBA process from which the exception was thrown.
ApplicationException
wrapping the provided exception.public static java.util.Set<java.lang.String> getDataHeaders(ManagerInput<java.lang.String,java.lang.String> input, Fluxome fluxome)
input
- keyword-value pairs.fluxome
- the fluxome to which the data headers correspond.
public static java.util.LinkedHashSet<java.lang.String> getDataHeaders(java.lang.String dataHeaders, Fluxome fluxome)
dataHeaders
- a string containing data headers.fluxome
- the fluxome to which the data headers correspond.
null
.public static <F extends Fluxome> FbaOptOutputFile<F> getMultiResultsOutputFile(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, F fluxome)
F
- the fluxome type.input
- the input containing values for the listed keywords.out
- the print writer to which status messages will be printed.fluxome
- the fluxome to which the results correspond.
getDataHeaders(ManagerInput, Fluxome)
,
AbstractProcessManager.getFileFormat(ManagerInput)
public static <F extends Fluxome> FbaOptOutputFile<F> getMultiResultsOutputFile(java.lang.String fileName, FileFormat fileFormat, java.util.Set<java.lang.String> dataHeaders, F fluxome)
F
- the fluxome type.fileName
- the name of the file to be created.fileFormat
- the format of the file to be created.dataHeaders
- the set of data headers to be written to the file.fluxome
- the fluxome to which the results correspond.
public static <F extends Fluxome> FbaOptOutputFile<F> getSingleResultOutputFile(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, F fluxome)
F
- the fluxome type.input
- the input containing values for the listed keywords.out
- the print writer to which status messages will be printed.fluxome
- the fluxome to which the results correspond.
getDataHeaders(ManagerInput, Fluxome)
,
AbstractProcessManager.getFileFormat(ManagerInput)
public static <F extends Fluxome> FbaOptOutputFile<F> getSingleResultOutputFile(java.lang.String fileName, FileFormat fileFormat, java.util.Set<java.lang.String> dataHeaders, F fluxome)
F
- the fluxome type.fileName
- the name of the file to be created.fileFormat
- the format of the file to be created.dataHeaders
- the set of data headers to be written to the file.fluxome
- the fluxome to which the results correspond.
public static <F extends Fluxome> MultiOutputFiles<? extends FbaOptOutputFile<F>,FbaOptimizer.Results> getMultiFileOutput(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, java.util.Iterator<java.lang.String> fileNameSource, java.lang.String fileNameSourceName, F fluxome)
F
- the fluxome type.input
- keyword-value pairs.out
- the print writer to which status messages will be printed.fileNameSource
- a source of desired output file names.fileNameSourceName
- the name of the output file name source.fluxome
- the fluxome for which the results correspond.
getMultiColOrOutputFiles(ManagerInput, PrintWriter, Iterator, String, Fluxome)
,
getMultiSerOutputFiles(ManagerInput, PrintWriter, Iterator, String, Fluxome)
public static <F extends Fluxome> MultiOutputFiles<SerFbaOptOutputFile<F>,FbaOptimizer.Results> getMultiSerOutputFiles(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, java.util.Iterator<java.lang.String> fileNameSource, java.lang.String fileNameSourceName, F fluxome)
F
- the fluxome type.input
- keyword-value pairs.out
- the print writer to which status messages will be printed.fileNameSource
- a source of desired output file names.fileNameSourceName
- the name of the output file name source.fluxome
- the fluxome for which the results correspond.
SerFbaOptOutputFile
,
SfoofSource
public static <F extends Fluxome> MultiOutputFiles<ColumnOrFbaOptOutputFile<F>,FbaOptimizer.Results> getMultiColOrOutputFiles(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, java.util.Iterator<java.lang.String> fileNameSource, java.lang.String fileNameSourceName, F fluxome)
F
- the fluxome type.input
- keyword-value pairs.out
- the print writer to which status messages will be printed.fileNameSource
- a source of desired output file names.fileNameSourceName
- the name of the output file name source.fluxome
- the fluxome for which the results correspond.
ColumnOrFbaOptOutputFile
,
CofoofSource
public static <F extends Fluxome> MultiOutputFiles<RowOrFbaOptOutputFile<F>,FbaOptimizer.Results> getMultiRowOrOutputFiles(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, java.util.Iterator<java.lang.String> fileNameSource, F fluxome)
F
- the fluxome type.input
- keyword-value pairs.out
- the print writer to which status messages will be printed.fileNameSource
- a source of desired output file names.fluxome
- the fluxome for which the results correspond.
RowOrFbaOptOutputFile
,
RofoofSource
public UnmodifiableSet<java.lang.String> getRequiredKeys()
ManagerInput
object must
contain.
ManagerInput
object must
contain.public UnmodifiableSet<java.lang.String> getOptionalKeys()
ManagerInput
object does
not necessarily have to contain.
ManagerInput
object does
not necessarily have to contain.public FbaOptProcess<MixedFluxome> getProcess()
java.lang.IllegalStateException
- if no input was provided to this process
manager via AbstractProcessManager.setInput(ManagerInput) or
setInput(ManagerInput, PrintWriter)public void setInput(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out)
input
- all of the information required to prepare this process
manager for execution.out
- the print writer to which all messages will be printed.public void execute(java.io.PrintWriter out)
out
- the print writer where status messages will be printed.
java.lang.IllegalStateException
- if no input was provided to this process
manager via AbstractProcessManager.setInput(ManagerInput) or
setInput(ManagerInput, PrintWriter)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |