sbrt.kernel.fba
Class RxnComparer

java.lang.Object
  extended by sbrt.kernel.fba.RxnComparer

public class RxnComparer
extends java.lang.Object

This class is used to compare chemical reactions. Read the documentation for each of these methods carefully, because similarly named methods can perform very different operations.

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

Constructor Summary
RxnComparer()
           
 
Method Summary
static boolean equivChemRxns(ChemRxn rxn1, ChemRxn rxn2)
          Indicates if the provided chemical reactions are stoichiometrically equivalent.
static boolean equivIrrevRxns(IrrevRxn rxn1, IrrevRxn rxn2)
          Indicates if the provided irreversible reactions are stoichiometrically equivalent.
static boolean equivRevExchRxns(RevExchRxn rxn1, RevExchRxn rxn2)
          Indicates if the provided reversible exchange reactions are stoichiometrically equivalent.
static boolean equivRevRxns(RevRxn rxn1, RevRxn rxn2)
          Indicates if the provided reversible reactions are stoichiometrically equivalent.
static boolean equivSinkRxns(SinkRxn rxn1, SinkRxn rxn2)
          Indicates if the provided sink reactions are stoichiometrically equivalent.
static boolean equivSourceRxns(SourceRxn rxn1, SourceRxn rxn2)
          Indicates if the provided source reactions are stoichiometrically equivalent.
static
<T extends java.lang.Comparable<? super T>>
java.util.Collection<java.util.Set<T>>
getEquivIrrevRxnIds(java.util.Map<T,IrrevRxn> rxns)
          Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
static
<T extends java.lang.Comparable<? super T>>
java.util.Set<T>
getEquivIrrevRxnIds(T rxnId, java.util.Map<T,IrrevRxn> rxns)
          Returns the keys in the provided map that correspond to reactions that are stoichiometrically equivalent to the reaction in the map with the specified map key.
static
<T extends java.lang.Comparable<? super T>>
java.util.Map<T,IrrevRxn>
getEquivIrrevRxns(T rxnId, java.util.Map<T,IrrevRxn> rxns)
          Returns the reactions in the provided map that are stoichiometrically equivalent to the reaction in the map with the provided map key.
static
<T extends java.lang.Comparable<? super T>>
java.util.Collection<java.util.Set<T>>
getEquivRevExchRxnIds(java.util.Map<T,RevExchRxn> rxns)
          Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
static
<T extends java.lang.Comparable<? super T>>
java.util.Collection<java.util.Set<T>>
getEquivRevRxnIds(java.util.Map<T,RevRxn> rxns)
          Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
static
<T extends java.lang.Comparable<? super T>>
java.util.Set<T>
getEquivRevRxnIds(T rxnId, java.util.Map<T,RevRxn> rxns)
          Returns the keys in the provided map that correspond to reactions that are stoichiometrically equivalent to the reaction in the map with the specified map key.
static
<T extends java.lang.Comparable<? super T>>
java.util.Map<T,RevRxn>
getEquivRevRxns(T rxnId, java.util.Map<T,RevRxn> rxns)
          Returns the reactions in the provided map that are stoichiometrically equivalent to the reaction in the map with the provided map key.
static
<T extends java.lang.Comparable<? super T>>
java.util.Collection<java.util.Set<T>>
getEquivSinkRxnIds(java.util.Map<T,SinkRxn> rxns)
          Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
static
<T extends java.lang.Comparable<? super T>>
java.util.Collection<java.util.Set<T>>
getEquivSourceRxnIds(java.util.Map<T,SourceRxn> rxns)
          Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
static
<T extends java.lang.Comparable<? super T>>
java.util.Set<T>
getReverseIrrevRxnIds(T rxnId, java.util.Map<T,IrrevRxn> rxns)
          Returns all of the keys in the provided map that correspond to reactions that are the reverse of the reaction specified by the provided key.
