def get_context(seq, pos, n=1, s=1):
    """
    Gets context from a sequence at a given position.
    :param seq: the sequence
    :param pos: target position
    :param n: context size (each side)
    :param s: size of the target region, displaces the position of right context
    :return: a string matching [ACTG]*[.]+[ACTG]*
    """
    context = []
    for n in range(pos - n, pos + n + s):
        if pos <= n < pos + s:
            # target region, will be represented with dots
            context.append(".")
        elif 0 <= n < len(seq):
            # context region, if it is in sequence boundaries
            context.append(seq[n])
        # else (positions outside sequence) => nothing

    return "".join(context)