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

Commit

Permalink
Merge d3e0562 into 3594e05
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniBodor committed Feb 3, 2023
2 parents 3594e05 + d3e0562 commit e33f41d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions deeprank/features/FullPSSM.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def read_PSSM_data(self):
self.pssm_res_id = np.array(raw_data)[:, :3]
self.pssm_res_id = [(r[0], int(r[1]), r[2])
for r in self.pssm_res_id]
self.pssm_data = np.array(raw_data)[:, 3:].astype(np.float)
self.pssm_data = np.array(raw_data)[:, 3:].astype(np.float32)

# new format with ≥2 files (each chain has one file)
# and aligned mapping and IC (i.e. the iScore format)
Expand Down Expand Up @@ -148,9 +148,9 @@ def read_PSSM_data(self):
rd = np.array(raw_data)[1:, :2]
rd = [(chainID, int(r[0]), resmap[r[1]]) for r in rd]
if self.out_type == 'pssmvalue':
pd = np.array(raw_data)[1:, 4:-1].astype(np.float)
pd = np.array(raw_data)[1:, 4:-1].astype(np.float32)
else:
pd = np.array(raw_data)[1:, -1].astype(np.float)
pd = np.array(raw_data)[1:, -1].astype(np.float32)
pd = pd.reshape(pd.shape[0], -1)

if iiter == 0:
Expand Down
2 changes: 1 addition & 1 deletion deeprank/learn/rankingMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def success(rs):
"""
success = np.cumsum(rs) > 0

return success.astype(np.int)
return success.astype(np.int32)


def avprec(rs):
Expand Down
16 changes: 8 additions & 8 deletions deeprank/tools/sasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def get_residue_center(self, chain1='A', chain2='B'):
resA = np.array(sql.get('resSeq,resName', chainID=chain1))
resB = np.array(sql.get('resSeq,resName', chainID=chain2))

resSeqA = np.unique(resA[:, 0].astype(np.int))
resSeqB = np.unique(resB[:, 0].astype(np.int))
resSeqA = np.unique(resA[:, 0].astype(np.int32))
resSeqB = np.unique(resB[:, 0].astype(np.int32))

self.xyz = {}

Expand Down Expand Up @@ -106,14 +106,14 @@ def get_residue_carbon_beta(self, chain1='A', chain2='B'):
chainID=chain2))
sql._close()

assert len(resA[:, 0].astype(np.int).tolist()) == len(
np.unique(resA[:, 0].astype(np.int)).tolist())
assert len(resB[:, 0].astype(np.int).tolist()) == len(
np.unique(resB[:, 0].astype(np.int)).tolist())
assert len(resA[:, 0].astype(np.int32).tolist()) == len(
np.unique(resA[:, 0].astype(np.int32)).tolist())
assert len(resB[:, 0].astype(np.int32).tolist()) == len(
np.unique(resB[:, 0].astype(np.int32)).tolist())

self.xyz = {}
self.xyz[chain1] = resA[:, 2:].astype(np.float)
self.xyz[chain2] = resB[:, 2:].astype(np.float)
self.xyz[chain1] = resA[:, 2:].astype(np.float32)
self.xyz[chain2] = resB[:, 2:].astype(np.float32)

self.resinfo = {}
self.resinfo[chain1] = resA[:, :2]
Expand Down
4 changes: 2 additions & 2 deletions deeprank/utils/cal_hitrate_successrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def evaluate(data):
for caseID, df_one_case in df_grped:
df_sorted = df_one_case.sort_values(by=M, ascending=True)
hitrate.extend(rankingMetrics.hitrate(
df_sorted['target'].astype(np.int)))
df_sorted['target'].astype(np.int32)))
success.extend(rankingMetrics.success(
df_sorted['target'].astype(np.int)))
df_sorted['target'].astype(np.int32)))
caseIDs.extend([caseID] * len(df_one_case))

# success =[0, 0, 1, 1, 1,...]: starting from rank 3 this case is a success
Expand Down

0 comments on commit e33f41d

Please sign in to comment.