def qname_and_mate(qname):
    """ Removes mate sequence from qname.

        qname: original qname

        Return value: tuple (qname, mate sequence, which could be empty)
    """
    split_name = qname.split('\x1d')
    mate = split_name[1].rpartition(':')
    split_name[1] = mate[0] + ':'
    return ('\x1d'.join(split_name), mate[2])