def getOtherPairFlag(flag):
    """
    Convert SAM flag to other pair flag:
    if read paired (0x1), return None

    If first in pair (0x40), return 0x80,
    if  read reverse strand (0x10), mate reverse strand (0x20)
    """
    # Check if bit 0x1 is set
    if not flag & 0x1:
        return flag
    else:
        # If 0x40, switch to 0x80
        if flag & 0x40 and flag & 0x10:
            return flag ^ 0x20 ^ 0x10 ^ 0x40 ^ 0x80