1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import sys
24
25
28 """Class containing the function for loading a pdb file."""
29
30 self.relax = relax
31
32
33 - def pdb(self, run=None, file=None, dir=None, model=None, heteronuc='N', proton='H', load_seq=1):
34 """The pdb loading function.
35
36 Keyword Arguments
37 ~~~~~~~~~~~~~~~~~
38
39 run: The run to assign the structure to.
40
41 file: The name of the PDB file.
42
43 dir: The directory where the file is located.
44
45 model: The PDB model number.
46
47 heteronuc: The name of the heteronucleus as specified in the PDB file.
48
49 proton: The name of the proton as specified in the PDB file.
50
51 load_seq: A flag specifying whether the sequence should be loaded from the PDB file.
52
53
54 Description
55 ~~~~~~~~~~~
56
57 To load a specific model from the PDB file, set the model flag to an integer i. The
58 structure beginning with the line 'MODEL i' in the PDB file will be loaded. Otherwise all
59 structures will be loaded starting from the model number 1.
60
61 To load the sequence from the PDB file, set the 'load_seq' flag to 1. If the sequence has
62 previously been loaded, then this flag will be ignored.
63
64 Once the PDB structures are loaded, unit XH bond vectors will be calculated. The vectors
65 are calculated using the atomic coordinates of the atoms specified by the arguments
66 heteronuc and proton. If more than one model structure is loaded, the unit XH vectors for
67 each model will be calculated and the final unit XH vector will be taken as the average.
68
69
70 Example
71 ~~~~~~~
72
73 To load all structures from the PDB file 'test.pdb' in the directory '~/pdb' for use in the
74 model-free analysis run 'm8' where the heteronucleus in the PDB file is 'N' and the proton
75 is 'H', type:
76
77 relax> pdb('m8', 'test.pdb', '~/pdb', 1, 'N', 'H')
78 relax> pdb(run='m8', file='test.pdb', dir='pdb', model=1, heteronuc='N', proton='H')
79
80
81 To load the 10th model from the file 'test.pdb', use:
82
83 relax> pdb('m1', 'test.pdb', model=10)
84 relax> pdb(run='m1', file='test.pdb', model=10)
85
86 """
87
88
89 if self.relax.interpreter.intro:
90 text = sys.ps3 + "pdb("
91 text = text + "run=" + `run`
92 text = text + ", file=" + `file`
93 text = text + ", dir=" + `dir`
94 text = text + ", model=" + `model`
95 text = text + ", heteronuc=" + `heteronuc`
96 text = text + ", proton=" + `proton`
97 text = text + ", load_seq=" + `load_seq` + ")"
98 print text
99
100
101 if type(run) != str:
102 raise RelaxStrError, ('run', run)
103
104
105 if type(file) != str:
106 raise RelaxStrError, ('file name', file)
107
108
109 if dir != None and type(dir) != str:
110 raise RelaxNoneStrError, ('directory name', dir)
111
112
113 if model != None and type(model) != int:
114 raise RelaxIntError, ('model', model)
115
116
117 if type(heteronuc) != str:
118 raise RelaxStrError, ('heteronucleus', heteronuc)
119
120
121 if type(proton) != str:
122 raise RelaxStrError, ('proton', proton)
123
124
125 if type(load_seq) != int or (load_seq != 0 and load_seq != 1):
126 raise RelaxBinError, ('load sequence flag', load_seq)
127
128
129 self.relax.generic.pdb.load(run=run, file=file, dir=dir, model=model, heteronuc=heteronuc, proton=proton, load_seq=load_seq)
130