static
<T extends java.lang.Comparable<? super T>>
java.util.Map<T,IrrevRxn>
getReverseIrrevRxns(T rxnId, java.util.Map<T,IrrevRxn> rxns)
          Returns all of the reactions in the provided map that are the reverse of the reaction specified by the provided key.
static
<T extends java.lang.Comparable<? super T>>
java.util.Set<T>
getReverseSinkRxnIds(SourceRxn source, java.util.Map<T,SinkRxn> rxns)
          Returns all of the keys in the provided map that correspond to the sink reactions that are the reverse of the provided source reaction.
static
<T extends java.lang.Comparable<? super T>>
java.util.Map<T,SinkRxn>
getReverseSinkRxns(SourceRxn source, java.util.Map<T,SinkRxn> rxns)
          Returns all of the sink reactions in the provided map that are the reverse of the provided source reaction.
static
<T extends java.lang.Comparable<? super T>>
java.util.Set<T>
getReverseSourceRxnIds(SinkRxn sink, java.util.Map<T,SourceRxn> rxns)
          Returns all of the keys in the provided map that correspond to the source reactions that are the reverse of the provided sink reaction.
static
<T extends java.lang.Comparable<? super T>>
java.util.Map<T,SourceRxn>
getReverseSourceRxns(SinkRxn sink, java.util.Map<T,SourceRxn> rxns)
          Returns all of the source reactions in the provided map that are the reverse of the provided sink reaction.
static boolean reverseChemRxns(ChemRxn rxn1, ChemRxn rxn2)
          Indicates if the provided chemical reactions are the reverse of each other.
static boolean reverseExchangeRxns(SinkRxn rxn1, SourceRxn rxn2)
          Indicates if the provided exchange reactions are the reverse of each other.
static boolean reverseExchangeRxns(SourceRxn rxn1, SinkRxn rxn2)
          Indicates if the provided exchange reactions are the reverse of each other.
static boolean reverseIrrevRxns(IrrevRxn rxn1, IrrevRxn rxn2)
          Indicates if the provided chemical reactions are the reverse of each other.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RxnComparer

public RxnComparer()
Method Detail

equivChemRxns

public static boolean equivChemRxns(ChemRxn rxn1,
                                    ChemRxn rxn2)
Indicates if the provided chemical reactions are stoichiometrically equivalent. For two reactions to be considered equivlent by this method, their respective reactant and product species must be identical, and their stoichiometric coefficients can only differ by a constant factor. For example, A <==> B and (2) A --> (2) B are considered stoichiometrically equivalent by this method, but A <==> B and B <==> A are not.

Parameters:
rxn1 - a chemical reaction.
rxn2 - a chemical reaction.
Returns:
true if the reactions are equivalent; false otherwise.

equivIrrevRxns

public static boolean equivIrrevRxns(IrrevRxn rxn1,
                                     IrrevRxn rxn2)
Indicates if the provided irreversible reactions are stoichiometrically equivalent. For two reactions to be considered equivlent by this method, their respective reactant and product species must be identical, and their stoichiometric coefficients can only differ by a constant factor. For example, A --> B and (2) A --> (2) B are considered stoichiometrically equivalent by this method.

Parameters:
rxn1 - an irreversible reaction.
rxn2 - an irreversible reaction.
Returns:
true if the irreversible reactions are equivalent; false otherwise.

equivSourceRxns

public static boolean equivSourceRxns(SourceRxn rxn1,
                                      SourceRxn rxn2)
Indicates if the provided source reactions are stoichiometrically equivalent. For two reactions to be considered equivlent by this method, their associated chemical species must be identical.

Parameters:
rxn1 - a source reaction.
rxn2 - a source reaction.
Returns:
true if the source reactions are equivalent; false otherwise.

equivSinkRxns

public static boolean equivSinkRxns(SinkRxn rxn1,
                                    SinkRxn rxn2)
Indicates if the provided sink reactions are stoichiometrically equivalent. For two reactions to be considered equivlent by this method, their associated chemical species must be identical.

