diff --git a/src/hub/dataload/sources/chembl/parser.py b/src/hub/dataload/sources/chembl/parser.py index 706d6b3..d1e1a51 100644 --- a/src/hub/dataload/sources/chembl/parser.py +++ b/src/hub/dataload/sources/chembl/parser.py @@ -18,16 +18,24 @@ def parse_data(data): for accession in accessions: if UNIPROT_ACCESSION_PATTERN.fullmatch(accession): uniprot_accessions.append(accession) + # if uniprot_accessions: + # for uniprot_accession in uniprot_accessions: + # output = { + # "_id": uniprot_accession, + # "chembl": { + # "chembl_target": item["target_chembl_id"], + # "uniprot_accession": uniprot_accession, + # }, + # } + # yield output if uniprot_accessions: - for uniprot_accession in uniprot_accessions: - output = { - "_id": uniprot_accession, - "chembl": { - "chembl_target": item["target_chembl_id"], - "uniprot_accession": uniprot_accession, - }, - } - yield output + output = { + "chembl": { + "chembl_target": item["target_chembl_id"], + "uniprot_accession": uniprot_accessions, + }, + } + yield output def load_data(target_filepaths): diff --git a/src/hub/dataload/sources/chembl/upload.py b/src/hub/dataload/sources/chembl/upload.py index ee49579..0e0cd6c 100644 --- a/src/hub/dataload/sources/chembl/upload.py +++ b/src/hub/dataload/sources/chembl/upload.py @@ -44,8 +44,8 @@ class ChemblUploader(uploader.BaseSourceUploader): keylookup = MyGeneKeyLookup( input_types=[ - ("swissprot", "chembl.uniprot_accession"), - ("trembl", "chembl.uniprot_accession"), + ("swissprot", "chembl.uniprot_accessions"), + ("trembl", "chembl.uniprot_accessions"), ], skip_on_failure=True, ) @@ -65,7 +65,7 @@ def get_mapping(klass): "type": "keyword", "normalizer": "keyword_lowercase_normalizer", }, - "uniprot_accession": { + "uniprot_accessions": { "type": "keyword", "normalizer": "keyword_lowercase_normalizer", },