'STRAP:multiple sequence alignments '

charite.christo.metannogen
Class MReaction

java.lang.Object
  extended by charite.christo.metannogen.MObject
      extended by charite.christo.metannogen.MReaction
All Implemented Interfaces:
DialogStringMatch.Interface, Colored, HasChildren, HasID, HasName, HasRendererText, HasInfoText, Reaction, TabItemTipIcon.Interface, Cloneable

public class MReaction
extends MObject
implements Reaction, TabItemTipIcon.Interface, HasRendererText, Colored, HasChildren, HasInfoText, HasID, DialogStringMatch.Interface

First invokation of a getter my take several Mikroseconds. Then all outputs are cached and take Nanos. All metabolite and compartment Strings are finalized and can be compared by identity instead of equals which is faster.


Field Summary
static MReaction[] NONE
           
 
Fields inherited from interface charite.christo.metannogen.Reaction
DIRECTION_BACKWARD, DIRECTION_FORWARD, DIRECTION_REVERSIBLE, EQUALS_IGNORE_COMPARTMENT, EQUALS_IGNORE_ORIENTATION, EQUALS_IGNORE_PROTON, EQUALS_IGNORE_STOICHIOMETRY, EQUALS_RECORD_DIFFERENCES, FILTER_NOT_EXCLUDED, FILTER_REJECTED_DATASETS, TEXT_HUMAN_READABLE, TEXT_NO_COMPARTMENT, TEXT_SORT_METABOLITES, UNIQUE
 
Fields inherited from interface charite.christo.interfaces.HasRendererText
JLIST
 
Constructor Summary
MReaction()
           
MReaction(byte[] text)
           
MReaction(byte[] txt, int begin, int end)
           
MReaction(CharSequence text)
           
MReaction(String[] mmS, int[] stoichS, String[] ccS, String[] mmP, int[] stoichP, String[] ccP)
           
 
Method Summary
 boolean areAllCompartmentsTranslated()
           
 boolean areAllSpeciesTranslated()
          Short for Integer.parsInt(getAttribute(key)).
 boolean assertIntern()
          Checks whether the arrays have the same length and whether for all Strings s=s.intern();
 boolean equals(Reaction r, long options)
          Comparison
static String equationHumanReadable(ByteArray ba, boolean sumFormula)
           
 float[] floatValues()
           
 String[] getAllNames()
           
 String[] getBraceExpansionID()
           
 Object[] getChildren()
           
 Color getColor()
           
 CharSequence getComment()
           
 String getCompartmentOfSpecies(String m)
           
 String getCompartmentOfSpeciesP(String m)
           
 String getCompartmentOfSpeciesS(String m)
          Returns null if the given metabolite is not part of the reaction.
 String[] getCompartmentsP()
          List of Compartments for products.
 String[] getCompartmentsS()
          List of reactants
 String[] getCompartmentsWithEnzyme()
          Alle compartments fur diese Reaktionsgleichung, sorted alphabetically In der Implementierung wird getReactionsWithThisStoichiometry() iteriert und eine Liste aller compartments erstellt.
 int getConfidence()
           
 String[] getDatasetFields()
          If the reaction is created from a Dataset then return the dataset fields.
 float getDeltaG()
           
 int getDirection()
          See DIRECTION_FORWARD, DIRECTION_BACKWARD, DIRECTION_REVERSIBLE
 EC_Class[] getEC_classes()
           
 String[] getEC()
          Array of EC-numbers or an array of length 0.
 MReaction[] getIdenticalReactionsNC()
           
static String[] getIDsForProton()
           
 String getInfoText()
           