Parameters:
rxn1 - a sink reaction.
rxn2 - a sink reaction.
Returns:
true if the sink reactions are equivalent; false otherwise.

equivRevExchRxns

public static boolean equivRevExchRxns(RevExchRxn rxn1,
                                       RevExchRxn rxn2)
Indicates if the provided reversible exchange reactions are stoichiometrically equivalent. For two reactions to be considered equivlent by this method, their associated chemical species must be identical.

Parameters:
rxn1 - a reversible exchange reaction.
rxn2 - a reversible exchange reaction.
Returns:
true if the reversible exchange reactions are equivalent; false otherwise.

equivRevRxns

public static boolean equivRevRxns(RevRxn rxn1,
                                   RevRxn rxn2)
Indicates if the provided reversible reactions are stoichiometrically equivalent. For two reactions to be considered equivlent by this method, the reactants of rxn1 must be equivalent to either the reactants or products of rxn2. The products of rxn1 must also be equivalent to either the reactants or products of rxn2, but not equivlent to the reactants of rxn1. For example, (2) A <==> (2) B and B <==> A are considered stoichiometrically equivalent by this method.

Parameters:
rxn1 - a reversible exchange reaction.
rxn2 - a reversible exchange reaction.
Returns:
true if the reversible exchange reactions are equivalent; false otherwise.

reverseChemRxns

public static boolean reverseChemRxns(ChemRxn rxn1,
                                      ChemRxn rxn2)
Indicates if the provided chemical reactions are the reverse of each other. For two reactions to be considered the reverse of each other by this method, the reactants and products of rxn1 must be stoichiometrically equivalent to the products and reactants, respectively, of rxn2. For example, A <==> B and (2) B --> (2) A are considered to be the reverse of each other by this method.

Parameters:
rxn1 - a reaction.
rxn2 - a reaction.
Returns:
true if the provided reactions are the reverse of each other; false otherwise.

reverseIrrevRxns

public static boolean reverseIrrevRxns(IrrevRxn rxn1,
                                       IrrevRxn rxn2)
Indicates if the provided chemical reactions are the reverse of each other. For two reactions to be considered the reverse of each other by this method, the reactants and products of rxn1 must be stoichiometrically equivalent to the products and reactants, respectively, of rxn2. For example, A --> B and (2) B --> (2) A are considered to be the reverse of each other by this method.

Parameters:
rxn1 - a reaction.
rxn2 - a reaction.
Returns:
true if the provided reactions are the reverse of each other; false otherwise.

reverseExchangeRxns

public static boolean reverseExchangeRxns(SourceRxn rxn1,
                                          SinkRxn rxn2)
Indicates if the provided exchange reactions are the reverse of each other.

Parameters:
rxn1 - a source reaction.
rxn2 - a sink reaction.
Returns:
true if the exchange reactions are associated with the same chemical species; false otherwise.

reverseExchangeRxns

public static boolean reverseExchangeRxns(SinkRxn rxn1,
                                          SourceRxn rxn2)
Indicates if the provided exchange reactions are the reverse of each other.

Parameters:
rxn1 - a sink reaction.
rxn2 - a source reaction.
Returns:
true if the exchange reactions are associated with the same chemical species; false otherwise.

getEquivIrrevRxns

public static <T extends java.lang.Comparable<? super T>> java.util.Map<T,IrrevRxn> getEquivIrrevRxns(T rxnId,
                                                                                                      java.util.Map<T,IrrevRxn> rxns)
Returns the reactions in the provided map that are stoichiometrically equivalent to the reaction in the map with the provided map key. The reaction corresponding to the provided key is not included in the returned map.

Type Parameters:
T - a comparable type.
Parameters:
rxnId - the map key of the reaction whose stoichiometrically equivalent reactions will be returned.
rxns - keys mapped to reactions.
Returns:
the entries of the provided map that contain reactions that are stoichiometrically equivalent to the specified reaction.
See Also:
equivIrrevRxns(IrrevRxn, IrrevRxn)

