From bb543c13915306b18278e709203cea65a4c06ccf Mon Sep 17 00:00:00 2001 From: jal347 Date: Tue, 8 Oct 2024 18:43:32 -0700 Subject: [PATCH] changed input_type for keylookup --- src/hub/dataload/sources/chembl/upload.py | 37 ++--------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/src/hub/dataload/sources/chembl/upload.py b/src/hub/dataload/sources/chembl/upload.py index 7c25306..c62f158 100644 --- a/src/hub/dataload/sources/chembl/upload.py +++ b/src/hub/dataload/sources/chembl/upload.py @@ -9,39 +9,6 @@ from .parser import load_data -# class ChemblMergerStorage(storage.MergerStorage): -# @classmethod -# def merge_func(klass, doc1, doc2, **kwargs): -# doc2 = copy.copy(doc2) -# chembl_dict = {} - -# for doc in [doc1, doc2]: -# chembl_list = doc.get("chembl", []) -# if not isinstance(chembl_list, list): -# chembl_list = [chembl_list] - -# for chembl in chembl_list: -# uniprot = chembl.get("uniprot") -# chembl_target = chembl.get("chembl_target") - -# if uniprot in chembl_dict: -# if isinstance(chembl_dict[uniprot]["chembl_target"], list): -# chembl_dict[uniprot]["chembl_target"].append(chembl_target) -# else: -# chembl_dict[uniprot]["chembl_target"] = [ -# chembl_dict[uniprot]["chembl_target"], -# chembl_target, -# ] -# else: -# chembl_dict[uniprot] = { -# "chembl_target": chembl_target, -# "uniprot": uniprot, -# } - -# merged_doc = {"_id": doc2["_id"]} -# merged_doc["chembl"] = list(chembl_dict.values()) -# return merged_doc - class ChemblUploader(uploader.BaseSourceUploader): name = "chembl" @@ -51,8 +18,8 @@ class ChemblUploader(uploader.BaseSourceUploader): keylookup = MyGeneKeyLookup( input_types=[ - ("swissprot", "chembl.uniprot_accession"), - ("trembl", "chembl.uniprot_accession"), + ("swissprot", "chembl.uniprot"), + ("trembl", "chembl.uniprot"), ], skip_on_failure=True, )