def create_metadata(config, md5s):
    """Compute metadata for a manifest file

    Parameters
    ----------
    config : dict
        Dictionary of metadata attributes that include experiment_accession,
        description, and library_accession.
    md5s : list((filename, md5 hexdigest))
        List of filename and hexdigest tuples that will be added to the manifest
        dictionary.
    """
    metadata = {
        "type": "MexGeneArchive_v1",
        "output_type": config['output_type'],
        "software_version": config["software_version"],
        "arguments": config["arguments"],
    }
    for key in ["experiment_accession", "description", "library_accession"]:
        if key in config:
            metadata[key] = config[key]

    for filename, md5 in md5s:
        metadata[filename] = "md5sum:{}".format(md5)

    return metadata