static String[] getLastEqualsDifferingMetabolite()
           
 String getName()
          The human readable name of the reaction.
 String[] getOrthologies()
           
 Pathway[] getPathways()
           
 String[] getProducts()
          List of products The following Arrays have exactly the same size: getCompartmentsP() getProducts() getSpeciesP() getStoichiometriesP()
 MReaction getReactionMetabolitesMappedNC(Map<String,String> mapMetabolites)
           
 MReaction[] getReactionsWithThisStoichiometry()
          Die Grundidee ist, dass initial ein Array von Reaktionen generiert wird, bei der jede Stoichiometrie nur einmal auftaucht.
 String getRendererText(int options)
           
 MSpecies[] getSpecies()
           
 MSpecies[] getSpeciesP()
          List of products
 MSpecies[] getSpeciesS()
          List of reactants
 int[] getStoichiometriesP()
          Stoichiometries of products.
 int[] getStoichiometriesS()
          Stoichiometries of reactants.
 int getStoichiometryP(String metabolite, String compartment)
           
 int getStoichiometryS(String metabolite, String compartment)
          Compartment may be null.
 String[] getSubstrates()
          List of reactants The following Arrays have exactly the same size: getCompartmentsS() getSubstrates() getSpeciesS() getStoichiometriesS()
 String[] getSubstratesAndProducts()
          All metabolites as a unique sorted list
 String[] getSubstratesAndProductsWithoutProton()
          Metabolite IDs, skip hydrogen
 int getSubstratesAndProductsWithoutProtonHashCode()
          Dadurch wird die equals Methode extrem schnell
 String[] getSubstratesAndProductsWithoutProtonMapped()
           
 TabItemTipIcon getTabItemTipIcon(MouseEvent ev)
           
 boolean hasChildren()
           
 int hashCode(Object o)
           
 boolean isAlreadyInOtherNetwork()
           
 boolean isBiomass()
           
 boolean isExcluded()
          Exists but should not be used in file export.
 boolean isGeneral()
           
 boolean isReversible()
          Identical to getDirection()==DIRECTION_REVERSIBLE
 boolean isTransport()
          True if reactants and products have different compartments.
static void main(String[] argv)
           
 void setAlreadyInOtherNetwork(boolean b)
           
 void setBraceExpansionID(String[] braceID)
           
 void setColor(Color color)
           
 void setComment(CharSequence s)
           
 MReaction setCompartmentDictionary(Map<String,String> map)
           
 void setConfidence(int c)
           
 void setDatasetFields(String[] fields)
           
 MReaction setDefaultCompartment(String compartment)
          When parsing from text, metabolites without underscor_compartment are assigned the default compartment.
 void setDefinition(CharSequence s)
           
 void setDeltaG(float dg)
           
 void setDirection(int dir)
          See DIRECTION_FORWARD, DIRECTION_BACKWARD, DIRECTION_REVERSIBLE
 void setEC(CharSequence s)
           
 void setEC(String[] ec)
           
 void setEquation(CharSequence text)
           
 void setExcluded(boolean yesNo)
          Exists but should not be used in file export
static void setIDsForProton(String[] idsOfProton)
           
 MReaction setMetaboliteDictionary(Map<String,String> map)
          Used to convert metabolite ID's when parsing from String
 void setOrthologies(CharSequence s)
           
 void setPathways(Pathway[] ss)
           
 void setReactionsWithThisStoichiometry(Reaction[] rr)
           
 void setSubstratesOrProducts(String[] metabolite, int[] stoich, String[] compart, boolean isProduct)
           
 MSpecies speciesForID(CharSequence id)
           
 MSpecies[] speciesFromIDs(CharSequence[] ss)
           
 String toText(int options)
          Options may be 0 or TEXT_HUMAN_READABLE
 String toTextSorted(long options)
           
 MReaction translateMetabolitesAndCompartments(Map<String,String> mapM, Map<String,String> mapC)
           
 
Methods inherited from class charite.christo.metannogen.MObject
clone, getAttribute, getAttributeF, getAttributeI, getAttributes, getClientProperty, getClientPropertyMapAsString, getCollection, getEntireText, getHaystacksForStringSearch, getID, getIDMapped, getIDMappedSimilar, getParent, getTopAncestor, getTopAncestorID, putClientProperty, setAttributes, setCollection, setID, setName, setParent, setTextBlock, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface charite.christo.metannogen.Reaction
getAttribute, getAttributeF, getAttributeI, getAttributes, getClientProperty, getCollection, getID, putClientProperty
 