getEquivRevRxns

public static <T extends java.lang.Comparable<? super T>> java.util.Map<T,RevRxn> getEquivRevRxns(T rxnId,
                                                                                                  java.util.Map<T,RevRxn> rxns)
Returns the reactions in the provided map that are stoichiometrically equivalent to the reaction in the map with the provided map key. The reaction corresponding to the provided key is not included in the returned map.

Type Parameters:
T - a comparable type.
Parameters:
rxnId - the map key of the reaction whose stoichiometrically equivalent reactions will be returned.
rxns - keys mapped to reactions.
Returns:
the entries of the provided map that contain reactions that are stoichiometrically equivalent to the specified reaction.
See Also:
equivRevRxns(RevRxn, RevRxn)

getEquivIrrevRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Set<T> getEquivIrrevRxnIds(T rxnId,
                                                                                               java.util.Map<T,IrrevRxn> rxns)
Returns the keys in the provided map that correspond to reactions that are stoichiometrically equivalent to the reaction in the map with the specified map key. The provided key is not included in the returned set.

Type Parameters:
T - a comparable type.
Parameters:
rxnId - the map key of the reaction whose stoichiometrically equivalent reaction keys will be returned.
rxns - keys mapped to reactions.
Returns:
the keys of the provided map that correspond to reactions that are stoichiometrically equivalent to the specified reaction.
See Also:
equivIrrevRxns(IrrevRxn, IrrevRxn), getEquivIrrevRxns(Comparable, Map)

getEquivRevRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Set<T> getEquivRevRxnIds(T rxnId,
                                                                                             java.util.Map<T,RevRxn> rxns)
Returns the keys in the provided map that correspond to reactions that are stoichiometrically equivalent to the reaction in the map with the specified map key. The provided key is not included in the returned set.

Type Parameters:
T - a comparable type.
Parameters:
rxnId - the map key of the reaction whose stoichiometrically equivalent reaction keys will be returned.
rxns - keys mapped to reactions.
Returns:
the keys of the provided map that correspond to reactions that are stoichiometrically equivalent to the specified reaction.
See Also:
equivRevRxns(RevRxn, RevRxn), getEquivRevRxns(Comparable, Map)

getEquivIrrevRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Collection<java.util.Set<T>> getEquivIrrevRxnIds(java.util.Map<T,IrrevRxn> rxns)
Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.

Type Parameters:
T - a comparable type.
Parameters:
rxns - IDs mapped to their corresponding reactions.
Returns:
a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
See Also:
equivIrrevRxns(IrrevRxn, IrrevRxn)

getEquivRevRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Collection<java.util.Set<T>> getEquivRevRxnIds(java.util.Map<T,RevRxn> rxns)
Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.

Type Parameters:
T - a comparable type.
Parameters:
rxns - IDs mapped to their corresponding reactions.
Returns:
a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
See Also:
equivRevRxns(RevRxn, RevRxn)

getEquivSourceRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Collection<java.util.Set<T>> getEquivSourceRxnIds(java.util.Map<T,SourceRxn> rxns)
Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.

Type Parameters:
T - a comparable type.
Parameters:
rxns - IDs mapped to their corresponding reactions.
Returns:
a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
See Also:
equivSourceRxns(SourceRxn, SourceRxn)

getEquivSinkRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Collection<java.util.Set<T>> getEquivSinkRxnIds(java.util.Map<T,SinkRxn> rxns)
Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.

Type Parameters:
T - a comparable type.
Parameters:
rxns - IDs mapped to their corresponding reactions.
Returns:
a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
See Also:
equivSinkRxns(SinkRxn, SinkRxn)

getEquivRevExchRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Collection<java.util.Set<T>> getEquivRevExchRxnIds(java.util.Map<T,RevExchRxn> rxns)
Returns a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.

