Skip to content

Commit

Permalink
opt_jobs added
Browse files Browse the repository at this point in the history
  • Loading branch information
nirajverma288 committed Jul 9, 2019
1 parent 349bec7 commit c0fdc95
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
12 changes: 10 additions & 2 deletions denovo.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def initialize(self):
[1.0,-1.0,1.0], [-1.0,1.0,1.0], [-1.0,-1.0,-1.0], [-1.0,-1.0,1.0],
[-1.0,1.0,-1.0], [1.0,-1.0,-1.0]])

#self.direcn = np.array([[1.0,0.0,0.0], [-1.0,0.0,0.0], [0.0,1.0,0.0], [0.0,-1.0,0.0],
# [0.0,0.0,1.0], [0.0,0.0,-1.0]])

if self.test:
self.res_d = np.load('models/res_d.npy').item()
chk = len(self.res_d)
Expand Down Expand Up @@ -218,7 +221,8 @@ def data_extraction(lines):
s=line.strip().split()[-1]
#print (line.strip())
x, y, z = list(map(float, [x, y, z]))
if is_backbone(s, at):
if at == 'CA':# is_backbone(s, at):
#print (at)
if rt+_0 not in d:
l[len(d)] = rt+_0
d[rt+_0]=[[x, y, z]]
Expand Down Expand Up @@ -583,7 +587,11 @@ def map_pdb(self):
new_cord = dis[i]*v + cords[i]
cords.append(new_cord)

r = animate.render(np.amax(cords)/2)
r = animate.render(abs(np.amax(cords)-np.amin(cords))/2)

print (np.array(cords))

np.save('map_grid.npy', {'gen':cords, 'org':self.ref_coord})

r.plot_final(cords, self.ref_coord)

Expand Down
51 changes: 51 additions & 0 deletions opt_jobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import os
import numpy as np


class Work:
def __init__(self, seq, grid, name):
self.seq = seq
self.grid = grid
self.name = name

def gen_CA_pdb(self):
st = ''

for i in range (len(self.seq)):
l = ['ATOM', str(i+1), 'CA', self.seq[i], 'A', str(i+1), self.grid[i][0], self.grid[i][1], self.grid[i][2], '1.00', '0.00', 'C']
print ("{:>4}{:>7}{:>5}{:>4}{:>2}{:>4}{:>12}{:>8}{:>8}{:>6}{:>6}{:>12}".format(*l))
st += "{:>4}{:>7}{:>5}{:>4}{:>2}{:>4}{:>12}{:>8}{:>8}{:>6}{:>6}{:>12}".format(*l)+'\n'

st += 'TER\nEND'

g = open(self.name+'_CA.pdb','w')
g.write(st)
g.close()



if __name__ == '__main__':
name = '1k43'
seq = ['ARG', 'GLY', 'LYS', 'TRP', 'THR', 'TYR', 'ASN', 'GLY', 'ILE', 'THR', 'TYR', 'GLU', 'GLY', 'ARG']
grid = np.array([[0.0, 0.0, 0.0],
[3.78, 0.0, 0.0],
[7.56, 0.0, 0.0],
[11.35, 0.0, 0.0],
[15.14, 0.0, 0.0],
[18.92, 0.0, 0.0],
[22.71, 0.0, 0.0],
[26.49, 0.0, 0.0],
[30.28, 0.0, 0.0],
[34.06, 0.0, 0.0],
[37.84, 0.0, 0.0],
[41.63, 0.0, 0.0],
[45.42, 0.0, 0.0],
[49.20, 0.0, 0.0]])

w = Work(seq, grid, name)

w.gen_CA_pdb()

# for making pdb from CA
# java apps.BBQ -bbq.fix_r12=T -ip=1k43_CA.pdb
# add side chains via SCWRL

0 comments on commit c0fdc95

Please sign in to comment.