def get_reference_sequence(fasta_obj, chrom, start_1based, end_1based):
    """Returns the reference nucleotides in the given interval.

    Args:
        fasta_obj (object): pysam.FastaFile object
        chrom (str): chromosome name
        start_1based (int): interval start coordinate
        end_1based (int): interval end coordinate

    Return:
        str: nucleotide sequence
    """

    if chrom not in fasta_obj:
        raise ValueError(f"Invalid chromosome name: {chrom}")

    chrom_obj = fasta_obj[chrom]

    return str(chrom_obj[start_1based - 1: end_1based])