ViccCurator { @VisibleForTesting @Nullable Feature curate(@NotNull ViccEntry entry, @NotNull Feature feature) { CurationKey key = new CurationKey(entry.source(), feature.geneSymbol(), entry.transcriptId(), feature.name()); evaluatedCurationKeys.add(key); if (CurationFactory.FEATURE_BLACKLIST.contains(key)) { LOGGER.debug("Blacklisting feature '{}' for gene {} in {}", feature.name(), feature.geneSymbol(), entry.source()); return null; } else { String mappedFeatureName = CurationFactory.FEATURE_NAME_MAPPINGS.get(key); if (mappedFeatureName != null) { LOGGER.debug("Mapping feature '{}' to '{}' for gene {} in {}", feature.name(), mappedFeatureName, feature.geneSymbol(), entry.source()); return ImmutableFeature.builder().from(feature).name(mappedFeatureName).build(); } } return feature; } ViccCurator(); @NotNull List<ViccEntry> run(@NotNull List<ViccEntry> entries); void reportUnusedCurationEntries();  }
@Test public void canCurateFeatures() { CurationKey firstOncoKbKey = firstOncoKbMappingKey(); String firstMappedFeature = CurationFactory.FEATURE_NAME_MAPPINGS.get(firstOncoKbKey); ViccEntry entry = ViccTestFactory.testViccEntryWithSourceAndKbObject(ViccSource.ONCOKB, ViccTestFactory.testOncoKbWithTranscript(firstOncoKbKey.transcript())); Feature feature = ImmutableFeature.builder().geneSymbol(firstOncoKbKey.gene()).name(firstOncoKbKey.featureName()).build(); assertEquals(firstMappedFeature, new ViccCurator().curate(entry, feature).name()); }
@Test public void canBlacklistFeatures() { CurationKey firstOncoKbKey = firstOncoKbBlacklistKey(); ViccEntry entry = ViccTestFactory.testViccEntryWithSourceAndKbObject(ViccSource.ONCOKB, ViccTestFactory.testOncoKbWithTranscript(firstOncoKbKey.transcript())); Feature feature = ImmutableFeature.builder().geneSymbol(firstOncoKbKey.gene()).name(firstOncoKbKey.featureName()).build(); assertNull(new ViccCurator().curate(entry, feature)); }