def reformat_coordinates(start, stop, current, new):
    """Converts common coordinate formats.

    The type of coordinate formats include:

    '0_half_open':

        0-based half-open intervals that is the common format
        for BAM files and UCSC Browser database. This format seems
        to be more efficient when performing genomics
        computations.

    '1_closed':

        1-based closed intervals that is the common format
        for the MySQL Database, UCSC Browser,
        the Ensembl genomics database,
        VCF files, GFF files. This format seems to be more
        intuitive and used for visualization.

    The function assumes coordinates reflect the start and stop
    boundaries (where the start coordinates is smaller than the stop
    coordinate), instead of transcription start and stop coordinates.

    :param start: Start coordinate
    :type start: int
    :param stop: Stop coordinate
    :type stop: int
    :param current: Indicates the indexing format of the input coordinates.
    :type current: str
    :param new: Indicates the indexing format of the output coordinates.
    :type new: str
    :returns: The re-formatted start and stop coordinates.
    :rtype: int
    """
    format_set = set(['0_half_open', '1_closed'])
    if current in format_set and new in format_set:
        if current == '0_half_open':
            if new == '1_closed':
                new_start = start + 1
                new_stop = stop
            else:
                new_start = start
                new_stop = stop
        elif new == '0_half_open':
            new_start = start - 1
            new_stop = stop
        else:
            new_start = start
            new_stop = stop
    else:
        raise ValueError(
            "Format for CDS coordinate formats must either be '0_half_open' or '1_closed'"
            )
    return new_start, new_stop
