private RelatedGenesEngineResponseDto runQuery(RelatedGenesEngineRequestDto request)
     throws DataStoreException {
   try {
     request.setProgressReporter(NullProgressReporter.instance());
     RelatedGenesEngineResponseDto result;
     result = mania.findRelated(request);
     request.setCombiningMethod(result.getCombiningMethodApplied());
     networkUtils.normalizeNetworkWeights(result);
     return result;
   } catch (ApplicationException e) {
     Logger logger = Logger.getLogger(getClass());
     logger.error("Unexpected error", e); // $NON-NLS-1$
     return null;
   }
 }
 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;
 }
  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;
  }