sbrt.shell.mng.fba
Class RandomConstraintsManager

java.lang.Object
  extended by sbrt.shell.mng.AbstractProcessManager
      extended by sbrt.shell.mng.fba.FbaManager
          extended by sbrt.shell.mng.fba.RandomConstraintsManager
All Implemented Interfaces:
KernelProcessManager<java.lang.String,java.lang.String>, ProcessManager<java.lang.String,java.lang.String>

public final class RandomConstraintsManager
extends FbaManager

This class is used to manage random constraints generators.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Field Summary
static java.lang.String INACTIVE
          The keyword used to denote the inactive constraint.
static java.lang.String IRREV_CONSTRAINT
          The keyword used to denote the constraint for irreversible reactions.
static java.lang.String NUM_ACTIVE_FLUXES
          The keyword used to denote the number of active fluxes.
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 REV_CONSTRAINT
          The keyword used to denote the constraint for reversible reactions.
 
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
RandomConstraintsManager()
           
 
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 Interval getInactive(ManagerInput<java.lang.String,java.lang.String> input)
          Parses and returns the value for INACTIVE in the provided manager input.
static Interval getIrrevConstraint(ManagerInput<java.lang.String,java.lang.String> input)
          Parses and returns the value for IRREV_CONSTRAINT in the provided manager input.
static int getNumActiveFluxes(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out)
          Parses and returns the value for NUM_ACTIVE_FLUXES 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 MapTextOutputFile<java.lang.String,Interval> getOutputFile(ManagerInput<java.lang.String,java.lang.String> input, java.io.PrintWriter out, Fluxome fluxome)
          Returns an empty output file that is suitable for storing multiple sets of flux constraints.
static MapTextOutputFile<java.lang.String,Interval> getOutputFile(java.lang.String fileName, FileFormat format, java.util.Set<java.lang.String> headers, Fluxome fluxome)
          Returns an empty output file that is suitable for storing multiple sets of flux constraints.
static MapTextOutputFile<java.lang.String,Interval> getOutputFile(java.lang.String fileName, java.util.Set<java.lang.String> headers, IrrevRxnFluxome fluxome)
          Returns an empty output file that is suitable for storing multiple sets of flux constraints.
 RandConstGeneratorV1<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 Interval getRevConstraint(ManagerInput<java.lang.String,java.lang.String> input)
          Parses and returns the value for REV_CONSTRAINT in the provided manager input.
 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.fba.FbaManager
getCatalysts, getCatalysts, getConstraintTolerance, getConstraintTolerance, getFluxomeSolution, getIrrevRxnFluxome, getIrrevRxnFluxome, getIrrevRxnFluxome, getIrrevRxnFluxome, getIrrevRxnFluxome, getMixedFluxome, getMixedFluxome, getMixedFluxome, getMixedFluxome, getMixedFluxome, getMultiFluxVectorOutputFile, getMultiFluxVectorOutputFile, getRxnNameExprFormat, getRxnNameHeaders, getRxnNameHeaders, getSingleFluxVectorOutputFile, getSingleFluxVectorOutputFile, printFluxomeInfo, writeFluxome, writeFluxome, writeFluxome, writeFluxome
 
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

REV_CONSTRAINT

public static final java.lang.String REV_CONSTRAINT
The keyword used to denote the constraint for reversible reactions.

See Also:
Constant Field Values

IRREV_CONSTRAINT

public static final java.lang.String IRREV_CONSTRAINT
The keyword used to denote the constraint for irreversible reactions.

See Also:
Constant Field Values

INACTIVE

public static final java.lang.String INACTIVE
The keyword used to denote the inactive constraint.

See Also:
Constant Field Values

NUM_ACTIVE_FLUXES

public static final java.lang.String NUM_ACTIVE_FLUXES
The keyword used to denote the number of active fluxes.

See Also:
Constant Field Values

requiredKeywords

public static final UnmodifiableSet<java.lang.String> requiredKeywords
The set of keywords required to be present in the ManagerInput objects supplied to instances of this class.


optionalKeywords

public static final UnmodifiableSet<java.lang.String> optionalKeywords
The set of keywords understood, but not required, by instances of this class.

Constructor Detail

RandomConstraintsManager

public RandomConstraintsManager()
Method Detail

getIrrevConstraint

public static Interval getIrrevConstraint(ManagerInput<java.lang.String,java.lang.String> input)
Parses and returns the value for IRREV_CONSTRAINT in the provided manager input. The string must be parsable using IntervalFormatV1.

