@Test public void testHgvsDeletionToGenomicVariantWithoutRef() { GenomicVariant variant = GenomicVariantUtil.fromHgvs("1:g.4849848_4849857del"); assertEquals("1", variant.getChromosome()); assertEquals(GenomicVariant.RefType.GENOMIC, variant.getRefType()); assertEquals((Integer) 4849848, variant.getStart()); assertEquals((Integer) 4849857, variant.getEnd()); assertEquals("-", variant.getRef()); assertEquals(GenomicVariant.Type.DELETION, variant.getType()); assertEquals("-", variant.getAlt()); }
public static GenomicVariant fromHgvs(String hgvs) { GenomicVariant.RefType refType = getRefTypeFromHgvs(hgvs); String chr = getChrFromHgvs(hgvs); Integer start = getStartFromHgvs(hgvs); Integer end = getEndFromHgvs(hgvs, start); GenomicVariant.Type type = getTypeFromHgvs(hgvs); if (type == GenomicVariant.Type.INSERTION && end != start + 1) { throw new InvalidHgvsException("insertion encountered where end position did not equal start position plus 1"); } String ref = getRefFromHgvs(hgvs, type); String alt = getAltFromHgvs(hgvs, type); return new GenomicVariant(chr, refType, start, end, type, ref, alt); }
GenomicVariantUtil { public static GenomicVariant fromHgvs(String hgvs) { GenomicVariant.RefType refType = getRefTypeFromHgvs(hgvs); String chr = getChrFromHgvs(hgvs); Integer start = getStartFromHgvs(hgvs); Integer end = getEndFromHgvs(hgvs, start); GenomicVariant.Type type = getTypeFromHgvs(hgvs); if (type == GenomicVariant.Type.INSERTION && end != start + 1) { throw new InvalidHgvsException("insertion encountered where end position did not equal start position plus 1"); } String ref = getRefFromHgvs(hgvs, type); String alt = getAltFromHgvs(hgvs, type); return new GenomicVariant(chr, refType, start, end, type, ref, alt); } }
GenomicVariantUtil { public static GenomicVariant fromHgvs(String hgvs) { GenomicVariant.RefType refType = getRefTypeFromHgvs(hgvs); String chr = getChrFromHgvs(hgvs); Integer start = getStartFromHgvs(hgvs); Integer end = getEndFromHgvs(hgvs, start); GenomicVariant.Type type = getTypeFromHgvs(hgvs); if (type == GenomicVariant.Type.INSERTION && end != start + 1) { throw new InvalidHgvsException("insertion encountered where end position did not equal start position plus 1"); } String ref = getRefFromHgvs(hgvs, type); String alt = getAltFromHgvs(hgvs, type); return new GenomicVariant(chr, refType, start, end, type, ref, alt); }  }
GenomicVariantUtil { public static GenomicVariant fromHgvs(String hgvs) { GenomicVariant.RefType refType = getRefTypeFromHgvs(hgvs); String chr = getChrFromHgvs(hgvs); Integer start = getStartFromHgvs(hgvs); Integer end = getEndFromHgvs(hgvs, start); GenomicVariant.Type type = getTypeFromHgvs(hgvs); if (type == GenomicVariant.Type.INSERTION && end != start + 1) { throw new InvalidHgvsException("insertion encountered where end position did not equal start position plus 1"); } String ref = getRefFromHgvs(hgvs, type); String alt = getAltFromHgvs(hgvs, type); return new GenomicVariant(chr, refType, start, end, type, ref, alt); }  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); }
GenomicVariantUtil { public static GenomicVariant fromHgvs(String hgvs) { GenomicVariant.RefType refType = getRefTypeFromHgvs(hgvs); String chr = getChrFromHgvs(hgvs); Integer start = getStartFromHgvs(hgvs); Integer end = getEndFromHgvs(hgvs, start); GenomicVariant.Type type = getTypeFromHgvs(hgvs); if (type == GenomicVariant.Type.INSERTION && end != start + 1) { throw new InvalidHgvsException("insertion encountered where end position did not equal start position plus 1"); } String ref = getRefFromHgvs(hgvs, type); String alt = getAltFromHgvs(hgvs, type); return new GenomicVariant(chr, refType, start, end, type, ref, alt); }  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);  }