use of org.broadinstitute.hellbender.tools.walkers.annotator.allelespecific.AS_MappingQualityRankSumTest in project gatk by broadinstitute.
the class MappingQualityRankSumTestUnitTest method testAS_MQRaw.
@Test
public void testAS_MQRaw() {
final AS_RankSumTest ann = new AS_MappingQualityRankSumTest();
final String key1 = GATKVCFConstants.AS_RAW_MAP_QUAL_RANK_SUM_KEY;
final String key2 = GATKVCFConstants.AS_MAP_QUAL_RANK_SUM_KEY;
final int[] altMappingQualities = { 10, 20 };
final int[] refMappingQualities = { 100, 110 };
final List<GATKRead> refReads = Arrays.stream(refMappingQualities).mapToObj(i -> makeRead(i)).collect(Collectors.toList());
final List<GATKRead> altReads = Arrays.stream(altMappingQualities).mapToObj(i -> makeRead(i)).collect(Collectors.toList());
final ReadLikelihoods<Allele> likelihoods = AnnotationArtificialData.makeLikelihoods(sample1, 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> annotate = ann.annotate(ref, vc, likelihoods);
final String expected = refMappingQualities[0] + ",1," + refMappingQualities[1] + ",1" + AS_RankSumTest.PRINT_DELIM + altMappingQualities[0] + ",1," + altMappingQualities[1] + ",1";
Assert.assertEquals(annotate.get(key1), expected);
Assert.assertEquals(annotateRaw.get(key1), expected);
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