def read_output(filename):
    """
    Reads in a Tarquin txt results file and returns a dict of the information

    :param filename: The filename to read from
    :return:
    """
    with open(filename) as fin:
        data = fin.read()

        metabolite_fits = {}

        sections = data.split("\n\n")

        # first section is the metabolite concentrations
        metabolite_lines = sections[0].splitlines()[2:]
        for line in metabolite_lines:
            name, concentration, pc_sd, sd = line.split()
            metabolite_fits[name] = {
                "concentration": concentration,
                "sd": pc_sd,
            }

        return {
            "metabolite_fits": metabolite_fits
        }