Skip to content

Commit

Permalink
Feat: V0.67 Add SCOP2/ECOD polymer entity instance annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jdwestbrook committed Aug 25, 2021
1 parent 213b3e9 commit 24a8b2f
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test-output/
CACHE/
LOGTOX
.tox/
.vscode/
# C extensions
*.so

Expand Down
2 changes: 2 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@
4-Aug-2021 - V0.64 Update dependencies and logging verbosity
13-Aug-2021 - V0.65 Remove possible redundancy in target cofactor data
13-Aug-2021 - V0.66 Remove possible redundancy in target reference assignments
25-Aug-2021 - V0.67 Add SCOP2/ECOD polymer entity instance annotations
#
#
125 changes: 125 additions & 0 deletions rcsb/utils/dictionary/DictMethodEntityInstanceHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ def buildEntityInstanceFeatures(self, dataContainer, catName, **kwargs):
#
ii += 1
#

# --- SAbDab
sabdabP = rP.getResource("SAbDabTargetFeatureProvider instance") if rP else None
if sabdabP:
Expand Down Expand Up @@ -1797,6 +1798,130 @@ def buildEntityInstanceAnnotations(self, dataContainer, catName, **kwargs):
cObj.setValue(version, "assignment_version", ii)
#
ii += 1
# JDW - Add SCOP2 family assignments
scopU = rP.getResource("Scop2Provider instance") if rP else None
if scopU:
version = scopU.getVersion()
for asymId, authAsymId in asymAuthIdD.items():
if instTypeD[asymId] not in ["polymer", "branched"]:
continue
entityId = asymIdD[asymId]
# Family mappings
dL = scopU.getFamilyResidueRanges(entryId.upper(), authAsymId)
for (domId, familyId, _, _, _) in dL:
cObj.setValue(ii + 1, "ordinal", ii)
cObj.setValue(entryId, "entry_id", ii)
cObj.setValue(entityId, "entity_id", ii)
cObj.setValue(asymId, "asym_id", ii)
cObj.setValue(authAsymId, "auth_asym_id", ii)
cObj.setValue("SCOP2", "type", ii)
#
cObj.setValue(domId, "annotation_id", ii)
cObj.setValue(scopU.getName(familyId), "name", ii)
#
tL = [t if t is not None else "" for t in scopU.getNameLineage(familyId)]
cObj.setValue(";".join(tL), "annotation_lineage_name", ii)
idLinL = scopU.getIdLineage(familyId)
cObj.setValue(";".join([str(t) for t in idLinL]), "annotation_lineage_id", ii)
cObj.setValue(";".join([str(jj) for jj in range(1, len(idLinL) + 1)]), "annotation_lineage_depth", ii)
#
cObj.setValue("SCOP2", "provenance_source", ii)
cObj.setValue(version, "assignment_version", ii)
#
ii += 1
# ------------
# Add SCOP2 superfamily assignments
for asymId, authAsymId in asymAuthIdD.items():
if instTypeD[asymId] not in ["polymer", "branched"]:
continue
entityId = asymIdD[asymId]
# Family mappings
dL = scopU.getSuperFamilyResidueRanges(entryId.lower(), authAsymId)
for (domId, superfamilyId, _, _, _) in dL:

cObj.setValue(ii + 1, "ordinal", ii)
cObj.setValue(entryId, "entry_id", ii)
cObj.setValue(entityId, "entity_id", ii)
cObj.setValue(asymId, "asym_id", ii)
cObj.setValue(authAsymId, "auth_asym_id", ii)
cObj.setValue("SCOP2", "type", ii)
#
cObj.setValue(domId, "annotation_id", ii)
cObj.setValue(scopU.getName(superfamilyId), "name", ii)
#
tL = [t if t is not None else "" for t in scopU.getNameLineage(superfamilyId)]
cObj.setValue(";".join(tL), "annotation_lineage_name", ii)
idLinL = scopU.getIdLineage(superfamilyId)
cObj.setValue(";".join([str(t) for t in idLinL]), "annotation_lineage_id", ii)
cObj.setValue(";".join([str(jj) for jj in range(1, len(idLinL) + 1)]), "annotation_lineage_depth", ii)
#
cObj.setValue("SCOP2", "provenance_source", ii)
cObj.setValue(version, "assignment_version", ii)
#
ii += 1
# ----
# Add SCOP2B superfamily assignments
for asymId, authAsymId in asymAuthIdD.items():
if instTypeD[asymId] not in ["polymer", "branched"]:
continue
entityId = asymIdD[asymId]
# Family mappings
dL = scopU.getSuperFamilyResidueRanges2B(entryId.lower(), authAsymId)
for (domId, superfamilyId, _, _, _) in dL:
cObj.setValue(ii + 1, "ordinal", ii)
cObj.setValue(entryId, "entry_id", ii)
cObj.setValue(entityId, "entity_id", ii)
cObj.setValue(asymId, "asym_id", ii)
cObj.setValue(authAsymId, "auth_asym_id", ii)
cObj.setValue("SCOP2", "type", ii)
#
cObj.setValue(domId, "annotation_id", ii)
cObj.setValue(scopU.getName(superfamilyId), "name", ii)
#
tL = [t if t is not None else "" for t in scopU.getNameLineage(superfamilyId)]
cObj.setValue(";".join(tL), "annotation_lineage_name", ii)
idLinL = scopU.getIdLineage(superfamilyId)
cObj.setValue(";".join([str(t) for t in idLinL]), "annotation_lineage_id", ii)
cObj.setValue(";".join([str(jj) for jj in range(1, len(idLinL) + 1)]), "annotation_lineage_depth", ii)
#
cObj.setValue("SCOP2B", "provenance_source", ii)
cObj.setValue(version, "assignment_version", ii)
#
ii += 1
# ------------
# ECOD assignments -
ecodU = rP.getResource("EcodProvider instance") if rP else None
if ecodU:
version = ecodU.getVersion()
for asymId, authAsymId in asymAuthIdD.items():
if instTypeD[asymId] not in ["polymer", "branched"]:
continue
entityId = asymIdD[asymId]
# Family mappings
dL = ecodU.getFamilyResidueRanges(entryId.lower(), authAsymId)
for (domId, familyId, _, _, _) in dL:
cObj.setValue(ii + 1, "ordinal", ii)
cObj.setValue(entryId, "entry_id", ii)
cObj.setValue(entityId, "entity_id", ii)
cObj.setValue(asymId, "asym_id", ii)
cObj.setValue(authAsymId, "auth_asym_id", ii)
cObj.setValue("ECOD", "type", ii)
#
fName = ecodU.getName(familyId)[3:]
cObj.setValue(domId, "annotation_id", ii)
cObj.setValue(fName, "name", ii)
#

tL = [t if t is not None else "" for t in ecodU.getNameLineage(familyId)]
cObj.setValue(";".join(tL), "annotation_lineage_name", ii)
idLinL = ecodU.getIdLineage(familyId)
cObj.setValue(";".join([str(t) for t in idLinL]), "annotation_lineage_id", ii)
cObj.setValue(";".join([str(jj) for jj in range(1, len(idLinL) + 1)]), "annotation_lineage_depth", ii)
#
cObj.setValue("ECOD", "provenance_source", ii)
cObj.setValue(version, "assignment_version", ii)
#
ii += 1
# ------------
# Add covalent attachment property
npbD = self.__commonU.getBoundNonpolymersByInstance(dataContainer)
Expand Down
2 changes: 1 addition & 1 deletion rcsb/utils/dictionary/__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__ = "0.66"
__version__ = "0.67"

0 comments on commit 24a8b2f

Please sign in to comment.