def update_sequence_viewpoint(seq, vp_s, vp_e):
    """
    Update sequence viewpoint, i.e. region marked by vp_s (start) and vp_e
    (end), converting viewpoint to uppercase, and rest to lowercase.
    NOTE that vp_s and vp_e are expected to be 1-based index.

    >>> seq = "acgtACGTacgt"
    >>> update_sequence_viewpoint(seq, 4, 9)
    'acgTACGTAcgt'
    >>> seq = "acgtacgtACGTac"
    >>> update_sequence_viewpoint(seq, 5, 16)
    'acgtACGTACGTAC'

    """
    assert seq, "seq empty"
    assert vp_s <= vp_e, "vp_s > vp_e"
    us_seq = seq[:vp_s-1].lower()
    vp_seq = seq[vp_s-1:vp_e].upper()
    ds_seq = seq[vp_e:].lower()
    new_seq = us_seq + vp_seq + ds_seq
    return new_seq