1 package org.broadinstitute.hellbender.transformers; 2 3 import org.broadinstitute.hellbender.utils.read.GATKRead; 4 5 /** 6 * A read transformer to modify the mapping quality of reads with MQ=255 to reads with MQ=60 7 * 8 * 9 */ 10 public class MappingQualityReadTransformer implements ReadTransformer { 11 private static final long serialVersionUID = 1L; 12 13 private int fromQuality = 255; 14 private int toQuality = 60; 15 MappingQualityReadTransformer(final int fromQuality, final int toQuality)16 public MappingQualityReadTransformer(final int fromQuality, final int toQuality) { 17 this.fromQuality = fromQuality; 18 this.toQuality = toQuality; 19 } 20 21 @Override apply(final GATKRead read)22 public GATKRead apply(final GATKRead read) { 23 if (read.getMappingQuality() == fromQuality) { 24 read.setMappingQuality(toQuality); 25 } 26 return read; 27 } 28 } 29