# Class Reaction

java.lang.Object
org.snpeff.reactome.Entity
org.snpeff.reactome.events.Event
org.snpeff.reactome.events.Reaction

All Implemented Interfaces:
  `Comparable<Entity>`

Direct Known Subclasses:
  `BlackBoxEvent, CatalystActivity, Complex, Depolymerisation, Pathway, Polymerisation`

public class Reaction extends Event
A reaction

Author:
  pcingola

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`Reaction.RegulationType`
Reaction regulation types

### Nested classes/interfaces inherited from class Entity

`Entity.TransferFunction`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected HashSet<Entity>`
`catalyst`
`protected HashMap<Entity,Double>`
`inputs`
`static final double`
`MAX_WEIGHT_SUM`
`protected HashSet<Entity>`
`outputs`
`protected HashMap<Entity, Reaction.RegulationType>`
`regulator`

### Fields inherited from class Entity

`BETA, compartment, debug, fixedOutput, geneIds, id, name, output, TRANSFER_FUNCTION, weight`

## Constructor Summary

Constructors
Constructor
Description
`Reaction(int id, String name)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addCatalyst(Entity e)`
`void`
`addInput(Entity e)`
`void`
`addOutput(Entity e)`
`void`
`addRegulator(Entity e, String type)`
`void`
`addRegulator(Entity e, Reaction.RegulationType type)`
`double`
`calc(HashSet<Entity> doneEntities)`
Calculate entities.
`HashSet<Entity>`
`getCatalyst()`
`Collection<Entity>`
`getInputs()`
`HashSet<Entity>`
`getOutputs()`
`HashMap<Entity, Reaction.RegulationType>`
`getRegulator()`
`boolean`
`isReaction()`
`void`
`scaleWeights()`
Scale weights so that they add to 1
`String`
`toString()`
`String`
`toString(int tabs, HashSet<Entity> done)`
`protected double`
`transferFunction(double h, double inCat, double inRegPos, double inRegNeg, double inRegReq)`
Transfer function

### Methods inherited from class Entity

`addGeneId, calc, compareTo, getCompartment, getGeneIds, getId, getName, getOutput, getWeight, hasOutput, isFixed, reset, setCompartment, setFixedOutput, setWeight, toStringSimple, transferFunction`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### MAX_WEIGHT_SUM

public static final double MAX_WEIGHT_SUM

See Also:
  - Constant Field Values

### inputs

protected HashMap<Entity,Double> inputs

### outputs

protected HashSet<Entity> outputs

### catalyst

protected HashSet<Entity> catalyst

### regulator

protected HashMap<Entity, Reaction.RegulationType> regulator

## Constructor Details

### Reaction

public Reaction(int id, String name)

## Method Details

### addCatalyst

public void addCatalyst(Entity e)

### addInput

public void addInput(Entity e)

### addOutput

public void addOutput(Entity e)

### addRegulator

public void addRegulator(Entity e, Reaction.RegulationType type)

### addRegulator

public void addRegulator(Entity e, String type)

### calc

public double calc(HashSet<Entity> doneEntities)
Calculate entities. Make sure we don't calculate twice (keep 'doneEntities' set up to date)

Overrides:
  `calc` in class `Entity`
Parameters:
  `doneEntities` -
Returns:

### getCatalyst

public HashSet<Entity> getCatalyst()

### getInputs

public Collection<Entity> getInputs()

### getOutputs

public HashSet<Entity> getOutputs()

### getRegulator

public HashMap<Entity, Reaction.RegulationType> getRegulator()

### isReaction

public boolean isReaction()

Overrides:
  `isReaction` in class `Entity`

### scaleWeights

public void scaleWeights()
Scale weights so that they add to 1

### toString

public String toString()

Overrides:
  `toString` in class `Entity`

### toString

public String toString(int tabs, HashSet<Entity> done)

Overrides:
  `toString` in class `Entity`

### transferFunction

protected double transferFunction(double h, double inCat, double inRegPos, double inRegNeg, double inRegReq)
Transfer function

Parameters:
  `h` -
Returns: