def base_complement(k):
    """ Return complement of base.
    Performs the subsitutions: A<=>T, C<=>G, X=>X for both upper and lower
    case. The return value is identical to the argument for all other values.
    :param k: A base.
    :returns: Complement of base.
    :rtype: str
    """
    comp = {
        'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C', 'X': 'X', 'N': 'N',
        'a': 't', 't': 'a', 'c': 'g', 'g': 'c', 'x': 'x', 'n': 'n',
        '-': '-'
    }
    try:

        return comp[k]

    except KeyError:

        print("WARNING: No reverse complement for {} found, returning argument.".format(k))

        return k