Skip to content

Commit

Permalink
added PCM/PTM checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra Peisach committed Aug 28, 2024
1 parent cb2e40f commit 19396f7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion wwpdb/apps/entity_transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
__author__ = "Ezra Peisach"
__email__ = "[email protected]"
__license__ = "Apache 2.0"
__version__ = "0.20"
__version__ = "0.21"
14 changes: 14 additions & 0 deletions wwpdb/apps/entity_transform/depict/PrdSummaryDepict.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# File: PrdSummaryDepict.py
# Date: 09-Oct-2012
# Updates:
# 25-Aug-2024 zf add following warning message:
# Unknown CCD ID covalently linked to a polymer residue, or in the polymer sequence
# Existing CCD ID without PCM data covalently linked to a polymer residue, or in the polymer sequence
# CCD ID that should be not used as PCM/PTM observed covalently linked to a polymer residue, or in the polymer sequence
##
"""
Create HTML depiction for PRD search summary.
Expand Down Expand Up @@ -50,6 +54,7 @@ def DoRenderSummaryPage(self, imageFlag=True):
self.__graphmatchResultFlag = prdUtil.getGraphmatchResultFlag()
self.__combResidueFlag = prdUtil.getCombResidueFlag()
self.__splitPolymerResidueFlag = prdUtil.getSplitPolymerResidueFlag()
self.__pcmLabelList = prdUtil.getPcmLabelList()
#
input_data = 'sessionid=' + self._sessionId + '&identifier=' + self._identifier + '&pdbid=' + self._pdbId
#
Expand Down Expand Up @@ -85,6 +90,15 @@ def DoRenderSummaryPage(self, imageFlag=True):
#
text += '<li><a class="fltlft" href="https://rcsbpdb.atlassian.net/wiki/spaces/WT/pages/2375385215/Protein+Modifications+Annotation+Documentation" target="_blank"> View PCM/PTM Documentation </a></li>\n' # noqa: E501
#
if "1" in self.__pcmLabelList:
text += '<li><span style="color:orange" class="fltlft">Unknown CCD ID covalently linked to a polymer residue, or in the polymer sequence</span></li>\n'
#
if "2" in self.__pcmLabelList:
text += '<li><span style="color:orange" class="fltlft">Existing CCD ID without PCM data covalently linked to a polymer residue, or in the polymer sequence</span></li>\n'
#
if "3" in self.__pcmLabelList:
text += '<li><span style="color:red" class="fltlft">CCD ID that should be not used as PCM/PTM observed covalently linked to a polymer residue, or in the polymer sequence</span></li>\n'
#
text += '</ul>\n'
#
return text
Expand Down
22 changes: 16 additions & 6 deletions wwpdb/apps/entity_transform/depict/ProcessPrdSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# File: ProcessPrdSummary.py
# Date: 15-Feb-2019
# Updates:
# 25-Aug-2024 zf add getPcmLabelList()
# change the default 'red' color code to different color codes read from '_pdbx_non_polymer_info.highlight_with_color' item
##
"""
Process PRD search results and generate images.
Expand Down Expand Up @@ -55,6 +57,7 @@ def __init__(self, reqObj=None, summaryCifObj=None, verbose=False, log=sys.stder
self.__graphmatchResultFlag = False
self.__combResidueFlag = False
self.__splitPolymerResidueFlag = False
self.__pcmLabelList = []

def setTopDirPath(self, topPath):
self.__topDirPath = topPath
Expand All @@ -74,6 +77,10 @@ def run(self, imageFlag=True):
if imageFlag:
self.__generateImage()
#
val = self.__cifObj.getPcmLabel()
if val:
self.__pcmLabelList = val.split(",")
#
if self.__action_required_data:
dic = {}
dic["id"] = "action"
Expand Down Expand Up @@ -112,6 +119,9 @@ def getCombResidueFlag(self):
def getSplitPolymerResidueFlag(self):
return self.__splitPolymerResidueFlag

def getPcmLabelList(self):
return self.__pcmLabelList

def __readEntityData(self):
elist = self.__cifObj.getValueList("pdbx_entity_info")
if not elist:
Expand Down Expand Up @@ -273,14 +283,14 @@ def __readNonPolymerData(self):
return
#
nonpolymermap = {}
colorList = []
colorMap = {}
for d in elist:
if ('instance_id' not in d) or ('residue_id' not in d) or ('linkage_info' not in d):
continue
#
if ("highlight_with_color" in d) and (d["highlight_with_color"] == "Y"):
if d['residue_id'] not in colorList:
colorList.append(d['residue_id'])
if ("highlight_with_color" in d) and d["highlight_with_color"]:
if d['residue_id'] not in colorMap:
colorMap[d['residue_id']] = d["highlight_with_color"]
#
#
if d['linkage_info'] == 'linked':
Expand Down Expand Up @@ -308,8 +318,8 @@ def __readNonPolymerData(self):
for k in keylist:
v = nonpolymermap[k]
count = len(v)
if k in colorList:
text = '<span style="color:red;">' + k + "</span> (" + str(count) + " "
if k in colorMap:
text = '<span style="color:' + colorMap[k] + ';">' + k + "</span> (" + str(count) + " "
else:
text = k + ' (' + str(count) + ' '
#
Expand Down
4 changes: 4 additions & 0 deletions wwpdb/apps/entity_transform/utils/SummaryCifUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# File: SummaryCifUtil.py
# Date: 17-Oct-2012
# Updates:
# 25-Aug-2024 zf add getPcmLabel() method to read PCM information from '_entry.pcm_label' item
##
"""
Read and handle search summary cif file.
Expand Down Expand Up @@ -70,6 +71,9 @@ def getEntryIds(self):
def getFileId(self):
return self.__cifObj.GetSingleValue('entry', 'file')

def getPcmLabel(self):
return self.__cifObj.GetSingleValue('entry', 'pcm_label')

def getTitle(self):
return self.__cifObj.GetSingleValue('struct', 'title')

Expand Down

0 comments on commit 19396f7

Please sign in to comment.