From e6aea8c81e231b5d1f72231bae984da2a3c6d114 Mon Sep 17 00:00:00 2001 From: jal347 Date: Thu, 3 Oct 2024 15:23:34 -0700 Subject: [PATCH] test 1-1 no _id --- src/hub/dataload/sources/chembl/parser.py | 33 +++++++++++------------ src/hub/dataload/sources/chembl/upload.py | 6 ++--- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/hub/dataload/sources/chembl/parser.py b/src/hub/dataload/sources/chembl/parser.py index d1e1a51..c4632a2 100644 --- a/src/hub/dataload/sources/chembl/parser.py +++ b/src/hub/dataload/sources/chembl/parser.py @@ -18,24 +18,23 @@ 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: - output = { - "chembl": { - "chembl_target": item["target_chembl_id"], - "uniprot_accession": uniprot_accessions, - }, - } - yield output + for uniprot_accession in uniprot_accessions: + output = { + "chembl": { + "chembl_target": item["target_chembl_id"], + "uniprot_accession": uniprot_accession, + }, + } + yield output + # if uniprot_accessions: + # 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 0e0cd6c..ee49579 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_accessions"), - ("trembl", "chembl.uniprot_accessions"), + ("swissprot", "chembl.uniprot_accession"), + ("trembl", "chembl.uniprot_accession"), ], skip_on_failure=True, ) @@ -65,7 +65,7 @@ def get_mapping(klass): "type": "keyword", "normalizer": "keyword_lowercase_normalizer", }, - "uniprot_accessions": { + "uniprot_accession": { "type": "keyword", "normalizer": "keyword_lowercase_normalizer", },