コード例 #1
0
  /**
   * Sets Interactor Name and ID.
   *
   * @param interactor Data Services Interactor object.
   * @param jaxbInteractor JAXB Protein Interactor Object.
   */
  private void setNameId(Interactor interactor, InteractorElementType jaxbInteractor) {
    NamesType names = new NamesType();
    names.setShortLabel(interactor.getName());

    String fullName = (String) interactor.getAttribute(InteractorVocab.FULL_NAME);

    if (fullName != null) {
      names.setFullName(fullName);
    }

    jaxbInteractor.setNames(names);
    jaxbInteractor.setId(interactorId);
    interactorMap.put(interactor.getName(), interactorId);
    interactorId++;
  }
コード例 #2
0
  /**
   * Conditionally adds Protein to HashMap.
   *
   * @param interactor Interactor Object.
   * @param interactorMap HashMap of NonRedundant Interactors.
   */
  private void addToHashMap(Interactor interactor, HashMap interactorMap) {
    String orfName = interactor.getName();

    if (!interactorMap.containsKey(orfName)) {
      interactorMap.put(orfName, interactor);
    }
  }
コード例 #3
0
  /**
   * Gets the Interaction Participant List.
   *
   * @param interaction Interaction object.
   * @return Castor Participant List.
   */
  private InteractionElementType.ParticipantList getParticipantList(
      org.cytoscape.coreplugin.psi_mi.model.Interaction interaction) {
    InteractionElementType.ParticipantList participantList =
        new InteractionElementType.ParticipantList();

    List interactors = interaction.getInteractors();

    for (int i = 0; i < interactors.size(); i++) {
      Interactor interactor = (Interactor) interactors.get(i);
      String name = interactor.getName();
      ParticipantType participant1 = createParticipant(name);
      participantList.getParticipant().add(participant1);
    }

    return participantList;
  }