HotspotEnrichment implements SomaticEnrichment { @NotNull public static Hotspot fromVariant(@NotNull final VariantContext context) { if (context.getAttributeAsBoolean(HOTSPOT_FLAG, false)) { return Hotspot.HOTSPOT; } if (context.getAttributeAsBoolean(NEAR_HOTSPOT_FLAG, false)) { return Hotspot.NEAR_HOTSPOT; } return Hotspot.NON_HOTSPOT; } 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 testFromVariant() { VariantContext variant = createNonHotspotHG37(1, "G"); VariantContext nonhotspot = new VariantContextBuilder(variant).attribute("HOTSPOT", false).make(); assertEquals(Hotspot.NON_HOTSPOT, HotspotEnrichment.fromVariant(nonhotspot)); }