Skip to content

Commit

Permalink
final test chembl. Fixed mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
jal347 committed Oct 3, 2024
1 parent 18b24d9 commit 37731d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/hub/dataload/sources/chembl/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def parse_data(data):
for uniprot_accession in uniprot_accessions:
output = {
"_id": uniprot_accession,
"chembl_target": item["target_chembl_id"],
"xrefs": {
"accession": uniprot_accession,
"chembl": {
"chembl_target": item["target_chembl_id"],
"uniprot_accession": uniprot_accession,
},
}
yield output
Expand Down
14 changes: 6 additions & 8 deletions src/hub/dataload/sources/chembl/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,18 @@ def load_data(self, data_folder):
target_filepaths = glob.iglob(
os.path.join(data_folder, self.TARGET_FILENAME_PATTERN)
)
# for doc in load_data(target_filepaths):
# yield doc
return self.keylookup(load_data)(target_filepaths)

@classmethod
def get_mapping(klass):
mapping = {
"chembl_target": {
"type": "keyword",
"normalizer": "keyword_lowercase_normalizer",
},
"xrefs": {
"chembl": {
"properties": {
"accession": {
"chembl_target": {
"type": "keyword",
"normalizer": "keyword_lowercase_normalizer",
},
"uniprot_accession": {
"type": "keyword",
"normalizer": "keyword_lowercase_normalizer",
},
Expand Down

0 comments on commit 37731d5

Please sign in to comment.