def build_lineage(taxid_list, mapping):
    """Given a list of taxIDs, generate a NCBI LineageEx-like list."""
    temp_list = []
    for taxid in taxid_list:
        temp_dict = {}
        if taxid == "":
            pass
        else:
            temp_dict["TaxId"] = taxid
            if taxid in mapping.keys():
                temp_dict["Rank"] = mapping[taxid]
            else:
                temp_dict["Rank"] = "NA"
        temp_list.append(temp_dict)
    return temp_list