Parameters:
input - keyword-value pairs.
Returns:
the parsed value for IRREV_CONSTRAINT in the provided input.

getRevConstraint

public static Interval getRevConstraint(ManagerInput<java.lang.String,java.lang.String> input)
Parses and returns the value for REV_CONSTRAINT in the provided manager input. The string must be parsable using IntervalFormatV1.

Parameters:
input - keyword-value pairs.
Returns:
the parsed value for REV_CONSTRAINT in the provided input.

getInactive

public static Interval getInactive(ManagerInput<java.lang.String,java.lang.String> input)
Parses and returns the value for INACTIVE in the provided manager input. The string must be parsable using IntervalFormatV1.

Parameters:
input - keyword-value pairs.
Returns:
the parsed value for INACTIVE in the provided input.

getNumActiveFluxes

public static int getNumActiveFluxes(ManagerInput<java.lang.String,java.lang.String> input,
                                     java.io.PrintWriter out)
Parses and returns the value for NUM_ACTIVE_FLUXES in the provided manager input.

Parameters:
input - keyword-value pairs.
out - the print writer to which a status message will be printed.
Returns:
the parsed value for NUM_ACTIVE_FLUXES in the provided input.

getOutputFile

public static MapTextOutputFile<java.lang.String,Interval> getOutputFile(ManagerInput<java.lang.String,java.lang.String> input,
                                                                         java.io.PrintWriter out,
                                                                         Fluxome fluxome)
Returns an empty output file that is suitable for storing multiple sets of flux constraints. The values for AbstractProcessManager.OUTPUT_FILE_NAME, AbstractProcessManager.DATA_HEADERS, and AbstractProcessManager.FILE_FORMAT in the provided input are parsed and used to call the method #getOutputFile(String, FileFormat, Set, IrrevRxnFluxome).

Parameters:
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 constraints correspond.
Returns:
an empty output file that is suitable for storing multiple sets of flux constraints.

getOutputFile

public static MapTextOutputFile<java.lang.String,Interval> getOutputFile(java.lang.String fileName,
                                                                         FileFormat format,
                                                                         java.util.Set<java.lang.String> headers,
                                                                         Fluxome fluxome)
Returns an empty output file that is suitable for storing multiple sets of flux constraints. The format used to write data to this file is ConstraintsFileLineFormatV1.

Parameters:
fileName - the name of the file to be created.
format - the format of the file to be created. FileFormat.TEXT and FileFormat.GZIP_TEXT are currently the only supported choices.
headers - the set of objects whose constraints will be written to the file.
fluxome - the fluxome to which the constraints correspond.
Returns:
an empty output file that is suitable for storing multiple sets of flux constraints.

getOutputFile

public static MapTextOutputFile<java.lang.String,Interval> getOutputFile(java.lang.String fileName,
                                                                         java.util.Set<java.lang.String> headers,
                                                                         IrrevRxnFluxome fluxome)
Returns an empty output file that is suitable for storing multiple sets of flux constraints. The format used to write data to this text file is ConstraintsFileLineFormatV1.

Parameters:
fileName - the name of the file to be created.
headers - the set of objects whose constraints will be written to the file.
fluxome - the fluxome to which the constraints correspond.
Returns:
an empty output file that is suitable for storing multiple sets of flux constraints.

setInput

public 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. As the input is processed, informative messages are printed to the provided print writer.

Parameters:
input - all of the information required to prepare this process manager for execution.
out - the print writer to which all messages will be printed.

getRequiredKeys

public UnmodifiableSet<java.lang.String> getRequiredKeys()
Returns the set of keywords the provided ManagerInput object must contain.

Returns:
the set of keywords the provided ManagerInput object must contain.

getOptionalKeys

public UnmodifiableSet<java.lang.String> getOptionalKeys()
Returns the set of keywords the provided ManagerInput object does not necessarily have to contain.

Returns:
the set of keywords the provided ManagerInput object does not necessarily have to contain.

getProcess

public RandConstGeneratorV1<MixedFluxome> getProcess()
Returns the process this process manager controls.

Returns:
the process this process manager controls.
Throws:
java.lang.IllegalStateException - if no input was provided to this process manager via AbstractProcessManager.setInput(ManagerInput) or setInput(ManagerInput, PrintWriter)

execute

public 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.

Parameters:
out - the print writer where status messages will be printed.
Throws:
java.lang.IllegalStateException - if no input was provided to this process manager via AbstractProcessManager.setInput(ManagerInput) or setInput(ManagerInput, PrintWriter)