Type Parameters:
T - a comparable type.
Parameters:
rxns - IDs mapped to their corresponding reactions.
Returns:
a collection of sets of the names of stoichiometrically equivalent reactions contained in the provided map.
See Also:
equivRevExchRxns(RevExchRxn, RevExchRxn)

getReverseIrrevRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Set<T> getReverseIrrevRxnIds(T rxnId,
                                                                                                 java.util.Map<T,IrrevRxn> rxns)
Returns all of the keys in the provided map that correspond to reactions that are the reverse of the reaction specified by the provided key.

Type Parameters:
T - a comparable type.
Parameters:
rxnId - a key in the provided map that corresponds to the reaction for which reverse reactions will be returned.
rxns - keys mapped to irreversible reactions.
Returns:
the entries of the provided map that contain the identified reverse reactions.
See Also:
reverseIrrevRxns(IrrevRxn, IrrevRxn), getReverseIrrevRxns(Comparable, Map)

getReverseSourceRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Set<T> getReverseSourceRxnIds(SinkRxn sink,
                                                                                                  java.util.Map<T,SourceRxn> rxns)
Returns all of the keys in the provided map that correspond to the source reactions that are the reverse of the provided sink reaction.

Type Parameters:
T - a comparable type.
Parameters:
sink - a sink reaction.
rxns - keys mapped to source reactions.
Returns:
the keys of the provided map that correspond to the identified source reactions.
See Also:
reverseExchangeRxns(SinkRxn, SourceRxn), getReverseSourceRxns(SinkRxn, Map)

getReverseSinkRxnIds

public static <T extends java.lang.Comparable<? super T>> java.util.Set<T> getReverseSinkRxnIds(SourceRxn source,
                                                                                                java.util.Map<T,SinkRxn> rxns)
Returns all of the keys in the provided map that correspond to the sink reactions that are the reverse of the provided source reaction.

Type Parameters:
T - a comparable type.
Parameters:
source - a source reaction.
rxns - keys mapped to sink reactions.
Returns:
the keys of the provided map that correspond to the identified sink reactions.
See Also:
reverseExchangeRxns(SourceRxn, SinkRxn), getReverseSinkRxns(SourceRxn, Map)

getReverseIrrevRxns

public static <T extends java.lang.Comparable<? super T>> java.util.Map<T,IrrevRxn> getReverseIrrevRxns(T rxnId,
                                                                                                        java.util.Map<T,IrrevRxn> rxns)
Returns all of the reactions in the provided map that are the reverse of the reaction specified by the provided key.

Type Parameters:
T - a comparable type.
Parameters:
rxnId - a key in the provided map that corresponds to the reaction for which reverse reactions will be returned.
rxns - keys mapped to irreversible reactions.
Returns:
the entries of the provided map that contain the identified reverse reactions.
See Also:
reverseIrrevRxns(IrrevRxn, IrrevRxn)

getReverseSourceRxns

public static <T extends java.lang.Comparable<? super T>> java.util.Map<T,SourceRxn> getReverseSourceRxns(SinkRxn sink,
                                                                                                          java.util.Map<T,SourceRxn> rxns)
Returns all of the source reactions in the provided map that are the reverse of the provided sink reaction.

Type Parameters:
T - a comparable type.
Parameters:
sink - a sink reaction.
rxns - keys mapped to source reactions.
Returns:
the entries of the provided map that contain the identified source reactions.
See Also:
reverseExchangeRxns(SinkRxn, SourceRxn)

getReverseSinkRxns

public static <T extends java.lang.Comparable<? super T>> java.util.Map<T,SinkRxn> getReverseSinkRxns(SourceRxn source,
                                                                                                      java.util.Map<T,SinkRxn> rxns)
Returns all of the sink reactions in the provided map that are the reverse of the provided source reaction.

Type Parameters:
T - a comparable type.
Parameters:
source - a source reaction.
rxns - keys mapped to sink reactions.
Returns:
the entries of the provided map that contain the identified sink reactions.
See Also:
reverseExchangeRxns(SourceRxn, SinkRxn)