/** * @param test bases to test against * * @return true if this Allele contains the same bases as test, regardless of its reference status; handles Null and NO_CALL alleles */ public boolean basesMatch(final String test) { return basesMatch(test.toUpperCase().getBytes()); }
/** * @param test bases to test against * * @return true if this Allele contains the same bases as test, regardless of its reference status; handles Null and NO_CALL alleles */ public boolean basesMatch(String test) { return basesMatch(test.toUpperCase().getBytes()); }
/** * @param test bases to test against * * @return true if this Allele contains the same bases as test, regardless of its reference status; handles Null and NO_CALL alleles */ public boolean basesMatch(final String test) { return basesMatch(test.toUpperCase().getBytes()); }
/** * @param test allele to test against * * @return true if this Allele contains the same bases as test, regardless of its reference status; handles Null and NO_CALL alleles */ public boolean basesMatch(final Allele test) { return basesMatch(test.getBases()); }
/** * @param test allele to test against * * @return true if this Allele contains the same bases as test, regardless of its reference status; handles Null and NO_CALL alleles */ public boolean basesMatch(Allele test) { return basesMatch(test.getBases()); }
public static Allele getMatchingAllele(Collection<Allele> allAlleles, byte[] alleleBases) { for ( Allele a : allAlleles ) { if ( a.basesMatch(alleleBases) ) { return a; } } if ( wouldBeNoCallAllele(alleleBases) ) return NO_CALL; else return null; // couldn't find anything }
public static Allele getMatchingAllele(final Collection<Allele> allAlleles, final byte[] alleleBases) { for ( Allele a : allAlleles ) { if ( a.basesMatch(alleleBases) ) { return a; } } if ( wouldBeNoCallAllele(alleleBases) ) return NO_CALL; else return null; // couldn't find anything }
/** * @param test allele to test against * * @return true if this Allele contains the same bases as test, regardless of its reference status; handles Null and NO_CALL alleles */ public boolean basesMatch(final Allele test) { return basesMatch(test.getBases()); }
public static Allele getMatchingAllele(final Collection<Allele> allAlleles, final byte[] alleleBases) { for ( Allele a : allAlleles ) { if ( a.basesMatch(alleleBases) ) { return a; } } if ( wouldBeNoCallAllele(alleleBases) ) return NO_CALL; else return null; // couldn't find anything }
@Test(dataProvider = "allelesToStringData") public void testAllelesToString(final List<Allele> input, final List<String> output) { Assert.assertEquals(LiftoverUtils.allelesToStringList(input), output); //these should back-convert into the same alleles. List<Allele> restoredAlleles = output.stream().map(Allele::create).collect(Collectors.toList()); for (int i = 0;i<input.size();i++){ Assert.assertTrue(restoredAlleles.get(i).basesMatch(input.get(i))); } } }
public void validateReferenceBases(final Allele reportedReference, final Allele observedReference) { if ( reportedReference != null && !reportedReference.basesMatch(observedReference) ) { throw new TribbleException.InternalCodecException(String.format("the REF allele is incorrect for the record at position %s:%d, fasta says %s vs. VCF says %s", getChr(), getStart(), observedReference.getBaseString(), reportedReference.getBaseString())); } }
@Test public void testEquals() { Assert.assertTrue(ARef.basesMatch(A)); Assert.assertFalse(ARef.equals(A)); Assert.assertFalse(ARef.equals(ATIns)); Assert.assertFalse(ARef.equals(ATCIns)); Assert.assertTrue(T.basesMatch(T)); Assert.assertFalse(T.basesMatch(A)); Assert.assertFalse(T.equals(A)); Assert.assertTrue(ATIns.equals(ATIns)); Assert.assertFalse(ATIns.equals(ATCIns)); Assert.assertTrue(ATIns.basesMatch("AT")); Assert.assertFalse(ATIns.basesMatch("A")); Assert.assertFalse(ATIns.basesMatch("ATC")); Assert.assertTrue(ATIns.basesMatch("AT")); Assert.assertFalse(ATIns.basesMatch("ATC")); }
@Test public void testCreatingSNPAlleles() { Assert.assertTrue(A.isNonReference()); Assert.assertFalse(A.isReference()); Assert.assertTrue(A.basesMatch("A")); Assert.assertEquals(A.length(), 1); Assert.assertTrue(ARef.isReference()); Assert.assertFalse(ARef.isNonReference()); Assert.assertTrue(ARef.basesMatch("A")); Assert.assertFalse(ARef.basesMatch("T")); Assert.assertTrue(T.isNonReference()); Assert.assertFalse(T.isReference()); Assert.assertTrue(T.basesMatch("T")); Assert.assertFalse(T.basesMatch("A")); }
public void validateReferenceBases(final Allele reportedReference, final Allele observedReference) { if ( reportedReference != null && !reportedReference.basesMatch(observedReference) ) { throw new TribbleException.InternalCodecException(String.format("the REF allele is incorrect for the record at position %s:%d, fasta says %s vs. VCF says %s", getContig(), getStart(), observedReference.getBaseString(), reportedReference.getBaseString())); } }
public void validateReferenceBases(final Allele reportedReference, final Allele observedReference) { if ( reportedReference != null && !reportedReference.basesMatch(observedReference) ) { throw new TribbleException.InternalCodecException(String.format("the REF allele is incorrect for the record at position %s:%d, fasta says %s vs. VCF says %s", getContig(), getStart(), observedReference.getBaseString(), reportedReference.getBaseString())); } }
@Test public void testCreatingSpanningDeletionAlleles() { Assert.assertTrue(SpandDel.isNonReference()); Assert.assertFalse(SpandDel.isReference()); Assert.assertTrue(SpandDel.basesMatch(Allele.SPAN_DEL_STRING)); Assert.assertEquals(SpandDel.length(), 1); }
@Test public void testCreatingNoCallAlleles() { Assert.assertTrue(NoCall.isNonReference()); Assert.assertFalse(NoCall.isReference()); Assert.assertFalse(NoCall.basesMatch(Allele.NO_CALL_STRING)); Assert.assertEquals(NoCall.length(), 0); Assert.assertTrue(NoCall.isNoCall()); Assert.assertFalse(NoCall.isCalled()); }
continue; Allele allele1 = Allele.create(a1, refSNPAllele.basesMatch(a1)); Allele allele2 = Allele.create(a2, refSNPAllele.basesMatch(a2));
@Test public void HCTestDanglingTailMergingForDeletions() throws IOException { final String base = String.format("-T HaplotypeCaller --disableDithering --pcr_indel_model NONE -R %s -I %s", REF, NA12878_BAM) + " --no_cmdline_in_header -o %s -L 20:10130740-10130800 --allowNonUniqueKmersInRef"; final WalkerTestSpec spec = new WalkerTestSpec(base, 1, Arrays.asList("")); final File outputVCF = executeTest("HCTestDanglingTailMergingForDeletions", spec).getFirst().get(0); // confirm that the call is the correct one final VCFCodec codec = new VCFCodec(); final FileInputStream s = new FileInputStream(outputVCF); final LineIterator lineIterator = codec.makeSourceFromStream(new PositionalBufferedStream(s)); codec.readHeader(lineIterator); final String line = lineIterator.next(); Assert.assertFalse(line == null); final VariantContext vc = codec.decode(line); Assert.assertTrue(vc.isBiallelic()); Assert.assertTrue(vc.getReference().basesMatch("ATGTATG")); Assert.assertTrue(vc.getAlternateAllele(0).basesMatch("A")); }
if (allelesInVc.get(0).basesMatch(allele)) { nRef++; } else if (allelesInVc.get(1).basesMatch(allele)) { nAlt++; } else {