예제 #1
0
  @Override
  public boolean remove(MetabolicReaction rxn) {

    // remove links to metabolites
    for (MetabolicParticipant p : rxn.getParticipants()) {
      Metabolite m = p.getMolecule();
      participantMap.get(m.getIdentifier()).remove(rxn);
      if (participantMap.get(m.getIdentifier()).isEmpty()) {
        participantMap.removeAll(m.getIdentifier());
      }
    }
    reactionMap.remove(rxn.getIdentifier(), rxn);
    return super.remove(rxn);
  }
예제 #2
0
 /**
  * Returns a list of reactions that contain Metabolite m If not mapping is found an empty
  * collection is returned
  */
 public Collection<MetabolicReaction> getReactions(Metabolite m) {
   return participantMap.get(m.getIdentifier());
 }
예제 #3
0
 /** @inheritDoc */
 public boolean removeKey(Metabolite m, Reaction reaction) {
   return participantMap.remove(m.getIdentifier(), reaction);
 }