コード例 #1
0
  public void mapEdgeColumn(final EncoreInteraction interaction, final CyRow row) {

    final Set<String> exp = interaction.getExperimentToPubmed().keySet();
    row.set(DETECTION_METHOD_ID, new ArrayList<String>(exp));

    final List<CrossReference> pubIDs = interaction.getPublicationIds();
    final List<String> pubIdList = new ArrayList<String>();
    final List<String> pubDBList = new ArrayList<String>();
    for (CrossReference pub : pubIDs) {
      pubIdList.add(pub.getIdentifier());
      pubDBList.add(pub.getDatabase());
    }
    if (pubIdList.isEmpty() == false) row.set(PUB_ID, pubIdList);
    if (pubDBList.isEmpty() == false) row.set(PUB_DB, pubDBList);

    // Interaction (use UniqueID)
    row.set(CyEdge.INTERACTION, interaction.getMappingIdDbNames());

    final List<Confidence> scores = interaction.getConfidenceValues();
    for (Confidence c : scores) {
      String type = c.getType();
      String value = c.getValue();

      if (row.getTable().getColumn(type) == null)
        row.getTable().createColumn(type, Double.class, true);

      try {
        double doubleVal = Double.parseDouble(value);
        row.set(type, doubleVal);
      } catch (NumberFormatException e) {
        // logger.warn("Invalid number string: " + value);
        // Ignore invalid number
      }
    }
  }
コード例 #2
0
  private void processSpecies(CyRow row, CrossReference ref) {
    if (ref != null) {
      final String name = ref.getText();
      final String speciesID = ref.getIdentifier();

      row.set(TAXNOMY, speciesID);
      row.set(TAXNOMY_NAME, name);
    }
  }