OrganismPartGroupingService { public Map<ColumnGroup, Set<OntologyTerm>> getOrgansGrouping(Collection<OntologyTerm> ontologyTerms) { return getGrouping(ontologyTerms, term -> organsMap.get().get(term.accession())); } @Inject  OrganismPartGroupingService(Path anatomicalSystemsFilePath, Path organsFilePath); Map<ColumnGroup, Set<OntologyTerm>> getAnatomicalSystemsGrouping(Collection<OntologyTerm> ontologyTerms); Map<ColumnGroup, Set<OntologyTerm>> getOrgansGrouping(Collection<OntologyTerm> ontologyTerms);  }
@Test public void readOrgans() { setOrgans("UBERON_0000020\tsense organ\tUBERON_0000004\tnose"); assertThat(subject.getOrgansGrouping(ImmutableList.of(OntologyTerm.create(""))).entrySet(), empty()); assertThat( subject.getOrgansGrouping(ImmutableList.of(OntologyTerm.create("UBERON_0000004", "nose"))).entrySet(), not(empty())); }
@Test public void ignoreCommentLines() { setOrgans("#organ id \t organ name \t tissue id \t tissue name", "UBERON_0000020\tsense organ\tUBERON_0000004\tnose"); assertThat(subject.getOrgansGrouping(ImmutableList.of(OntologyTerm.create(""))).entrySet(), empty()); assertThat( subject.getOrgansGrouping(ImmutableList.of(OntologyTerm.create("UBERON_0000004", "nose"))).entrySet(), not(empty())); }
@Test public void storeValuesById() { setOrgans("UBERON_0000020\tsense organ\tUBERON_0000004\tnose"); assertThat( subject.getOrgansGrouping(ImmutableList.of(OntologyTerm.create("UBERON_0000004"))).keySet(), is( subject.getOrgansGrouping(ImmutableList.of(OntologyTerm.create("UBERON_0000004", "nose"))) .keySet())); }