forked from Pymol-Scripts/Pymol-script-repo
-
Notifications
You must be signed in to change notification settings - Fork 11
/
nmr_cnstr.py
66 lines (58 loc) · 2.51 KB
/
nmr_cnstr.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'''
See more here: http://www.pymolwiki.org/index.php/nmr_cnstr
##############################################################################################################
# Pymol Script: For visualizing the NMR constrains (DYANA & CNS format), on top of the calculated structure. #
# Author: Evangelos Papadopoulos. #
# previous affiliation: Dept. of Biochemistry and Biophysics, #
# Arrhenius Laboratories, #
# Stockholm University #
# SE-106 91 Stockholm, Sweden #
# email:[email protected] #
# NOTES: This is a preliminary version. #
# #
# Reference: please if you find this script usefull add the following reference: #
# NMR Solution Structure of the Peptide Fragment 1-30, Derived from Unprocessed Mouse Doppel #
# Protein, in DHPC Micelles. Biochemistry. 2006 Jan 10;45(1):159-166. PMID: 16388591 #
# #
##############################################################################################################
'''
def upl(fname):
f=open(fname,'r')
i=1
upl=f.readline()
#
while upl!='':
print upl,i
cns=string.split(upl)
cmd.dist('upl'+str(i),'i. '+cns[0]+' & n. '+cns[2],'i. '+cns[3]+' & n. '+cns[5])
upl=f.readline()
i+=1
#
f.close()
cmd.hide('labels')
cmd.set ('dash_gap', 0.05)
cmd.do ("orient")
cmd.set ('movie_delay', 1500)
def cns(fname):
f=open(fname,'r')
i=1
upl=f.readline()
print upl,i
while upl!='':
if upl=='\n':
upl=f.readline()
continue
cns=string.split(upl)
print cns,i
if cns[0]=='assign' :
print 'CNS'
if cns[5]=='HB*': print 'CNS***'
cmd.dist('upl'+str(i),'i. '+cns[2]+' & n. '+cns[5],'i. '+cns[7]+' & n. '+cns[10])
i+=1
upl=f.readline()
print '*'+upl+'*',i
f.close()
cmd.set ('dash_gap', 0.05)
cmd.hide('labels')
cmd.do ("orient")
cmd.set ('movie_delay', 1500)