Skip to content

Commit

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

0 comments on commit ad32f99

Please sign in to comment.