import csv


def load_cohort_meta(meta_in):
    """
    Load cohort metadata into dictionary
    """

    meta = {}

    with open(meta_in) as infile:
        reader = csv.reader(infile, delimiter='\t')

        for cohort, total_n, case_n, ctrl_n, bed in reader:

            if cohort not in meta.keys():
                meta[cohort] = { 'samples' : int(total_n),
                                 'cases' : int(case_n),
                                 'controls' : int(ctrl_n),
                                 'bed' : bed }

    return meta