All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.broadinstitute.hellbender.transformers.MappingQualityReadTransformer Maven / Gradle / Ivy

There is a newer version: 4.6.0.0
Show newest version
package org.broadinstitute.hellbender.transformers;

import org.broadinstitute.hellbender.utils.read.GATKRead;

/**
 * A read transformer to modify the mapping quality of reads with MQ=255 to reads with MQ=60
 *
 *
 */
public class MappingQualityReadTransformer implements ReadTransformer {
    private static final long serialVersionUID = 1L;

    private int fromQuality = 255;
    private int toQuality = 60;

    public MappingQualityReadTransformer(final int fromQuality, final int toQuality) {
        this.fromQuality = fromQuality;
        this.toQuality = toQuality;
    }

    @Override
    public GATKRead apply(final GATKRead read) {
        if (read.getMappingQuality() == fromQuality) {
            read.setMappingQuality(toQuality);
        }
        return read;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy