import csv


def read_gene_file(gene_file):
    """
    Helper for reading a sample gene file.
    Returns a dictionary where key is gene and value is cpm

    :param gene_file:
    :return:
    """
    gene_dict = dict()
    with open(gene_file, "r") as f:
        reader = csv.DictReader(f, delimiter="\t")
        for record in reader:
            gene_dict[record["locus_tag"]] = [float(record["cpm"])]

    return gene_dict