def parse_geste(infile_name):
    """
    Parses a GESTE file and retuns an OrderedDict with:
    {"Population_name":[Freq_ref_allele_on SNP_1,Freq_ref_allele_on SNP_2,...]}
    """
    infile = open(infile_name, "r")
    pop_freqs = OrderedDict()
    pop_starter = "[pop]="
    popname = ""
    for line in infile:
        # Neat trick to ignore data that is not SNP info
        # This code section should be very performant since it replaces most
        # if - else tests with try -> except statements
        line = line.split()
        try:
            int(line[0])
        except ValueError:  # In case it's a new section
            if line[0].startswith(pop_starter):
                popname = "Pop %s" % line[0].strip().replace(pop_starter, "")
                pop_freqs[popname] = []
            continue
        except IndexError:  # In case it's an empty line
            continue
        try:
            ref_frequency = round(int(line[3]) / int(line[1]), 3)
        except ZeroDivisionError:
            ref_frequency = 9
        pop_freqs[popname].append(ref_frequency)

    infile.close()

    return pop_freqs