Methods inherited from interface charite.christo.interfaces.HasID
getID
 
Methods inherited from interface charite.christo.DialogStringMatch.Interface
getHaystacksForStringSearch
 

Field Detail

NONE

public static final MReaction[] NONE
Constructor Detail

MReaction

public MReaction()

MReaction

public MReaction(CharSequence text)

MReaction

public MReaction(byte[] text)

MReaction

public MReaction(byte[] txt,
                 int begin,
                 int end)

MReaction

public MReaction(String[] mmS,
                 int[] stoichS,
                 String[] ccS,
                 String[] mmP,
                 int[] stoichP,
                 String[] ccP)
Method Detail

setOrthologies

public void setOrthologies(CharSequence s)

setDefinition

public void setDefinition(CharSequence s)

setComment

public void setComment(CharSequence s)

getComment

public final CharSequence getComment()

getReactionsWithThisStoichiometry

public MReaction[] getReactionsWithThisStoichiometry()
Description copied from interface: Reaction
Die Grundidee ist, dass initial ein Array von Reaktionen generiert wird, bei der jede Stoichiometrie nur einmal auftaucht. Fur die mitochondriale und Cytosolische Variante einer Reaktion wird nur ein Vertreter in das Array aufgenommen. Mit dieser Abfrage kommt man an die Reaktionen aller Compartments.

Specified by:
getReactionsWithThisStoichiometry in interface Reaction

setReactionsWithThisStoichiometry

public void setReactionsWithThisStoichiometry(Reaction[] rr)
Specified by:
setReactionsWithThisStoichiometry in interface Reaction

getCompartmentsWithEnzyme

public String[] getCompartmentsWithEnzyme()
Description copied from interface: Reaction
Alle compartments fur diese Reaktionsgleichung, sorted alphabetically In der Implementierung wird getReactionsWithThisStoichiometry() iteriert und eine Liste aller compartments erstellt. In diesem Bsp {"cyto","mitoMx"}

Specified by:
getCompartmentsWithEnzyme in interface Reaction

isTransport

public boolean isTransport()
Description copied from interface: Reaction
True if reactants and products have different compartments. Bug: ficytC[m] + h2o[c] + so3[c] --> (2) focytC[m] + (2) h[c] + so4[c] is falsly a transport

Specified by:
isTransport in interface Reaction

isBiomass

public boolean isBiomass()
Specified by:
isBiomass in interface Reaction

getDeltaG

public float getDeltaG()
Specified by:
getDeltaG in interface Reaction

setDeltaG

public void setDeltaG(float dg)
Specified by:
setDeltaG in interface Reaction

speciesForID

public MSpecies speciesForID(CharSequence id)

speciesFromIDs

public MSpecies[] speciesFromIDs(CharSequence[] ss)

getSpeciesS

public MSpecies[] getSpeciesS()
Description copied from interface: Reaction
List of reactants

Specified by:
getSpeciesS in interface Reaction

getSpeciesP

public MSpecies[] getSpeciesP()
Description copied from interface: Reaction
List of products

Specified by:
getSpeciesP in interface Reaction

getSpecies

public MSpecies[] getSpecies()

getSubstratesAndProductsWithoutProtonMapped

public String[] getSubstratesAndProductsWithoutProtonMapped()

getSubstratesAndProductsWithoutProton

public String[] getSubstratesAndProductsWithoutProton()
Metabolite IDs, skip hydrogen

Specified by:
getSubstratesAndProductsWithoutProton in interface Reaction

getConfidence

public int getConfidence()
Specified by:
getConfidence in interface Reaction

setConfidence

public void setConfidence(int c)

setDefaultCompartment

