Search in sources :

Example 41 with ReferenceContext

use of org.broadinstitute.hellbender.engine.ReferenceContext in project gatk by broadinstitute.

the class TandemRepeatUnitTest method testUsingVCNotIndel.

@Test
public void testUsingVCNotIndel() {
    // - [ref] / ATC from 20-20
    String insLoc = "chr1";
    int insLocStart = 2;
    int insLocStop = 2;
    byte[] refBytes = "GTATCATCATCGGA".getBytes();
    Allele nullR = Allele.create("A", true);
    Allele atc = Allele.create("C", false);
    // A*,ATC, context = ATC ATC ATC : (ATC)3 -> (ATC)4
    VariantContext vc = new VariantContextBuilder("foo", insLoc, insLocStart, insLocStop, Arrays.asList(nullR, atc)).make();
    final SimpleInterval interval = new SimpleInterval("chr1", insLocStart, insLocStop);
    final String contigName = "chr1";
    final SimpleInterval interval1 = new SimpleInterval(contigName, 1, refBytes.length);
    final ReferenceBases ref1 = new ReferenceBases(refBytes, interval1);
    final SAMSequenceDictionary dict = new SAMSequenceDictionary(Arrays.asList(new SAMSequenceRecord(contigName, refBytes.length)));
    final ReferenceContext ref = new ReferenceContext(ReferenceDataSource.of(ref1, dict), interval, 0, 20);
    final InfoFieldAnnotation ann = new TandemRepeat();
    final Map<String, Object> a = ann.annotate(ref, vc, null);
    Assert.assertTrue(a.isEmpty());
}
Also used : VariantContext(htsjdk.variant.variantcontext.VariantContext) SAMSequenceRecord(htsjdk.samtools.SAMSequenceRecord) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) ReferenceBases(org.broadinstitute.hellbender.utils.reference.ReferenceBases) Allele(htsjdk.variant.variantcontext.Allele) VariantContextBuilder(htsjdk.variant.variantcontext.VariantContextBuilder) ReferenceContext(org.broadinstitute.hellbender.engine.ReferenceContext) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Aggregations

ReferenceContext (org.broadinstitute.hellbender.engine.ReferenceContext)41 Test (org.testng.annotations.Test)30 VariantContext (htsjdk.variant.variantcontext.VariantContext)17 GATKRead (org.broadinstitute.hellbender.utils.read.GATKRead)17 ReadLikelihoods (org.broadinstitute.hellbender.utils.genotyper.ReadLikelihoods)15 Collectors (java.util.stream.Collectors)13 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)12 Allele (htsjdk.variant.variantcontext.Allele)10 GATKVCFConstants (org.broadinstitute.hellbender.utils.variant.GATKVCFConstants)10 VariantContextBuilder (htsjdk.variant.variantcontext.VariantContextBuilder)9 htsjdk.variant.variantcontext (htsjdk.variant.variantcontext)8 java.util (java.util)8 List (java.util.List)8 AS_RMSMappingQuality (org.broadinstitute.hellbender.tools.walkers.annotator.allelespecific.AS_RMSMappingQuality)8 Assert (org.testng.Assert)8 VCFConstants (htsjdk.variant.vcf.VCFConstants)7 Map (java.util.Map)7 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)7 ImmutableMap (com.google.common.collect.ImmutableMap)6 MannWhitneyU (org.broadinstitute.hellbender.utils.MannWhitneyU)6