private Organism getHumanOrganism(DataSet data) throws DataStoreException {
   String human = "H. Sapiens";
   human = human.toLowerCase();
   List<Organism> organisms = data.getMediatorProvider().getOrganismMediator().getAllOrganisms();
   for (Organism organism : organisms) {
     String organismName = organism.getName();
     String organismAlias = organism.getAlias();
     if (organismName.toLowerCase().equals(human) || organismAlias.toLowerCase().equals(human)) {
       return organism;
     }
   }
   return null;
 }
  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;
  }
 private RelatedGenesEngineRequestDto createRequest() throws ApplicationException {
   RelatedGenesEngineRequestDto request = new RelatedGenesEngineRequestDto();
   request.setNamespace(GeneMania.DEFAULT_NAMESPACE);
   request.setOrganismId(human.getId());
   request.setInteractionNetworks(collapseNetworks(networks));
   Set<Long> nodes = new HashSet<Long>();
   for (String geneName : genes) {
     nodes.add(data.getCompletionProvider(human).getNodeId(geneName));
   }
   request.setPositiveNodes(nodes);
   request.setLimitResults(geneLimit);
   request.setCombiningMethod(combiningMethod);
   request.setScoringMethod(org.genemania.type.ScoringMethod.DISCRIMINANT);
   return request;
 }
  public void setNetworks(Set<String> n) {
    Map<InteractionNetworkGroup, Collection<InteractionNetwork>> groupMembers =
        new HashMap<InteractionNetworkGroup, Collection<InteractionNetwork>>();
    Collection<InteractionNetworkGroup> groups = human.getInteractionNetworkGroups();
    Set<String> notHandled = n;
    for (InteractionNetworkGroup group : groups) {
      if (n.contains(group.getName())) {
        notHandled.remove(group.getName());
        List<InteractionNetwork> networkMembers = new ArrayList<InteractionNetwork>();
        Collection<InteractionNetwork> networks = group.getInteractionNetworks();
        for (InteractionNetwork network : networks) {

          networkMembers.add(network);
        }
        if (networkMembers.size() > 0) {
          groupMembers.put(group, networkMembers);
        }
      }
    }
    networks = groupMembers;
  }