/** * @return true if the alleles indicate a simple deletion (i.e., a single alt allele that is Null) */ public boolean isSimpleDeletion() { // can't just call !isSimpleInsertion() because of complex indels return isSimpleIndel() && getAlternateAllele(0).length() == 1; }
/** * @return true if the alleles indicate a simple insertion (i.e., the reference allele is Null) */ public boolean isSimpleInsertion() { // can't just call !isSimpleDeletion() because of complex indels return isSimpleIndel() && getReference().length() == 1; }
/** * @return true if the alleles indicate a simple insertion (i.e., the reference allele is Null) */ public boolean isSimpleInsertion() { // can't just call !isSimpleDeletion() because of complex indels return isSimpleIndel() && getReference().length() == 1; }
/** * @return true if the alleles indicate a simple deletion (i.e., a single alt allele that is Null) */ public boolean isSimpleDeletion() { // can't just call !isSimpleInsertion() because of complex indels return isSimpleIndel() && getAlternateAllele(0).length() == 1; }
/** * @return true if the alleles indicate a simple deletion (i.e., a single alt allele that is Null) */ public boolean isSimpleDeletion() { // can't just call !isSimpleInsertion() because of complex indels return isSimpleIndel() && getAlternateAllele(0).length() == 1; }
/** * @return true if the alleles indicate a simple insertion (i.e., the reference allele is Null) */ public boolean isSimpleInsertion() { // can't just call !isSimpleDeletion() because of complex indels return isSimpleIndel() && getReference().length() == 1; }
@Test public void testCreatingComplexSubstitutionVariantContext() { List<Allele> alleles = Arrays.asList(Tref, ATC); VariantContext vc = new VariantContextBuilder("test", insLoc, insLocStart, insLocStop, alleles).make(); Assert.assertEquals(vc.getContig(), insLoc); Assert.assertEquals(vc.getStart(), insLocStart); Assert.assertEquals(vc.getEnd(), insLocStop); Assert.assertEquals(vc.getType(), VariantContext.Type.INDEL); Assert.assertFalse(vc.isSNP()); Assert.assertTrue(vc.isIndel()); Assert.assertFalse(vc.isSimpleInsertion()); Assert.assertFalse(vc.isSimpleDeletion()); Assert.assertFalse(vc.isSimpleIndel()); Assert.assertFalse(vc.isMixed()); Assert.assertTrue(vc.isBiallelic()); Assert.assertEquals(vc.getNAlleles(), 2); Assert.assertEquals(vc.getReference(), Tref); Assert.assertEquals(vc.getAlleles().size(), 2); Assert.assertEquals(vc.getAlternateAlleles().size(), 1); Assert.assertEquals(vc.getAlternateAllele(0), ATC); Assert.assertFalse(vc.hasGenotypes()); Assert.assertEquals(vc.getSampleNames().size(), 0); }
@Test public void testCreatingSNPVariantContext() { List<Allele> alleles = Arrays.asList(Aref, T); VariantContext vc = snpBuilder.alleles(alleles).make(); Assert.assertEquals(vc.getContig(), snpLoc); Assert.assertEquals(vc.getStart(), snpLocStart); Assert.assertEquals(vc.getEnd(), snpLocStop); Assert.assertEquals(vc.getType(), VariantContext.Type.SNP); Assert.assertTrue(vc.isSNP()); Assert.assertFalse(vc.isIndel()); Assert.assertFalse(vc.isSimpleInsertion()); Assert.assertFalse(vc.isSimpleDeletion()); Assert.assertFalse(vc.isSimpleIndel()); Assert.assertFalse(vc.isMixed()); Assert.assertTrue(vc.isBiallelic()); Assert.assertEquals(vc.getNAlleles(), 2); Assert.assertEquals(vc.getReference(), Aref); Assert.assertEquals(vc.getAlleles().size(), 2); Assert.assertEquals(vc.getAlternateAlleles().size(), 1); Assert.assertEquals(vc.getAlternateAllele(0), T); Assert.assertFalse(vc.hasGenotypes()); Assert.assertEquals(vc.getSampleNames().size(), 0); }
@Test public void testCreatingRefVariantContext() { List<Allele> alleles = Arrays.asList(Aref); VariantContext vc = snpBuilder.alleles(alleles).make(); Assert.assertEquals(vc.getContig(), snpLoc); Assert.assertEquals(vc.getStart(), snpLocStart); Assert.assertEquals(vc.getEnd(), snpLocStop); Assert.assertEquals(VariantContext.Type.NO_VARIATION, vc.getType()); Assert.assertFalse(vc.isSNP()); Assert.assertFalse(vc.isIndel()); Assert.assertFalse(vc.isSimpleInsertion()); Assert.assertFalse(vc.isSimpleDeletion()); Assert.assertFalse(vc.isSimpleIndel()); Assert.assertFalse(vc.isMixed()); Assert.assertFalse(vc.isBiallelic()); Assert.assertEquals(vc.getNAlleles(), 1); Assert.assertEquals(vc.getReference(), Aref); Assert.assertEquals(vc.getAlleles().size(), 1); Assert.assertEquals(vc.getAlternateAlleles().size(), 0); //Assert.assertEquals(vc.getAlternateAllele(0), T); Assert.assertFalse(vc.hasGenotypes()); Assert.assertEquals(vc.getSampleNames().size(), 0); }
@Test public void testCreatingDeletionVariantContext() { List<Allele> alleles = Arrays.asList(ATCref, del); VariantContext vc = new VariantContextBuilder("test", delLoc, delLocStart, delLocStop, alleles).make(); Assert.assertEquals(vc.getContig(), delLoc); Assert.assertEquals(vc.getStart(), delLocStart); Assert.assertEquals(vc.getEnd(), delLocStop); Assert.assertEquals(vc.getType(), VariantContext.Type.INDEL); Assert.assertFalse(vc.isSNP()); Assert.assertTrue(vc.isIndel()); Assert.assertFalse(vc.isSimpleInsertion()); Assert.assertTrue(vc.isSimpleDeletion()); Assert.assertTrue(vc.isSimpleIndel()); Assert.assertFalse(vc.isMixed()); Assert.assertTrue(vc.isBiallelic()); Assert.assertEquals(vc.getNAlleles(), 2); Assert.assertEquals(vc.getReference(), ATCref); Assert.assertEquals(vc.getAlleles().size(), 2); Assert.assertEquals(vc.getAlternateAlleles().size(), 1); Assert.assertEquals(vc.getAlternateAllele(0), del); Assert.assertFalse(vc.hasGenotypes()); Assert.assertEquals(vc.getSampleNames().size(), 0); }
@Test public void testCreatingInsertionVariantContext() { List<Allele> alleles = Arrays.asList(delRef, ATC); VariantContext vc = insBuilder.alleles(alleles).make(); Assert.assertEquals(vc.getContig(), insLoc); Assert.assertEquals(vc.getStart(), insLocStart); Assert.assertEquals(vc.getEnd(), insLocStop); Assert.assertEquals(vc.getType(), VariantContext.Type.INDEL); Assert.assertFalse(vc.isSNP()); Assert.assertTrue(vc.isIndel()); Assert.assertTrue(vc.isSimpleInsertion()); Assert.assertFalse(vc.isSimpleDeletion()); Assert.assertTrue(vc.isSimpleIndel()); Assert.assertFalse(vc.isMixed()); Assert.assertTrue(vc.isBiallelic()); Assert.assertEquals(vc.getNAlleles(), 2); Assert.assertEquals(vc.getReference(), delRef); Assert.assertEquals(vc.getAlleles().size(), 2); Assert.assertEquals(vc.getAlternateAlleles().size(), 1); Assert.assertEquals(vc.getAlternateAllele(0), ATC); Assert.assertFalse(vc.hasGenotypes()); Assert.assertEquals(vc.getSampleNames().size(), 0); }