public MReaction setDefaultCompartment(String compartment)
When parsing from text, metabolites without underscor_compartment are assigned the default compartment.


setEquation

public void setEquation(CharSequence text)

setIDsForProton

public static void setIDsForProton(String[] idsOfProton)

getIDsForProton

public static String[] getIDsForProton()

setMetaboliteDictionary

public MReaction setMetaboliteDictionary(Map<String,String> map)
Used to convert metabolite ID's when parsing from String


setCompartmentDictionary

public MReaction setCompartmentDictionary(Map<String,String> map)

getSubstratesAndProducts

public String[] getSubstratesAndProducts()
All metabolites as a unique sorted list

Specified by:
getSubstratesAndProducts in interface Reaction

getProducts

public String[] getProducts()
Description copied from interface: Reaction
List of products The following Arrays have exactly the same size: getCompartmentsP() getProducts() getSpeciesP() getStoichiometriesP()

Specified by:
getProducts in interface Reaction

getSubstrates

public String[] getSubstrates()
Description copied from interface: Reaction
List of reactants The following Arrays have exactly the same size: getCompartmentsS() getSubstrates() getSpeciesS() getStoichiometriesS()

Specified by:
getSubstrates in interface Reaction

getCompartmentsP

public String[] getCompartmentsP()
Description copied from interface: Reaction
List of Compartments for products.

Specified by:
getCompartmentsP in interface Reaction

getCompartmentsS

public String[] getCompartmentsS()
Description copied from interface: Reaction
List of reactants

Specified by:
getCompartmentsS in interface Reaction

getCompartmentOfSpeciesS

public String getCompartmentOfSpeciesS(String m)
Description copied from interface: Reaction
Returns null if the given metabolite is not part of the reaction.

Specified by:
getCompartmentOfSpeciesS in interface Reaction

getCompartmentOfSpeciesP

public String getCompartmentOfSpeciesP(String m)
Specified by:
getCompartmentOfSpeciesP in interface Reaction

getCompartmentOfSpecies

public String getCompartmentOfSpecies(String m)

getStoichiometriesS

public int[] getStoichiometriesS()
Description copied from interface: Reaction
Stoichiometries of reactants.

Specified by:
getStoichiometriesS in interface Reaction

getStoichiometriesP

public int[] getStoichiometriesP()
Description copied from interface: Reaction
Stoichiometries of products.

Specified by:
getStoichiometriesP in interface Reaction

getStoichiometryS

public int getStoichiometryS(String metabolite,
                             String compartment)
Description copied from interface: Reaction
Compartment may be null. Returns 0 if the metabolite is not in the reaction.

Specified by:
getStoichiometryS in interface Reaction

getStoichiometryP

public int getStoichiometryP(String metabolite,
                             String compartment)
Specified by:
getStoichiometryP in interface Reaction

setSubstratesOrProducts

public void setSubstratesOrProducts(String[] metabolite,
                                    int[] stoich,
                                    String[] compart,
                                    boolean isProduct)

toText

public String toText(int options)
Description copied from interface: Reaction
Options may be 0 or TEXT_HUMAN_READABLE

Specified by:
toText in interface Reaction

getSubstratesAndProductsWithoutProtonHashCode

public int getSubstratesAndProductsWithoutProtonHashCode()
Description copied from interface: Reaction
Dadurch wird die equals Methode extrem schnell

Specified by:
getSubstratesAndProductsWithoutProtonHashCode in interface Reaction

equals

public boolean equals(Reaction r,
                      long options)
Description copied from interface: Reaction
Comparison

Specified by:
equals in interface Reaction
Returns:
true if both Reactions are identical

getLastEqualsDifferingMetabolite

public static final String[] getLastEqualsDifferingMetabolite()

areAllSpeciesTranslated

public boolean areAllSpeciesTranslated()
Description copied from interface: Reaction
Short for Integer.parsInt(getAttribute(key)).

Specified by:
areAllSpeciesTranslated in interface Reaction

areAllCompartmentsTranslated

