Skip to content

Commit

Permalink
test 1-1 no _id
Browse files Browse the repository at this point in the history
  • Loading branch information
jal347 committed Oct 3, 2024
1 parent ad32f99 commit e6aea8c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
33 changes: 16 additions & 17 deletions src/hub/dataload/sources/chembl/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions src/hub/dataload/sources/chembl/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -65,7 +65,7 @@ def get_mapping(klass):
"type": "keyword",
"normalizer": "keyword_lowercase_normalizer",
},
"uniprot_accessions": {
"uniprot_accession": {
"type": "keyword",
"normalizer": "keyword_lowercase_normalizer",
},
Expand Down

0 comments on commit e6aea8c

Please sign in to comment.