@Test public void propertyValuesByTypeGeneOntology() { assertThat( subject.propertyValuesByType("GO:0000000", false), hasEntry(is(BioentityPropertyName.GO), isA(Set.class))); verify(goPoTermTraderMock).get("GO:0000000"); verifyZeroInteractions(reactomeClientMock, interProTermTraderMock); }
public Map<BioentityPropertyName, Set<String>> propertyValuesByType(String identifier, boolean isPlant) { identifier = identifier.toUpperCase(); if (GeneSetUtil.matchesReactomeID(identifier)) { if (isPlant) { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPlantPathwayName(identifier).orElse("")); } else { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPathwayName(identifier).orElse("")); } } else if (GeneSetUtil.matchesGeneOntologyAccession(identifier)) { return propertyValuesByType( GO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesPlantOntologyAccession(identifier)) { return propertyValuesByType( PO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesInterProAccession(identifier)) { return propertyValuesByType( INTERPRO, identifier, interProTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else { return ImmutableMap.of(); } }
GeneSetPropertyService { public Map<BioentityPropertyName, Set<String>> propertyValuesByType(String identifier, boolean isPlant) { identifier = identifier.toUpperCase(); if (GeneSetUtil.matchesReactomeID(identifier)) { if (isPlant) { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPlantPathwayName(identifier).orElse("")); } else { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPathwayName(identifier).orElse("")); } } else if (GeneSetUtil.matchesGeneOntologyAccession(identifier)) { return propertyValuesByType( GO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesPlantOntologyAccession(identifier)) { return propertyValuesByType( PO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesInterProAccession(identifier)) { return propertyValuesByType( INTERPRO, identifier, interProTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else { return ImmutableMap.of(); } } }
GeneSetPropertyService { public Map<BioentityPropertyName, Set<String>> propertyValuesByType(String identifier, boolean isPlant) { identifier = identifier.toUpperCase(); if (GeneSetUtil.matchesReactomeID(identifier)) { if (isPlant) { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPlantPathwayName(identifier).orElse("")); } else { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPathwayName(identifier).orElse("")); } } else if (GeneSetUtil.matchesGeneOntologyAccession(identifier)) { return propertyValuesByType( GO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesPlantOntologyAccession(identifier)) { return propertyValuesByType( PO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesInterProAccession(identifier)) { return propertyValuesByType( INTERPRO, identifier, interProTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else { return ImmutableMap.of(); } } @Inject  GeneSetPropertyService(GoPoTrader goPoTermTrader,
                                  InterProTrader interProTermTrader,
                                  ReactomeClient reactomeClient); }
GeneSetPropertyService { public Map<BioentityPropertyName, Set<String>> propertyValuesByType(String identifier, boolean isPlant) { identifier = identifier.toUpperCase(); if (GeneSetUtil.matchesReactomeID(identifier)) { if (isPlant) { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPlantPathwayName(identifier).orElse("")); } else { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPathwayName(identifier).orElse("")); } } else if (GeneSetUtil.matchesGeneOntologyAccession(identifier)) { return propertyValuesByType( GO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesPlantOntologyAccession(identifier)) { return propertyValuesByType( PO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesInterProAccession(identifier)) { return propertyValuesByType( INTERPRO, identifier, interProTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else { return ImmutableMap.of(); } } @Inject  GeneSetPropertyService(GoPoTrader goPoTermTrader,
                                  InterProTrader interProTermTrader,
                                  ReactomeClient reactomeClient); Map<BioentityPropertyName, Set<String>> propertyValuesByType(String identifier, boolean isPlant); }
GeneSetPropertyService { public Map<BioentityPropertyName, Set<String>> propertyValuesByType(String identifier, boolean isPlant) { identifier = identifier.toUpperCase(); if (GeneSetUtil.matchesReactomeID(identifier)) { if (isPlant) { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPlantPathwayName(identifier).orElse("")); } else { return propertyValuesByType( PATHWAYID, identifier, reactomeClient.getPathwayName(identifier).orElse("")); } } else if (GeneSetUtil.matchesGeneOntologyAccession(identifier)) { return propertyValuesByType( GO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesPlantOntologyAccession(identifier)) { return propertyValuesByType( PO, identifier, goPoTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else if (GeneSetUtil.matchesInterProAccession(identifier)) { return propertyValuesByType( INTERPRO, identifier, interProTermTrader.get(identifier).map(OntologyTerm::name).orElse("")); } else { return ImmutableMap.of(); } } @Inject  GeneSetPropertyService(GoPoTrader goPoTermTrader,
                                  InterProTrader interProTermTrader,
                                  ReactomeClient reactomeClient); Map<BioentityPropertyName, Set<String>> propertyValuesByType(String identifier, boolean isPlant); static final List<BioentityPropertyName> ALL; }