def parse_media_file(mediaf):
    """
    Get the present media compounds.

    Parameters:
        mediaf: filepath to the tab-delimited media file.

    Returns:
        media: dictionary with first level of keys as compound IDs. The values
               are another dictionary of compound name, formula, and charge.
    """
    media = {}
    with open(mediaf, "r") as f:
        for li, l in enumerate(f):
            # Skip header line
            if li == 0:
                continue
            l = l.rstrip("\n")
            cpdId, name, formula, charge = l.split("\t")
            media[cpdId] = {"name": name,
                            "formula": formula,
                            "charge": charge}
    return media