HotspotEnrichment implements SomaticEnrichment { private static boolean exactMatch(@NotNull final VariantHotspot hotspot, @NotNull final VariantContext variant) { return hotspot.position() == variant.getStart() && hotspot.ref().equals(variant.getReference().getBaseString()) && variant.getAlternateAlleles().stream().map(Allele::getBaseString).collect(Collectors.toList()).contains(hotspot.alt()); } HotspotEnrichment(@NotNull final Multimap<Chromosome, VariantHotspot> hotspots); @NotNull static HotspotEnrichment fromHotspotsFile(@NotNull final String hotspotsFile); @NotNull @Override ImmutableSomaticVariantImpl.Builder enrich(@NotNull final ImmutableSomaticVariantImpl.Builder builder,
            @NotNull final VariantContext context); @NotNull static Hotspot fromVariant(@NotNull final VariantContext context); boolean isOnHotspot(@NotNull final VariantContext context); boolean isNearHotspot(@NotNull final VariantContext context); static final int DISTANCE; static final String HOTSPOT_FLAG; static final String NEAR_HOTSPOT_FLAG; }
@Test public void testExactMatch() { final String hotspotRef = "GATTACA"; final VariantHotspot hotspot = ImmutableVariantHotspotImpl.builder().chromosome("11").position(100).ref(hotspotRef).alt("A").build(); assertOverlap(Hotspot.HOTSPOT, hotspot, 100, hotspotRef); }