use of org.broadinstitute.hellbender.tools.walkers.annotator.allelespecific.AS_BaseQualityRankSumTest in project gatk by broadinstitute.
the class BaseQualityRankSumTestUnitTest method testBaseQualRawAnnotate.
@Test
public void testBaseQualRawAnnotate() {
final AS_RankSumTest ann = new AS_BaseQualityRankSumTest();
final String key1 = GATKVCFConstants.AS_RAW_BASE_QUAL_RANK_SUM_KEY;
final String key2 = GATKVCFConstants.AS_BASE_QUAL_RANK_SUM_KEY;
final int[] altBaseQuals = { 10, 20 };
final int[] refBaseQuals = { 50, 60 };
final List<GATKRead> refReads = Arrays.stream(refBaseQuals).mapToObj(i -> makeRead(i)).collect(Collectors.toList());
final List<GATKRead> altReads = Arrays.stream(altBaseQuals).mapToObj(i -> makeRead(i)).collect(Collectors.toList());
final ReadLikelihoods<Allele> likelihoods = AnnotationArtificialData.makeLikelihoods(SAMPLE_1, refReads, altReads, -100.0, -100.0, REF, ALT);
final ReferenceContext ref = null;
final VariantContext vc = makeVC(REF, ALT);
final Map<String, Object> annotateRaw = ann.annotateRawData(ref, vc, likelihoods);
final Map<String, Object> annotateNonRaw = ann.annotate(ref, vc, likelihoods);
final String expectedAnnotation = refBaseQuals[0] + ",1," + refBaseQuals[1] + ",1" + AS_RankSumTest.PRINT_DELIM + altBaseQuals[0] + ",1," + altBaseQuals[1] + ",1";
Assert.assertEquals(annotateRaw.get(key1), expectedAnnotation);
Assert.assertEquals(annotateNonRaw.get(key1), expectedAnnotation);
Assert.assertEquals(ann.getDescriptions().size(), 1);
Assert.assertEquals(ann.getDescriptions().get(0).getID(), key1);
Assert.assertEquals(ann.getKeyNames().size(), 1);
Assert.assertEquals(ann.getKeyNames().get(0), key2);
}
Aggregations