def get_mate_mq_value(aln_rec):
    """
    check if MQ exists in aln_rec or assign MQ flag and return value
    :param aln_rec:
    :return: mq_mate value
    """
    if aln_rec.has_tag('MQ'):  # some alignment records do not have the MQ value in the mate when pair aligned; BWA-known-issue
        mq_mate = aln_rec.get_tag('MQ')
    else:
        mq_mate = 60  # we assume that if the mate quality is not present, it is still a good one.
    return mq_mate