def bai_from_bam_file(bam_file):
    """
    Simple helper function to change the file extension of a .bam file to .bai.
    """
    if not bam_file.endswith('.bam'):
        raise ValueError('{0} must have a .bam extension.'.format(bam_file))

    return bam_file[:-3] + 'bai'