Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
residue features centered on CB/CA
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoRenaud committed Mar 14, 2019
1 parent 60d4197 commit 34ccda5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
9 changes: 7 additions & 2 deletions deeprank/features/BSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ def get_contact_residue_sasa(self,cutoff=8.5):

# define the xyz key : (chain,x,y,z)
chain = {'A':0,'B':1}[r[0]]
xyz = np.mean(self.sql.get('x,y,z',resSeq=r[1],chainID=r[0]),0)
xyzkey = tuple([chain]+xyz.tolist())

atcenter = 'CB'
if r[2] == 'GLY':
atcenter = 'CA'
xyz = self.sql.get('x,y,z',resSeq=r[1],chainID=r[0],name=atcenter)[0]
#xyz = np.mean(self.sql.get('x,y,z',resSeq=r[1],chainID=r[0]),0)
xyzkey = tuple([chain]+xyz)

# put the data in dict
self.bsa_data[r] = [bsa]
Expand Down
2 changes: 1 addition & 1 deletion deeprank/features/FullPSSM.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def get_feature_value(self,contact_only=True):
"""get the feature value."""

sql = pdb2sql(self.pdbfile)

xyz_info = sql.get('chainID,resSeq,resName',name='CB')
xyz_info += sql.get('chainID,resSeq,resName',name='CA',resName='GLY')

Expand Down
3 changes: 3 additions & 0 deletions deeprank/features/PSSM_IC.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def get_feature_value(self,contact_only=True):

sql = pdb2sql(self.pdbfile)
xyz_info = sql.get('chainID,resSeq,resName',name='CB')
xyz_info += sql.get('chainID,resSeq,resName',name='CA',resName='GLY')

xyz = sql.get('x,y,z',name='CB')
xyz += sql.get('x,y,z',name='CA',resName='GLY')

xyz_dict = {}
for pos,info in zip(xyz,xyz_info):
Expand Down
10 changes: 8 additions & 2 deletions deeprank/features/ResidueDensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,15 @@ def extract_features(self):
# total density in raw format
self.feature_data['RCD_total'][key] = [res.density['total']]

# total density in xyz format
# get the type of the center
atcenter = 'CB'
if key[2] == 'GLY':
atcenter = 'CA'

# get the xyz of the center atom
xyz = self.sql.get('x,y,z',resSeq=key[1],chainID=key[0],name=atcenter)[0]
#xyz = np.mean(self.sql.get('x,y,z',resSeq=key[1],chainID=key[0]),0).tolist()

xyz = np.mean(self.sql.get('x,y,z',resSeq=key[1],chainID=key[0]),0).tolist()
xyz_key = tuple([{'A':0,'B':1}[key[0]]] + xyz)
self.feature_data_xyz['RCD_total'][xyz_key] = [res.density['total']]

Expand Down

0 comments on commit 34ccda5

Please sign in to comment.