/** * @param other VariantContext whose alleles to compare against * @return true if this VariantContext has the same alleles (both ref and alts) as other, * regardless of ordering. Otherwise returns false. */ public boolean hasSameAllelesAs ( final VariantContext other ) { return hasSameAlternateAllelesAs(other) && other.getReference().equals(getReference(), false); }
/** * @param other VariantContext whose alleles to compare against * @return true if this VariantContext has the same alleles (both ref and alts) as other, * regardless of ordering. Otherwise returns false. */ public boolean hasSameAllelesAs ( final VariantContext other ) { return hasSameAlternateAllelesAs(other) && other.getReference().equals(getReference(), false); }
private VariantContext getMatchingSnpEffRecord ( List<VariantContext> snpEffRecords, VariantContext vc ) { for ( VariantContext snpEffRecord : snpEffRecords ) { if ( snpEffRecord.hasSameAlternateAllelesAs(vc) && snpEffRecord.getReference().equals(vc.getReference()) ) { return snpEffRecord; } } return null; }
/** * @param other VariantContext whose alleles to compare against * @return true if this VariantContext has the same alleles (both ref and alts) as other, * regardless of ordering. Otherwise returns false. */ public boolean hasSameAllelesAs ( final VariantContext other ) { return hasSameAlternateAllelesAs(other) && other.getReference().equals(getReference(), false); }
@Test public void testMatchingAlleles() { List<Allele> alleles = Arrays.asList(ATCref, del); VariantContext vc = new VariantContextBuilder("test", delLoc, delLocStart, delLocStop, alleles).make(); VariantContext vc2 = new VariantContextBuilder("test2", delLoc, delLocStart+12, delLocStop+12, alleles).make(); Assert.assertTrue(vc.hasSameAllelesAs(vc2)); Assert.assertTrue(vc.hasSameAlternateAllelesAs(vc2)); }