Skip to content

Commit

Permalink
Fix pylinting; fix assignment logic of Pharos data for rcsb_chem_comp…
Browse files Browse the repository at this point in the history
…_related.related_mapping_method in DictMethodChemRefHelper
  • Loading branch information
piehld committed Jul 25, 2024
1 parent 1960971 commit 13afe11
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -573,5 +573,5 @@ min-public-methods=2

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
# overgeneral-exceptions=builtins.BaseException,
# builtins.Exception
3 changes: 2 additions & 1 deletion rcsb/utils/dictionary/DictMethodAssemblyHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ def __getAssemblyComposition(self, dataContainer):
epTypeD = self.__commonU.getEntityPolymerTypes(dataContainer)
eTypeD = self.__commonU.getEntityTypes(dataContainer)
epTypeFilteredD = self.__commonU.getPolymerEntityFilteredTypes(dataContainer)

#
methodL = []
if dataContainer.exists("exptl"):
xObj = dataContainer.getObj("exptl")
methodL = xObj.getAttributeValueList("method")
Expand Down
7 changes: 6 additions & 1 deletion rcsb/utils/dictionary/DictMethodChemRefHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# 5-Apr-2023 dwp Stop loading rcsb_chem_comp_synonyms for rcsb_chem_comp_synonyms.type 'Brand Name' (to be loaded to new separate data item later)
# 18-Sep-2023 dwp Load COD references separately from CCDC/CSD references
# 3-May-2024 dwp Change BIRD citation method to copy categories instead of just renaming, and only apply to BIRD entries
# 25-Jul-2024 dwp Fix assignment logic of Pharos data for rcsb_chem_comp_related.related_mapping_method in addChemCompRelated()
##
"""
Helper class implements external method references supporting chemical
Expand Down Expand Up @@ -200,12 +201,16 @@ def addChemCompRelated(self, dataContainer, catName, **kwargs):

#
for rName, rIdS in xD.items():
if rName in ["PubChem", "Pharos"]:
aMethod = None
if rName in ["PubChem"]:
aMethod = "matching InChIKey in PubChem"
elif rName in ["CAS", "ChEMBL", "ChEBI"]:
aMethod = "assigned by PubChem resource"
elif rName in ["Pharos"]:
aMethod = "matching ChEMBL ID in Pharos"
if not aMethod:
logger.error("No matching condition for rName %r", rName)
continue
for rId in rIdS:
iRow = wObj.getRowCount()
wObj.setValue(ccId, "comp_id", iRow)
Expand Down
2 changes: 2 additions & 0 deletions rcsb/utils/dictionary/DictMethodCompModelHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def consolidateGlobalQAScores(self, dataContainer, catName, **kwargs):

if dataContainer.exists("ma_qa_metric_global"):
bObj = dataContainer.getObj("ma_qa_metric_global")
else:
return False

maQaMetricTypeD = self.__commonU.getMaQaMetricType(dataContainer)
maQaMetricGlobalTypeD = maQaMetricTypeD["maQaMetricGlobalTypeD"]
Expand Down
1 change: 1 addition & 0 deletions rcsb/utils/dictionary/DictMethodResourceProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ def syncCache(self, providerName, cfgOb, configName, cachePath, remotePrefix=Non
logger.debug("%r classArgs %r", providerName, classArgs)
#
useCache = True
ok = okB = True
try:
if sourceCache == "stash":
prI = self.__providerD[providerName]["class"](cachePath=cachePath, useCache=useCache, **classArgs)
Expand Down

0 comments on commit 13afe11

Please sign in to comment.