コード例 #1
0
 private double[] computeEdgeWeightExtrema(RelatedGenesEngineResponseDto response) {
   double[] extrema = new double[] {1, 0};
   for (NetworkDto network : response.getNetworks()) {
     for (InteractionDto interaction : network.getInteractions()) {
       double weight = interaction.getWeight() * network.getWeight();
       if (extrema[0] > weight) {
         extrema[0] = weight;
       }
       if (extrema[1] < weight) {
         extrema[1] = weight;
       }
     }
   }
   return extrema;
 }
コード例 #2
0
  private EnrichmentEngineRequestDto createEnrichmentRequest(
      RelatedGenesEngineResponseDto response) {
    if (human.getOntology() == null) {
      return null;
    }
    EnrichmentEngineRequestDto request = new EnrichmentEngineRequestDto();
    request.setProgressReporter(NullProgressReporter.instance());
    request.setMinCategories(MIN_CATEGORIES);
    request.setqValueThreshold(Q_VALUE_THRESHOLD);

    request.setOrganismId(human.getId());
    request.setOntologyId(human.getOntology().getId());

    Set<Long> nodes = new HashSet<Long>();
    for (NetworkDto network : response.getNetworks()) {
      for (InteractionDto interaction : network.getInteractions()) {
        nodes.add(interaction.getNodeVO1().getId());
        nodes.add(interaction.getNodeVO2().getId());
      }
    }
    request.setNodes(nodes);
    return request;
  }