Microhomology { @NotNull public static String microhomologyAtDelete(int position, @NotNull final String refSequence, @NotNull final String ref) { if (refSequence.length() < position + ref.length()) { LOGGER.warn("Attempt to determine microhomology outside of sequence length"); return Strings.EMPTY; } return microhomologyAtDelete(position, ref.length(), refSequence.getBytes()).toString(); } private  Microhomology(); @NotNull static String microhomologyAtInsert(int position, @NotNull final String refSequence, @NotNull final String alt); @NotNull static String microhomologyAtDelete(int position, @NotNull final String refSequence, @NotNull final String ref); @NotNull static MicrohomologyContext microhomologyAtDeleteFromReadSequence(int position, @NotNull final String ref, @NotNull final byte[] readSequence); @NotNull static MicrohomologyContext microhomologyAtInsert(int position, int altLength, @NotNull final byte[] readSequence); @NotNull static MicrohomologyContext microhomologyAtDelete(int position, int refLength, @NotNull final byte[] sequence); @NotNull static MicrohomologyContext expandMicrohomologyRepeats(@NotNull final MicrohomologyContext result);  }
@Test public void worksInRepeatSection() { String expectedMicrohomology = "GTAACCAGGAGTGTATT"; String refGenome = "CGTAACCAGGAGTGTATTGTAACCAGGAGTGTATTGTAACCAGGAGTGTATTGTAACCAGGAGTGTATTGTAG"; String ref = "CGTAACCAGGAGTGTATT"; assertEquals(expectedMicrohomology, Microhomology.microhomologyAtDelete(0, refGenome, ref)); }
@Test public void worksOnSangerExamples() { String expectedMicrohomology = "TATC"; String refGenome = "GCACTGTATCCACTTGATATCATTAT"; assertEquals(expectedMicrohomology, Microhomology.microhomologyAtDelete(5, refGenome, "GTATCCACTTGA")); assertEquals(expectedMicrohomology, Microhomology.microhomologyAtDelete(6, refGenome, "TATCCACTTGAT")); assertEquals(expectedMicrohomology, Microhomology.microhomologyAtDelete(7, refGenome, "ATCCACTTGATA")); assertEquals(expectedMicrohomology, Microhomology.microhomologyAtDelete(8, refGenome, "TCCACTTGATAT")); assertEquals(expectedMicrohomology, Microhomology.microhomologyAtDelete(9, refGenome, "CCACTTGATATC")); }