def replace_periodic_sequence_positions(sequence, step_size, offset, substitution_char):
    """Edit nucleotide sequence using by replacing every 'step_size' nucleotides with an offset

    note: we convert sequence to uppercase

    eg: replace_periodic_sequence_positions("ATGCATGC", 3, 1, "F") = "AFGCFTGF"

    :param sequence: nucleotide sequence
    :param step_size: every 'step_size' locations the offset position is changed
    :param offset: the
    :param substitution_char: replacement character
    """
    assert offset < step_size, "Offset has to be less than step size"
    sequence = list(sequence)
    for i in range(offset, len(sequence), step_size):
        sequence[i] = substitution_char
    subst_sequence = ''.join(sequence).upper()

    return subst_sequence