public boolean areAllCompartmentsTranslated()

translateMetabolitesAndCompartments

public MReaction translateMetabolitesAndCompartments(Map<String,String> mapM,
                                                     Map<String,String> mapC)

main

public static void main(String[] argv)

getName

public final String getName()
Description copied from interface: Reaction
The human readable name of the reaction.

Specified by:
getName in interface HasName
Specified by:
getName in interface Reaction
Overrides:
getName in class MObject

hashCode

public final int hashCode(Object o)

toTextSorted

public String toTextSorted(long options)

floatValues

public final float[] floatValues()

isGeneral

public boolean isGeneral()

setDirection

public void setDirection(int dir)
Description copied from interface: Reaction
See DIRECTION_FORWARD, DIRECTION_BACKWARD, DIRECTION_REVERSIBLE

Specified by:
setDirection in interface Reaction

getDirection

public int getDirection()
Description copied from interface: Reaction
See DIRECTION_FORWARD, DIRECTION_BACKWARD, DIRECTION_REVERSIBLE

Specified by:
getDirection in interface Reaction

isReversible

public boolean isReversible()
Description copied from interface: Reaction
Identical to getDirection()==DIRECTION_REVERSIBLE

Specified by:
isReversible in interface Reaction

getEC

public String[] getEC()
Description copied from interface: Reaction
Array of EC-numbers or an array of length 0.

Specified by:
getEC in interface Reaction

setEC

public void setEC(CharSequence s)

setEC

public void setEC(String[] ec)

getEC_classes

public EC_Class[] getEC_classes()

getOrthologies

public String[] getOrthologies()

setPathways

public void setPathways(Pathway[] ss)

getPathways

public Pathway[] getPathways()

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface HasChildren

getChildren

public Object[] getChildren()
Specified by:
getChildren in interface HasChildren

getIdenticalReactionsNC

public MReaction[] getIdenticalReactionsNC()

getInfoText

public final String getInfoText()
Specified by:
getInfoText in interface HasInfoText

getColor

public final Color getColor()
Specified by:
getColor in interface Colored

setColor

public final void setColor(Color color)
Specified by:
setColor in interface Colored

getRendererText

public String getRendererText(int options)
Specified by:
getRendererText in interface HasRendererText

getTabItemTipIcon

public TabItemTipIcon getTabItemTipIcon(MouseEvent ev)
Specified by:
getTabItemTipIcon in interface TabItemTipIcon.Interface

getReactionMetabolitesMappedNC

public MReaction getReactionMetabolitesMappedNC(Map<String,String> mapMetabolites)

setAlreadyInOtherNetwork

public void setAlreadyInOtherNetwork(boolean b)

isAlreadyInOtherNetwork

public boolean isAlreadyInOtherNetwork()

setExcluded

public void setExcluded(boolean yesNo)
Description copied from interface: Reaction
Exists but should not be used in file export

Specified by:
setExcluded in interface Reaction

isExcluded

public boolean isExcluded()
Description copied from interface: Reaction
Exists but should not be used in file export. See FILTER_NOT_EXCLUDED.

Specified by:
isExcluded in interface Reaction

getDatasetFields

public String[] getDatasetFields()
Description copied from interface: Reaction
If the reaction is created from a Dataset then return the dataset fields. This method, can be used to check the data that was entered user.

Specified by:
getDatasetFields in interface Reaction

setDatasetFields

public void setDatasetFields(String[] fields)

assertIntern

public boolean assertIntern()
Checks whether the arrays have the same length and whether for all Strings s=s.intern();


equationHumanReadable

public static String equationHumanReadable(ByteArray ba,
                                           boolean sumFormula)

getAllNames

public String[] getAllNames()

setBraceExpansionID

public void setBraceExpansionID(String[] braceID)

getBraceExpansionID

public String[] getBraceExpansionID()

'STRAP:multiple sequence alignments '

'The most important classes are StrapAlign, StrapProtein and StrapEvent.'