def _get_sequence_from_coords(len_prots, proteome_sequence,
                              prot, start, end):
    """
    Gets the amino acid sequence at specified coordinates.

    Parameters
    ----------
    len_prots : dict
        A dictionary mapping protein names to lengths.
    proteome_sequence : function
        A closure that returns the sequence at given coordinates.
    prot : str
        The name of a protein, e.g. "YFP".
    start : int
        The 0-based start coordinate of the first position in the
        sequence.
    end : int
        One past the 0-based last position in the sequence.

    Returns
    -------
    str
        The amino acid sequence.

    """
    if start > len_prots[prot] or (end > len_prots[prot] + 1) or start < 0:
        return ""
    return proteome_sequence(prot, start, end)