GenomicVariantUtil { public static String toRegion(GenomicVariant variant) { switch (variant.getType()) { case SUBSTITUTION: case INDEL: return variant.getChromosome() + ":" + variant.getStart() + "-" + variant.getEnd() + ":1/" + variant.getAlt(); case INSERTION: return variant.getChromosome() + ":" + variant.getEnd() + "-" + variant.getStart() + ":1/" + variant.getAlt(); case DELETION: return variant.getChromosome() + ":" + variant.getStart() + "-" + variant.getEnd() + ":1/-"; default: throw new InvalidHgvsException(); } }  static GenomicVariant fromHgvs(String hgvs); static GenomicVariant fromRegion(String region); static String toRegion(GenomicVariant variant); static ArrayList<String> getMafs(String maf_file); static GenomicVariant fromMaf(String maf, String[] key); static boolean isRegion(String variant); static boolean isMafFile(String file);  }
@Test public void testGenomicVariantToRegion() { GenomicVariant variant = new GenomicVariant("5", GenomicVariant.RefType.GENOMIC, 140532, 140532, GenomicVariant.Type.SUBSTITUTION, null, "C"); assertEquals("5:140532-140532:1/C", GenomicVariantUtil.toRegion(variant)); }
@Test public void testGenomicVariantInsertToRegion() { GenomicVariant variant = new GenomicVariant("5", GenomicVariant.RefType.GENOMIC, 140532, 140533, GenomicVariant.Type.INSERTION, null, "C"); assertEquals("5:140533-140532:1/C", GenomicVariantUtil.toRegion(variant)); }