Skip to content

Commit

Permalink
Merge pull request #26 from rcsb/dev-dwp
Browse files Browse the repository at this point in the history
V1.24 Update tree loading for CARD ontology data
  • Loading branch information
piehld authored Aug 27, 2024
2 parents 4ce0f46 + 4d1ef24 commit 906b407
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@
13-May-2024 V1.21 Update requirements; fix linting
17-Jul-2024 V1.22 Adjust LigandNeighborMappingExtractor
20-Aug-2024 V1.23 Add support for target cofactor data loading
27-Aug-2024 V1.24 Update tree loading for CARD ontology data
2 changes: 1 addition & 1 deletion rcsb/exdb/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
__author__ = "John Westbrook"
__email__ = "[email protected]"
__license__ = "Apache 2.0"
__version__ = "1.23"
__version__ = "1.24"
32 changes: 25 additions & 7 deletions rcsb/exdb/tree/TreeNodeListWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# 9-Sep-2019 jdw add AtcProvider() and ChemrefExtractor() for ATC tree.
# 12-Apr-2023 dwp add CARD ontology tree
# 8-Aug-2023 dwp Load full (unfiltered) taxonomy tree node list, and stop loading GO tree (will be loaded in DW instead)
# 27-Aug-2024 dwp Update CARD ontology tree loading
#
##
__docformat__ = "google en"
Expand Down Expand Up @@ -181,13 +182,30 @@ def load(self, updateId, loadType="full", doLoad=True):
ok = dl.load(databaseName, collectionName, loadType=loadType, documentList=nL, indexAttributeList=["update_id"], keyNames=None, addValues=addValues, schemaLevel=None)
self.__updateStatus(updateId, databaseName, collectionName, ok, statusStartTimestamp)
# ---- CARD
cou = CARDTargetOntologyProvider(cachePath=self.__cachePath, useCache=False)
nL = cou.getTreeNodeList()
logger.info("Starting load of EC node tree length %d", len(nL))
if doLoad:
collectionName = "tree_card_node_list"
ok = dl.load(databaseName, collectionName, loadType=loadType, documentList=nL, indexAttributeList=["update_id"], keyNames=None, addValues=addValues, schemaLevel=None)
self.__updateStatus(updateId, databaseName, collectionName, ok, statusStartTimestamp)
okCou = True
cou = CARDTargetOntologyProvider(cachePath=self.__cachePath, useCache=useCache)
if not cou.testCache():
ok = cou.buildOntologyData()
cou.reload()
if not (ok and cou.testCache()):
logger.error("Skipping load of CARD Target Ontology tree data because it is missing.")
okCou = False
if okCou:
nL = cou.getTreeNodeList()
logger.info("Starting load of CARD ontology node tree length %d", len(nL))
if doLoad:
collectionName = "tree_card_node_list"
ok = dl.load(
databaseName,
collectionName,
loadType=loadType,
documentList=nL,
indexAttributeList=["update_id"],
keyNames=None,
addValues=addValues,
schemaLevel=None
)
self.__updateStatus(updateId, databaseName, collectionName, ok, statusStartTimestamp)
# ---- Taxonomy
tU = TaxonomyProvider(cachePath=self.__cachePath, useCache=useCache)
if self.__useFilteredLists:
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ rcsb.utils.ec >= 0.25
rcsb.utils.go >= 0.18
rcsb.utils.seq >= 0.82
rcsb.utils.seqalign >= 0.29
rcsb.utils.targets >= 0.80
rcsb.utils.targets >= 0.82
rcsb.utils.struct >= 0.47
rcsb.utils.taxonomy >= 0.43
rcsb.utils.dictionary >= 1.26
rcsb.workflow >= 0.44
rcsb.utils.dictionary >= 1.27
rcsb.workflow >= 0.45
statistics; python_version < "3.0"

0 comments on commit 906b407

Please sign in to comment.