use of htsjdk.variant.variantcontext.VariantContextBuilder in project gatk by broadinstitute.
the class ReadThreadingAssemblerUnitTest method testAssembleRefAndDeletion.
@Test(dataProvider = "AssembleIntervalsWithVariantData")
public void testAssembleRefAndDeletion(final ReadThreadingAssembler assembler, final SimpleInterval loc, final int nReadsToUse, final int variantSite) {
final byte[] refBases = seq.getSubsequenceAt(loc.getContig(), loc.getStart(), loc.getEnd()).getBases();
for (int deletionLength = 1; deletionLength < 10; deletionLength++) {
final Allele refBase = Allele.create(new String(refBases).substring(variantSite, variantSite + deletionLength + 1), true);
final Allele altBase = Allele.create(refBase.getBases()[0], false);
final VariantContextBuilder vcb = new VariantContextBuilder("x", loc.getContig(), variantSite, variantSite + deletionLength, Arrays.asList(refBase, altBase));
testAssemblyWithVariant(assembler, refBases, loc, nReadsToUse, vcb.make());
}
}
use of htsjdk.variant.variantcontext.VariantContextBuilder in project gatk by broadinstitute.
the class SelectVariantsUnitTest method maxIndelSizeTest.
@Test(dataProvider = "MaxMinIndelSize")
public void maxIndelSizeTest(final int size, final int otherSize, final int max, final int min, final String op) {
final byte[] largerAllele = Utils.dupBytes((byte) 'A', size + 1);
final byte[] smallerAllele = Utils.dupBytes((byte) 'A', 1);
final List<Allele> alleles = new ArrayList<>(2);
final Allele ref = Allele.create(op.equals("I") ? smallerAllele : largerAllele, true);
final Allele alt = Allele.create(op.equals("D") ? smallerAllele : largerAllele, false);
alleles.add(ref);
alleles.add(alt);
final VariantContext vc = new VariantContextBuilder("test", "1", 10, 10 + ref.length() - 1, alleles).make();
final boolean hasIndelTooLargeOrSmall = SelectVariants.containsIndelLargerOrSmallerThan(vc, max, min);
Assert.assertEquals(hasIndelTooLargeOrSmall, size > max || size < min);
}
Aggregations