Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pdb2sql related code #11

Merged
merged 2 commits into from
Oct 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ example/training_set/kernel/*
example/training_set/test/kernel/*
example/training_set/test/graph/*
_training_set_/*
.vscode/*
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()