コード例 #1
0
 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;
 }
コード例 #2
0
  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;
  }
コード例 #3
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;
  }