def read_gtdb_representative(metadata_file):
    """Parse GTDB representative from GTDB metadata.

    Parameters
    ----------
    metadata_file : str
        Metadata for all genomes.

    Return
    ------
    dict : d[genome_id] -> True or False
    """
    gtdb_reps = {}
    with open(metadata_file) as f:
        headers = f.readline().strip().split('\t')
        genome_index = headers.index('accession')
        gtdb_representative_index = headers.index('gtdb_representative')
        for line in f:
            line_split = line.strip().split('\t')
            genome_id = line_split[genome_index]
            is_rep = line_split[gtdb_representative_index] == 't'
            gtdb_reps[genome_id] = is_rep
    return gtdb_reps
