Skip to content

Commit

Permalink
update pdb2sql realted code
Browse files Browse the repository at this point in the history
  • Loading branch information
CunliangGeng committed Oct 23, 2019
1 parent 4a805ec commit 17e25b6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion iScore/energetic/internal_energy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import numpy as np
from pdb2sql.pdb2sqlcore import pdb2sql
from pdb2sql import pdb2sql

class InternalEnergy(object):

Expand Down
8 changes: 4 additions & 4 deletions iScore/graphrank/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import scipy.io as spio
import pickle
import h5py
from pdb2sql.pdb2sqlcore import pdb2sql
from pdb2sql.interface import interface
from pdb2sql import pdb2sql
from pdb2sql import interface
from Bio import pairwise2
import warnings

Expand Down Expand Up @@ -301,7 +301,7 @@ def __init__(self,pdbfile,pssmfile, aligned=True, export=True,

# pdb file
self.pdbfile = pdbfile
self.pdb = pdb2sql(self.pdbfile,no_extra=True)
self.pdb = pdb2sql(self.pdbfile)

# residue name translation dict
self.resmap = {
Expand Down Expand Up @@ -556,7 +556,7 @@ def get_graph(self,name=None):

if name is None:
name = os.path.splitext(self.pdbfile)[0]

return Graph(name = name,
nodes_pssm = nodes_pssm,
nodes_info = nodes_info,
Expand Down
10 changes: 5 additions & 5 deletions iScore/h5x/baseimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import subprocess as sp

from pdb2sql.pdb2sqlcore import pdb2sql
from pdb2sql import pdb2sql


def launchPyMol(grp):
Expand Down Expand Up @@ -34,8 +34,8 @@ def launchPyMol(grp):

for n in grp['nodes']:
db.exportpdb(tmp_file,append=True,
chainID=n[0].decode('utf-8'),
resSeq= n[1].decode('utf-8'),
chainID=n[0].decode('utf-8'),
resSeq= n[1].decode('utf-8'),
resName=n[2].decode('utf-8'))

f.write("# load the contact\n")
Expand All @@ -46,8 +46,8 @@ def launchPyMol(grp):
nodes = []
f.write('graph = [\n')
for n in grp['nodes']:
xyz = db.get('x,y,z',chainID=n[0].decode('utf-8'),
resSeq= n[1].decode('utf-8'),
xyz = db.get('x,y,z',chainID=n[0].decode('utf-8'),
resSeq= n[1].decode('utf-8'),
resName=n[2].decode('utf-8'))
xyz = np.mean(xyz,0)
nodes.append(xyz)
Expand Down
3 changes: 1 addition & 2 deletions iScore/pssm/pssm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os, glob, shutil
from Bio.Blast.Applications import NcbipsiblastCommandline
from pdb2sql.pdb2sqlcore import pdb2sql
from pdb2sql import pdb2sql

from iScore.pssm.map_pssm2pdb import write_mapped_pssm_pdb

Expand Down Expand Up @@ -236,4 +236,3 @@ def map_pssm(self,pssm_dir='pssm_raw',outdir='pssm',chain=['A','B']):
for c in chain:
pssm = os.path.join(pssm_dir,pssm_files[c])
write_mapped_pssm_pdb(pssm, pdb, c, outdir)

4 changes: 0 additions & 4 deletions test/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ def setUp(self):

if __name__ == '__main__':
unittest.main()




0 comments on commit 17e25b6

Please sign in to comment.