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; }
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; }