Package test_suite :: Package system_tests :: Module structure
[hide private]
[frames] | no frames]

Source Code for Module test_suite.system_tests.structure

   1  ############################################################################### 
   2  #                                                                             # 
   3  # Copyright (C) 2008-2017,2019 Edward d'Auvergne                              # 
   4  # Copyright (C) 2011 Han Sun                                                  # 
   5  #                                                                             # 
   6  # This file is part of the program relax (http://www.nmr-relax.com).          # 
   7  #                                                                             # 
   8  # This program is free software: you can redistribute it and/or modify        # 
   9  # it under the terms of the GNU General Public License as published by        # 
  10  # the Free Software Foundation, either version 3 of the License, or           # 
  11  # (at your option) any later version.                                         # 
  12  #                                                                             # 
  13  # This program is distributed in the hope that it will be useful,             # 
  14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
  15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
  16  # GNU General Public License for more details.                                # 
  17  #                                                                             # 
  18  # You should have received a copy of the GNU General Public License           # 
  19  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
  20  #                                                                             # 
  21  ############################################################################### 
  22   
  23  # Python module imports. 
  24  from math import sqrt 
  25  from numpy import array, average, dot, float64, mean, sign, std, zeros 
  26  from numpy.linalg import norm 
  27  from os import path, sep 
  28  from re import search 
  29  import sys 
  30  from tempfile import mkdtemp, mkstemp 
  31   
  32  # relax module imports. 
  33  from data_store import Relax_data_store; ds = Relax_data_store() 
  34  from pipe_control.mol_res_spin import count_spins, return_spin, spin_loop 
  35  from lib.errors import RelaxError 
  36  from lib.geometry.rotations import axis_angle_to_R, euler_to_R_zyz 
  37  from lib.geometry.vectors import vector_angle_acos 
  38  from lib.io import DummyFileObject 
  39  from status import Status; status = Status() 
  40  from test_suite.system_tests.base_classes import SystemTestCase 
  41   
  42   
43 -class Structure(SystemTestCase):
44 """Class for testing the structural objects.""" 45
46 - def setUp(self):
47 """Set up for all the functional tests.""" 48 49 # Create the data pipe. 50 self.interpreter.pipe.create('mf', 'mf') 51 52 # Create a temporary directory for dumping files. 53 ds.tmpdir = mkdtemp()
54 55
56 - def strip_remarks(self, lines):
57 """Strip out all PDB remark lines. 58 59 @param lines: The list of PDB lines. 60 @type lines: list of str 61 """ 62 63 # Rebuild the list. 64 lines[:] = [x for x in lines if x[:6] != 'REMARK']
65 66
68 """Check the operation of the structure.add_helix and structure.add_sheet user functions.""" 69 70 # Path of the structure file. 71 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 72 73 # Load the file. 74 self.interpreter.structure.read_pdb('2BE6.pdb', dir=path, read_mol=[1, 4], set_mol_name='CaM A', alt_loc='A') 75 self.interpreter.structure.read_pdb('2BE6.pdb', dir=path, read_mol=[2, 5], set_mol_name='CaM B', alt_loc='A') 76 self.interpreter.structure.read_pdb('2BE6.pdb', dir=path, read_mol=[3, 6], set_mol_name='CaM C', alt_loc='A') 77 78 # Strip out the secondary structure. 79 self.interpreter.structure.delete_ss() 80 81 # Manually recreate the secondary structure. 82 self.interpreter.structure.add_helix(start=5, end=20, mol_name='CaM A') 83 self.interpreter.structure.add_helix(start=28, end=39, mol_name='CaM A') 84 self.interpreter.structure.add_helix(start=44, end=56, mol_name='CaM A') 85 self.interpreter.structure.add_helix(start=65, end=76, mol_name='CaM A') 86 self.interpreter.structure.add_helix(start=81, end=93, mol_name='CaM A') 87 self.interpreter.structure.add_helix(start=101, end=112, mol_name='CaM A') 88 self.interpreter.structure.add_helix(start=117, end=129, mol_name='CaM A') 89 self.interpreter.structure.add_helix(start=138, end=146, mol_name='CaM A') 90 self.interpreter.structure.add_helix(start=1615, end=1638, mol_name='CaM A') 91 self.interpreter.structure.add_helix(start=5, end=20, mol_name='CaM B') 92 self.interpreter.structure.add_helix(start=28, end=39, mol_name='CaM B') 93 self.interpreter.structure.add_helix(start=44, end=56, mol_name='CaM B') 94 self.interpreter.structure.add_helix(start=65, end=78, mol_name='CaM B') 95 self.interpreter.structure.add_helix(start=82, end=93, mol_name='CaM B') 96 self.interpreter.structure.add_helix(start=101, end=113, mol_name='CaM B') 97 self.interpreter.structure.add_helix(start=117, end=129, mol_name='CaM B') 98 self.interpreter.structure.add_helix(start=138, end=145, mol_name='CaM B') 99 self.interpreter.structure.add_helix(start=1612, end=1625, mol_name='CaM B') 100 self.interpreter.structure.add_helix(start=5, end=20, mol_name='CaM C') 101 self.interpreter.structure.add_helix(start=28, end=39, mol_name='CaM C') 102 self.interpreter.structure.add_helix(start=44, end=56, mol_name='CaM C') 103 self.interpreter.structure.add_helix(start=65, end=75, mol_name='CaM C') 104 self.interpreter.structure.add_helix(start=82, end=93, mol_name='CaM C') 105 self.interpreter.structure.add_helix(start=101, end=112, mol_name='CaM C') 106 self.interpreter.structure.add_helix(start=117, end=129, mol_name='CaM C') 107 self.interpreter.structure.add_helix(start=138, end=145, mol_name='CaM C') 108 self.interpreter.structure.add_helix(start=1617, end=1636, mol_name='CaM C') 109 self.interpreter.structure.add_sheet(strand=1, sheet_id='A', strand_count=2, strand_sense=0, start=26, end=27, mol_name='CaM A') 110 self.interpreter.structure.add_sheet(strand=2, sheet_id='A', strand_count=2, strand_sense=-1, start=63, end=64, mol_name='CaM A', current_atom='O', prev_atom='N') 111 self.interpreter.structure.add_sheet(strand=1, sheet_id='B', strand_count=2, strand_sense=0, start=99, end=100, mol_name='CaM A') 112 self.interpreter.structure.add_sheet(strand=2, sheet_id='B', strand_count=2, strand_sense=-1, start=136, end=137, mol_name='CaM A', current_atom='O', prev_atom='N') 113 self.interpreter.structure.add_sheet(strand=1, sheet_id='C', strand_count=2, strand_sense=0, start=26, end=27, mol_name='CaM B') 114 self.interpreter.structure.add_sheet(strand=2, sheet_id='C', strand_count=2, strand_sense=-1, start=63, end=64, mol_name='CaM B', current_atom='O', prev_atom='N') 115 self.interpreter.structure.add_sheet(strand=1, sheet_id='D', strand_count=2, strand_sense=0, start=99, end=100, mol_name='CaM B') 116 self.interpreter.structure.add_sheet(strand=2, sheet_id='D', strand_count=2, strand_sense=-1, start=136, end=137, mol_name='CaM B', current_atom='O', prev_atom='N') 117 self.interpreter.structure.add_sheet(strand=1, sheet_id='E', strand_count=2, strand_sense=0, start=26, end=27, mol_name='CaM C') 118 self.interpreter.structure.add_sheet(strand=2, sheet_id='E', strand_count=2, strand_sense=-1, start=63, end=64, mol_name='CaM C', current_atom='O', prev_atom='N') 119 self.interpreter.structure.add_sheet(strand=1, sheet_id='F', strand_count=2, strand_sense=0, start=99, end=100, mol_name='CaM C') 120 self.interpreter.structure.add_sheet(strand=2, sheet_id='F', strand_count=2, strand_sense=-1, start=136, end=137, mol_name='CaM C', current_atom='O', prev_atom='N') 121 122 # Create a PDB file. 123 file = DummyFileObject() 124 self.interpreter.structure.write_pdb(file=file, force=True) 125 126 # The HELIX and SHEET contents, as from the original 2BE6 PDB file. 127 # "HELIX 1 1 THR A 5 ASP A 20 1 16 " 128 # "HELIX 2 2 THR A 28 LEU A 39 1 12 " 129 # "HELIX 3 3 THR A 44 ASP A 56 1 13 " 130 # "HELIX 4 4 PHE A 65 MET A 76 1 12 " 131 # "HELIX 5 5 SER A 81 ASP A 93 1 13 " 132 # "HELIX 6 6 SER A 101 LEU A 112 1 12 " 133 # "HELIX 7 7 THR A 117 ASP A 129 1 13 " 134 # "HELIX 8 8 TYR A 138 THR A 146 1 9 " 135 # "HELIX 9 9 VAL D 1615 GLY D 1638 1 24 " 136 # "HELIX 10 10 THR B 5 ASP B 20 1 16 " 137 # "HELIX 11 11 THR B 28 LEU B 39 1 12 " 138 # "HELIX 12 12 THR B 44 ASP B 56 1 13 " 139 # "HELIX 13 13 PHE B 65 ASP B 78 1 14 " 140 # "HELIX 14 14 GLU B 82 ASP B 93 1 12 " 141 # "HELIX 15 15 SER B 101 GLY B 113 1 13 " 142 # "HELIX 16 16 THR B 117 ASP B 129 1 13 " 143 # "HELIX 17 17 TYR B 138 MET B 145 1 8 " 144 # "HELIX 18 18 GLU E 1612 GLN E 1625 1 14 " 145 # "HELIX 19 19 THR C 5 ASP C 20 1 16 " 146 # "HELIX 20 20 THR C 28 LEU C 39 1 12 " 147 # "HELIX 21 21 THR C 44 ASP C 56 1 13 " 148 # "HELIX 22 22 PHE C 65 LYS C 75 1 11 " 149 # "HELIX 23 23 GLU C 82 ASP C 93 1 12 " 150 # "HELIX 24 24 SER C 101 LEU C 112 1 12 " 151 # "HELIX 25 25 THR C 117 ASP C 129 1 13 " 152 # "HELIX 26 26 TYR C 138 MET C 145 1 8 " 153 # "HELIX 27 27 LYS F 1617 GLU F 1636 1 20 " 154 # "SHEET 1 A 2 THR A 26 ILE A 27 0 " 155 # "SHEET 2 A 2 ILE A 63 ASP A 64 -1 O ILE A 63 N ILE A 27 " 156 # "SHEET 1 B 2 TYR A 99 ILE A 100 0 " 157 # "SHEET 2 B 2 VAL A 136 ASN A 137 -1 O VAL A 136 N ILE A 100 " 158 # "SHEET 1 C 2 THR B 26 ILE B 27 0 " 159 # "SHEET 2 C 2 ILE B 63 ASP B 64 -1 O ILE B 63 N ILE B 27 " 160 # "SHEET 1 D 2 TYR B 99 ILE B 100 0 " 161 # "SHEET 2 D 2 VAL B 136 ASN B 137 -1 O VAL B 136 N ILE B 100 " 162 # "SHEET 1 E 2 THR C 26 ILE C 27 0 " 163 # "SHEET 2 E 2 ILE C 63 ASP C 64 -1 O ILE C 63 N ILE C 27 " 164 # "SHEET 1 F 2 TYR C 99 ILE C 100 0 " 165 # "SHEET 2 F 2 VAL C 136 ASN C 137 -1 O VAL C 136 N ILE C 100 " 166 167 # The HELIX and SHEET contents, as currently supported by relax. 168 contents = [ 169 "HELIX 1 1 THR A 5 ASP A 20 1 16 \n", 170 "HELIX 2 2 THR A 28 LEU A 39 1 12 \n", 171 "HELIX 3 3 THR A 44 ASP A 56 1 13 \n", 172 "HELIX 4 4 PHE A 65 MET A 76 1 12 \n", 173 "HELIX 5 5 SER A 81 ASP A 93 1 13 \n", 174 "HELIX 6 6 SER A 101 LEU A 112 1 12 \n", 175 "HELIX 7 7 THR A 117 ASP A 129 1 13 \n", 176 "HELIX 8 8 TYR A 138 THR A 146 1 9 \n", 177 "HELIX 9 9 VAL A 1615 GLY A 1638 1 24 \n", 178 "HELIX 10 10 THR B 5 ASP B 20 1 16 \n", 179 "HELIX 11 11 THR B 28 LEU B 39 1 12 \n", 180 "HELIX 12 12 THR B 44 ASP B 56 1 13 \n", 181 "HELIX 13 13 PHE B 65 ASP B 78 1 14 \n", 182 "HELIX 14 14 GLU B 82 ASP B 93 1 12 \n", 183 "HELIX 15 15 SER B 101 GLY B 113 1 13 \n", 184 "HELIX 16 16 THR B 117 ASP B 129 1 13 \n", 185 "HELIX 17 17 TYR B 138 MET B 145 1 8 \n", 186 "HELIX 18 18 GLU B 1612 GLN B 1625 1 14 \n", 187 "HELIX 19 19 THR C 5 ASP C 20 1 16 \n", 188 "HELIX 20 20 THR C 28 LEU C 39 1 12 \n", 189 "HELIX 21 21 THR C 44 ASP C 56 1 13 \n", 190 "HELIX 22 22 PHE C 65 LYS C 75 1 11 \n", 191 "HELIX 23 23 GLU C 82 ASP C 93 1 12 \n", 192 "HELIX 24 24 SER C 101 LEU C 112 1 12 \n", 193 "HELIX 25 25 THR C 117 ASP C 129 1 13 \n", 194 "HELIX 26 26 TYR C 138 MET C 145 1 8 \n", 195 "HELIX 27 27 LYS C 1617 GLU C 1636 1 20 \n", 196 "SHEET 1 A 2 THR A 26 ILE A 27 0 \n", 197 "SHEET 2 A 2 ILE A 63 ASP A 64 -1 O ILE A 63 N ILE A 27 \n", 198 "SHEET 1 B 2 TYR A 99 ILE A 100 0 \n", 199 "SHEET 2 B 2 VAL A 136 ASN A 137 -1 O VAL A 136 N ILE A 100 \n", 200 "SHEET 1 C 2 THR B 26 ILE B 27 0 \n", 201 "SHEET 2 C 2 ILE B 63 ASP B 64 -1 O ILE B 63 N ILE B 27 \n", 202 "SHEET 1 D 2 TYR B 99 ILE B 100 0 \n", 203 "SHEET 2 D 2 VAL B 136 ASN B 137 -1 O VAL B 136 N ILE B 100 \n", 204 "SHEET 1 E 2 THR C 26 ILE C 27 0 \n", 205 "SHEET 2 E 2 ILE C 63 ASP C 64 -1 O ILE C 63 N ILE C 27 \n", 206 "SHEET 1 F 2 TYR C 99 ILE C 100 0 \n", 207 "SHEET 2 F 2 VAL C 136 ASN C 137 -1 O VAL C 136 N ILE C 100 \n", 208 ] 209 210 # Check the created PDB file. 211 lines = file.readlines() 212 index = 0 213 for line in lines: 214 # Skip non-secondary structure records. 215 if not search('^HELIX', line) and not search('^SHEET', line): 216 continue 217 218 # Check the line. 219 print("\nOrig: %s" % repr(contents[index])) 220 print("New: %s" % repr(line)) 221 self.assertEqual(contents[index], line) 222 223 # Increment the secondary structure index. 224 index += 1 225 226 # Check the count to make sure that secondary structure records have at all been created. 227 self.assertEqual(len(contents), index)
228 229
230 - def test_align(self):
231 """Test the U{structure.superimpose user function<http://www.nmr-relax.com/manual/structure_superimpose.html>}.""" 232 233 # Reset relax. 234 self.interpreter.reset() 235 236 # Path of the PDB file. 237 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'diffusion_tensor'+sep+'sphere' 238 239 # Create a data pipe for the reference structure, then load it. 240 self.interpreter.pipe.create('ref', 'N-state') 241 self.interpreter.structure.read_pdb('uniform.pdb', dir=path) 242 243 # Delete a residue and atom. 244 self.interpreter.structure.delete(":8") 245 self.interpreter.structure.delete(":2@N") 246 247 # Output PDB to stdout to help in debugging. 248 self.interpreter.structure.write_pdb(file=sys.stdout) 249 250 # Create a second data pipe for the structures to align and superimpose. 251 self.interpreter.pipe.create('align', 'N-state') 252 253 # Load the PDB twice as different models. 254 self.interpreter.structure.read_pdb('uniform.pdb', dir=path, set_model_num=1) 255 self.interpreter.structure.read_pdb('uniform.pdb', dir=path, set_model_num=2) 256 257 # Delete a residue and atom. 258 self.interpreter.structure.delete(":12") 259 self.interpreter.structure.delete(":20@H") 260 261 # Translate and rotate the models. 262 R = zeros((3, 3), float64) 263 axis_angle_to_R(array([1, 0, 0], float64), 1.0, R) 264 self.interpreter.structure.rotate(R=R, model=1) 265 axis_angle_to_R(array([0, 0, 1], float64), 2.0, R) 266 self.interpreter.structure.rotate(R=R, model=2) 267 self.interpreter.structure.translate(T=[1., 1., 1.], model=1) 268 self.interpreter.structure.translate(T=[0., 0., 1.], model=2) 269 270 # Add some atoms that should not be aligned. 271 self.interpreter.structure.add_atom(mol_name='uniform_mol1', atom_name='Ti', res_name='TST', res_num=100, pos=[[1.0, 2.0, 3.0], [1.0, 2.0, 3.0]], element='Ti', pdb_record='HETATM') 272 273 # The alignment. 274 self.interpreter.structure.superimpose(pipes=['ref', 'align'], method='fit to first', atom_id='@N,H', displace_id='@N,H') 275 276 # Output PDB to stdout to help in debugging. 277 self.interpreter.structure.write_pdb(file=sys.stdout) 278 279 # The atomic data. 280 data = [ 281 ["N", "PRO", 1, 0.000, 0.000, -10.000], 282 ["H", "PRO", 1, 0.000, 0.000, -11.020], 283 ["N", "PRO", 2, 7.454, 0.000, -6.667], 284 ["H", "PRO", 2, 8.214, 0.000, -7.347], 285 ["N", "ILE", 3, 10.000, 0.000, 0.000], 286 ["H", "ILE", 3, 11.020, 0.000, 0.000], 287 ["N", "VAL", 4, 7.454, 0.000, 6.667], 288 ["H", "VAL", 4, 8.214, 0.000, 7.347], 289 ["N", "VAL", 5, 0.000, 0.000, 10.000], 290 ["H", "VAL", 5, 0.000, 0.000, 11.020], 291 ["N", "ASN", 6, 0.000, 0.000, -10.000], 292 ["H", "ASN", 6, 0.000, 0.000, -11.020], 293 ["N", "SER", 7, 3.727, 6.455, -6.667], 294 ["H", "SER", 7, 4.107, 7.113, -7.347], 295 ["N", "LEU", 8, 5.000, 8.660, 0.000], 296 ["H", "LEU", 8, 5.510, 9.544, 0.000], 297 ["N", "SER", 9, 3.727, 6.455, 6.667], 298 ["H", "SER", 9, 4.107, 7.113, 7.347], 299 ["N", "ASN", 10, 0.000, 0.000, 10.000], 300 ["H", "ASN", 10, 0.000, 0.000, 11.020], 301 ["N", "PHE", 11, -0.000, 0.000, -10.000], 302 ["H", "PHE", 11, -0.000, 0.000, -11.020], 303 #["N", "ALA", 12, -3.727, 6.455, -6.667], 304 #["H", "ALA", 12, -4.107, 7.113, -7.347], 305 ["N", "ILE", 13, -5.000, 8.660, 0.000], 306 ["H", "ILE", 13, -5.510, 9.544, 0.000], 307 ["N", "GLY", 14, -3.727, 6.455, 6.667], 308 ["H", "GLY", 14, -4.107, 7.113, 7.347], 309 ["N", "SER", 15, -0.000, 0.000, 10.000], 310 ["H", "SER", 15, -0.000, 0.000, 11.020], 311 ["N", "PHE", 16, -0.000, 0.000, -10.000], 312 ["H", "PHE", 16, -0.000, 0.000, -11.020], 313 ["N", "VAL", 17, -7.454, 0.000, -6.667], 314 ["H", "VAL", 17, -8.214, 0.000, -7.347], 315 ["N", "ILE", 18, -10.000, 0.000, 0.000], 316 ["H", "ILE", 18, -11.020, 0.000, 0.000], 317 ["N", "GLN", 19, -7.454, 0.000, 6.667], 318 ["H", "GLN", 19, -8.214, 0.000, 7.347], 319 ["N", "LEU", 20, -0.000, 0.000, 10.000], 320 #["H", "LEU", 20, -0.000, 0.000, 11.020], 321 ["N", "LEU", 21, -0.000, -0.000, -10.000], 322 ["H", "LEU", 21, -0.000, -0.000, -11.020], 323 ["N", "GLU", 22, -3.727, -6.455, -6.667], 324 ["H", "GLU", 22, -4.107, -7.113, -7.347], 325 ["N", "TRP", 23, -5.000, -8.660, 0.000], 326 ["H", "TRP", 23, -5.510, -9.544, 0.000], 327 ["N", "TYR", 24, -3.727, -6.455, 6.667], 328 ["H", "TYR", 24, -4.107, -7.113, 7.347], 329 ["N", "SER", 25, -0.000, -0.000, 10.000], 330 ["H", "SER", 25, -0.000, -0.000, 11.020], 331 ["N", "ARG", 26, 0.000, -0.000, -10.000], 332 ["H", "ARG", 26, 0.000, -0.000, -11.020], 333 ["N", "TYR", 27, 3.727, -6.455, -6.667], 334 ["H", "TYR", 27, 4.107, -7.113, -7.347], 335 ["N", "LEU", 28, 5.000, -8.660, 0.000], 336 ["H", "LEU", 28, 5.510, -9.544, 0.000], 337 ["N", "HIS", 29, 3.727, -6.455, 6.667], 338 ["H", "HIS", 29, 4.107, -7.113, 7.347], 339 ["N", "ALA", 30, 0.000, -0.000, 10.000], 340 ["H", "ALA", 30, 0.000, -0.000, 11.020], 341 ["Ti", "TST", 100, 1.000, 2.000, 3.000] 342 ] 343 344 # The selection object. 345 selection = cdp.structure.selection() 346 347 # Check the first model. 348 self.assertEqual(len(data), len(cdp.structure.structural_data[0].mol[0].atom_name)) 349 i = 0 350 for res_num, res_name, atom_name, pos in cdp.structure.atom_loop(selection=selection, model_num=1, res_num_flag=True, res_name_flag=True, atom_name_flag=True, pos_flag=True): 351 self.assertEqual(atom_name, data[i][0]) 352 self.assertEqual(res_name, data[i][1]) 353 self.assertEqual(res_num, data[i][2]) 354 self.assertAlmostEqual(pos[0][0], data[i][3]) 355 self.assertAlmostEqual(pos[0][1], data[i][4]) 356 self.assertAlmostEqual(pos[0][2], data[i][5]) 357 i += 1 358 359 # Check the second model. 360 self.assertEqual(len(data), len(cdp.structure.structural_data[1].mol[0].atom_name)) 361 i = 0 362 for res_num, res_name, atom_name, pos in cdp.structure.atom_loop(selection=selection, model_num=2, res_num_flag=True, res_name_flag=True, atom_name_flag=True, pos_flag=True): 363 self.assertEqual(atom_name, data[i][0]) 364 self.assertEqual(res_name, data[i][1]) 365 self.assertEqual(res_num, data[i][2]) 366 self.assertAlmostEqual(pos[0][0], data[i][3]) 367 self.assertAlmostEqual(pos[0][1], data[i][4]) 368 self.assertAlmostEqual(pos[0][2], data[i][5]) 369 i += 1
370 371
372 - def test_align_CaM_BLOSUM62(self):
373 """Test the alignment of CaM molecules from different species using the BLOSUM62 substitution matrix.""" 374 375 # Execute the script. 376 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'structure_align.py')
377 378
379 - def test_align_molecules(self):
380 """Test the U{structure.superimpose user function<http://www.nmr-relax.com/manual/structure_superimpose.html>} for aligning different molecules in one pipe.""" 381 382 # Reset relax. 383 self.interpreter.reset() 384 385 # Path of the PDB file. 386 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'diffusion_tensor'+sep+'sphere' 387 388 # Create a data pipe for the reference structure, then load it. 389 self.interpreter.pipe.create('ref', 'N-state') 390 self.interpreter.structure.read_pdb('uniform.pdb', dir=path, set_mol_name='ref') 391 392 # Delete a residue and atom. 393 self.interpreter.structure.delete("#ref:8") 394 self.interpreter.structure.delete("#ref:2@N") 395 396 # Output PDB to stdout to help in debugging. 397 self.interpreter.structure.write_pdb(file=sys.stdout) 398 399 # Create a second data pipe for the structures to align and superimpose. 400 self.interpreter.pipe.create('align', 'N-state') 401 402 # Load the PDB twice as different models. 403 self.interpreter.structure.read_pdb('uniform.pdb', dir=path, set_mol_name='1') 404 self.interpreter.structure.read_pdb('uniform.pdb', dir=path, set_mol_name='2') 405 406 # Delete a residue and atom from these two structures. 407 self.interpreter.structure.delete("#1,2:12") 408 self.interpreter.structure.delete("#1,2:20@H") 409 410 # Translate and rotate the models. 411 R = zeros((3, 3), float64) 412 axis_angle_to_R(array([1, 0, 0], float64), 1.0, R) 413 self.interpreter.structure.rotate(R=R, atom_id='#1') 414 axis_angle_to_R(array([0, 0, 1], float64), 2.0, R) 415 self.interpreter.structure.rotate(R=R, atom_id='#2') 416 self.interpreter.structure.translate(T=[1., 1., 1.], atom_id='#1') 417 self.interpreter.structure.translate(T=[0., 0., 1.], atom_id='#2') 418 419 # Add some atoms that should not be aligned. 420 self.interpreter.structure.add_atom(mol_name='1', atom_name='Ti', res_name='TST', res_num=100, pos=[1.0, 2.0, 3.0], element='Ti', pdb_record='HETATM') 421 self.interpreter.structure.add_atom(mol_name='2', atom_name='Ti', res_name='TST', res_num=100, pos=[1.0, 2.0, 3.0], element='Ti', pdb_record='HETATM') 422 423 # The alignment. 424 self.interpreter.structure.superimpose(pipes=['ref', 'align'], molecules=[['ref'], ['1', '2']], method='fit to first', atom_id='@N,H', displace_id='@N,H') 425 426 # Output PDB to stdout to help in debugging. 427 self.interpreter.structure.write_pdb(file=sys.stdout) 428 429 # The atomic data. 430 data = [ 431 ["N", "PRO", 1, 0.000, 0.000, -10.000], 432 ["H", "PRO", 1, 0.000, 0.000, -11.020], 433 ["N", "PRO", 2, 7.454, 0.000, -6.667], 434 ["H", "PRO", 2, 8.214, 0.000, -7.347], 435 ["N", "ILE", 3, 10.000, 0.000, 0.000], 436 ["H", "ILE", 3, 11.020, 0.000, 0.000], 437 ["N", "VAL", 4, 7.454, 0.000, 6.667], 438 ["H", "VAL", 4, 8.214, 0.000, 7.347], 439 ["N", "VAL", 5, 0.000, 0.000, 10.000], 440 ["H", "VAL", 5, 0.000, 0.000, 11.020], 441 ["N", "ASN", 6, 0.000, 0.000, -10.000], 442 ["H", "ASN", 6, 0.000, 0.000, -11.020], 443 ["N", "SER", 7, 3.727, 6.455, -6.667], 444 ["H", "SER", 7, 4.107, 7.113, -7.347], 445 ["N", "LEU", 8, 5.000, 8.660, 0.000], 446 ["H", "LEU", 8, 5.510, 9.544, 0.000], 447 ["N", "SER", 9, 3.727, 6.455, 6.667], 448 ["H", "SER", 9, 4.107, 7.113, 7.347], 449 ["N", "ASN", 10, 0.000, 0.000, 10.000], 450 ["H", "ASN", 10, 0.000, 0.000, 11.020], 451 ["N", "PHE", 11, -0.000, 0.000, -10.000], 452 ["H", "PHE", 11, -0.000, 0.000, -11.020], 453 #["N", "ALA", 12, -3.727, 6.455, -6.667], 454 #["H", "ALA", 12, -4.107, 7.113, -7.347], 455 ["N", "ILE", 13, -5.000, 8.660, 0.000], 456 ["H", "ILE", 13, -5.510, 9.544, 0.000], 457 ["N", "GLY", 14, -3.727, 6.455, 6.667], 458 ["H", "GLY", 14, -4.107, 7.113, 7.347], 459 ["N", "SER", 15, -0.000, 0.000, 10.000], 460 ["H", "SER", 15, -0.000, 0.000, 11.020], 461 ["N", "PHE", 16, -0.000, 0.000, -10.000], 462 ["H", "PHE", 16, -0.000, 0.000, -11.020], 463 ["N", "VAL", 17, -7.454, 0.000, -6.667], 464 ["H", "VAL", 17, -8.214, 0.000, -7.347], 465 ["N", "ILE", 18, -10.000, 0.000, 0.000], 466 ["H", "ILE", 18, -11.020, 0.000, 0.000], 467 ["N", "GLN", 19, -7.454, 0.000, 6.667], 468 ["H", "GLN", 19, -8.214, 0.000, 7.347], 469 ["N", "LEU", 20, -0.000, 0.000, 10.000], 470 #["H", "LEU", 20, -0.000, 0.000, 11.020], 471 ["N", "LEU", 21, -0.000, -0.000, -10.000], 472 ["H", "LEU", 21, -0.000, -0.000, -11.020], 473 ["N", "GLU", 22, -3.727, -6.455, -6.667], 474 ["H", "GLU", 22, -4.107, -7.113, -7.347], 475 ["N", "TRP", 23, -5.000, -8.660, 0.000], 476 ["H", "TRP", 23, -5.510, -9.544, 0.000], 477 ["N", "TYR", 24, -3.727, -6.455, 6.667], 478 ["H", "TYR", 24, -4.107, -7.113, 7.347], 479 ["N", "SER", 25, -0.000, -0.000, 10.000], 480 ["H", "SER", 25, -0.000, -0.000, 11.020], 481 ["N", "ARG", 26, 0.000, -0.000, -10.000], 482 ["H", "ARG", 26, 0.000, -0.000, -11.020], 483 ["N", "TYR", 27, 3.727, -6.455, -6.667], 484 ["H", "TYR", 27, 4.107, -7.113, -7.347], 485 ["N", "LEU", 28, 5.000, -8.660, 0.000], 486 ["H", "LEU", 28, 5.510, -9.544, 0.000], 487 ["N", "HIS", 29, 3.727, -6.455, 6.667], 488 ["H", "HIS", 29, 4.107, -7.113, 7.347], 489 ["N", "ALA", 30, 0.000, -0.000, 10.000], 490 ["H", "ALA", 30, 0.000, -0.000, 11.020], 491 ["Ti", "TST", 100, 1.000, 2.000, 3.000] 492 ] 493 494 # The selection object. 495 selection = cdp.structure.selection() 496 497 # Check the molecules. 498 self.assertEqual(len(data), len(cdp.structure.structural_data[0].mol[0].atom_name)) 499 self.assertEqual(len(data), len(cdp.structure.structural_data[0].mol[1].atom_name)) 500 current_mol = '' 501 for mol_name, res_num, res_name, atom_name, pos in cdp.structure.atom_loop(selection=selection, mol_name_flag=True, res_num_flag=True, res_name_flag=True, atom_name_flag=True, pos_flag=True): 502 print("Molecule '%s', residue '%s %s', atom '%s', position %s" % (mol_name, res_num, res_name, atom_name, pos)) 503 if mol_name != current_mol: 504 current_mol = mol_name 505 i = 0 506 self.assertEqual(atom_name, data[i][0]) 507 self.assertEqual(res_name, data[i][1]) 508 self.assertEqual(res_num, data[i][2]) 509 self.assertAlmostEqual(pos[0][0], data[i][3]) 510 self.assertAlmostEqual(pos[0][1], data[i][4]) 511 self.assertAlmostEqual(pos[0][2], data[i][5]) 512 i += 1
513 514
515 - def test_align_molecules2(self):
516 """Test of the structure.superimpose user function, fitting to the mean structure.""" 517 518 # Path of the structure file. 519 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'cam' 520 521 # Load the two rotated structures. 522 self.interpreter.structure.read_pdb('1J7P_1st_NH.pdb', dir=path, set_model_num=1, set_mol_name='CaM A') 523 self.interpreter.structure.read_pdb('1J7P_1st_NH_rot.pdb', dir=path, set_model_num=1, set_mol_name='CaM B') 524 525 # Add an atom that should not be superimposed. 526 self.interpreter.structure.add_atom(mol_name='CaM A', atom_name='Ti', res_name='TST', res_num=1, pos=[1.0, 2.0, 3.0], element='Ti', pdb_record='HETATM') 527 self.interpreter.structure.add_atom(mol_name='CaM B', atom_name='Ti', res_name='TST', res_num=1, pos=[2.0, 3.0, 4.0], element='Ti', pdb_record='HETATM') 528 529 # Superimpose the backbone heavy atoms. 530 self.interpreter.structure.superimpose(method='fit to mean', atom_id='@N,C,CA,O', displace_id=':82-5000') 531 532 # Check that the two structures now have the same atomic coordinates. 533 mol1 = cdp.structure.structural_data[0].mol[0] 534 mol2 = cdp.structure.structural_data[0].mol[1] 535 for i in range(len(mol1.atom_name)): 536 if mol1.res_num[i] == 1: 537 continue 538 self.assertAlmostEqual(mol1.x[i], mol2.x[i], 2) 539 self.assertAlmostEqual(mol1.y[i], mol2.y[i], 2) 540 self.assertAlmostEqual(mol1.z[i], mol2.z[i], 2) 541 542 # The first 'Ti' atom must be different - it is not displaced. 543 self.assertAlmostEqual(mol1.x[0] - mol2.x[0], -1.0, 2) 544 self.assertAlmostEqual(mol1.y[0] - mol2.y[0], -1.0, 2) 545 self.assertAlmostEqual(mol1.z[0] - mol2.z[0], -1.0, 2)
546 547
549 """Test of the structure.superimpose user function, fitting to the mean structure.""" 550 551 # Path of the structure file. 552 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 553 554 # Load the two rotated structures. 555 self.interpreter.structure.read_pdb('1J7O.pdb', dir=path, read_model=1, set_model_num=1, set_mol_name='CaM A') 556 self.interpreter.structure.read_pdb('1J7O.pdb', dir=path, read_model=1, set_model_num=1, set_mol_name='CaM B') 557 self.interpreter.structure.read_pdb('1J7O.pdb', dir=path, read_model=1, set_model_num=1, set_mol_name='CaM C') 558 559 # Delete some end residues. 560 self.interpreter.structure.delete(atom_id="#CaM A:1-4") 561 self.interpreter.structure.delete(atom_id="#CaM A:60-100") 562 self.interpreter.structure.delete(atom_id="#CaM C:1-3") 563 self.interpreter.structure.delete(atom_id="#CaM C:75-100") 564 self.interpreter.structure.delete(atom_id=":1000-1001") 565 566 # Copy the data pipe for late comparison. 567 self.interpreter.pipe.copy('mf', 'comp') 568 569 # Superimpose the backbone heavy atoms. 570 self.interpreter.structure.superimpose(method='fit to mean', atom_id='@N,C,CA,O') 571 572 # Check that nothing has moved. 573 for mol_index in range(3): 574 mol1 = ds['mf'].structure.structural_data[0].mol[mol_index] 575 mol2 = ds['comp'].structure.structural_data[0].mol[mol_index] 576 for i in range(len(mol1.atom_name)): 577 self.assertAlmostEqual(mol1.x[i], mol2.x[i]) 578 self.assertAlmostEqual(mol1.y[i], mol2.y[i]) 579 self.assertAlmostEqual(mol1.z[i], mol2.z[i])
580 581
582 - def test_alt_loc_missing(self):
583 """Test that a RelaxError occurs when the alternate location indicator is present but not specified.""" 584 585 # Path of the structure file. 586 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 587 588 # Load the file, load the spins, and attach the protons. 589 self.assertRaises(RelaxError, self.interpreter.structure.read_pdb, '1OGT_trunc.pdb', dir=path)
590 591
592 - def test_atomic_fluctuations(self):
593 """Check the operation of the structure.atomic_fluctuations user function. 594 595 This checks the interatomic distance fluctuations calculated by the U{structure.atomic_fluctuations user function<http://www.nmr-relax.com/manual/structure_atomic_fluctuations.html>}. 596 """ 597 598 # Load the file. 599 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 600 self.interpreter.structure.read_pdb('web_of_motion.pdb', dir=path) 601 602 # Run the structure.atomic_fluctuations user function and collect the results in a dummy file object. 603 file = DummyFileObject() 604 self.interpreter.structure.atomic_fluctuations(atom_id='@N,CA', file=file, format='text') 605 606 # The fluctuations. 607 n = array([[ 9.464, -9.232, 27.573], [ 9.211, -9.425, 26.970], [ 7.761, -6.392, 27.161]], float64) 608 ca = array([[10.302, -8.195, 26.930], [10.077, -8.221, 26.720], [ 9.256, -6.332, 27.183]], float64) 609 sd = std(array([norm(n[0] - ca[0]), norm(n[1] - ca[1]), norm(n[2] - ca[2])], float64), ddof=1) 610 expected = [] 611 expected.append("# %18s %20s\n" % (":4@N", ":4@CA")) 612 expected.append("%20.15f %20.15f\n" % (0.0, sd)) 613 expected.append("%20.15f %20.15f\n" % (sd, 0.0)) 614 615 # Check the file. 616 lines = file.readlines() 617 self.assertEqual(len(expected), len(lines)) 618 for i in range(len(lines)): 619 self.assertEqual(expected[i], lines[i])
620 621
623 """Check the angular fluctuations calculated by the structure.atomic_fluctuations user function. 624 625 This checks the text file (with the format argument set to text) of interatomic angle fluctuations calculated by the U{structure.atomic_fluctuations user function<http://www.nmr-relax.com/manual/structure_atomic_fluctuations.html>}. 626 """ 627 628 # Load the file. 629 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 630 self.interpreter.structure.read_pdb('web_of_motion.pdb', dir=path) 631 632 # Run the structure.atomic_fluctuations user function and collect the results in a dummy file object. 633 file = DummyFileObject() 634 self.interpreter.structure.atomic_fluctuations(measure='angle', atom_id='@N,CA', file=file, format='text') 635 636 # The atom positions. 637 n = array([[ 9.464, -9.232, 27.573], [ 9.211, -9.425, 26.970], [ 7.761, -6.392, 27.161]], float64) 638 ca = array([[10.302, -8.195, 26.930], [10.077, -8.221, 26.720], [ 9.256, -6.332, 27.183]], float64) 639 640 # The interatom vectors. 641 vectors = ca - n 642 643 # The inter-vector angles to the average. 644 vect_ave = average(vectors, axis=0) 645 angles = [ 646 vector_angle_acos(vect_ave, vectors[0]), 647 vector_angle_acos(vect_ave, vectors[1]), 648 vector_angle_acos(vect_ave, vectors[2]) 649 ] 650 651 # The fluctuations. 652 sd = std(array(angles, float64), ddof=1) 653 expected = [] 654 expected.append("# %18s %20s\n" % (":4@N", ":4@CA")) 655 expected.append("%20.15f %20.15f\n" % (0.0, sd)) 656 expected.append("%20.15f %20.15f\n" % (sd, 0.0)) 657 658 # Check the file. 659 lines = file.readlines() 660 self.assertEqual(len(expected), len(lines)) 661 for i in range(len(lines)): 662 self.assertEqual(expected[i], lines[i])
663 664
666 """Check the operation of the structure.atomic_fluctuations user function for creating a gnuplot script. 667 668 This checks the format argument of the U{structure.atomic_fluctuations user function<http://www.nmr-relax.com/manual/structure_atomic_fluctuations.html>} when set to 'gnuplot'. 669 """ 670 671 # Load the file. 672 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 673 self.interpreter.structure.read_pdb('web_of_motion.pdb', dir=path) 674 675 # Run the structure.atomic_fluctuations user function. 676 self.interpreter.structure.atomic_fluctuations(atom_id='@N,CA', file='matrix', dir=ds.tmpdir, format='gnuplot') 677 678 # The fluctuations. 679 n = array([[ 9.464, -9.232, 27.573], [ 9.211, -9.425, 26.970], [ 7.761, -6.392, 27.161]], float64) 680 ca = array([[10.302, -8.195, 26.930], [10.077, -8.221, 26.720], [ 9.256, -6.332, 27.183]], float64) 681 sd = std(array([norm(n[0] - ca[0]), norm(n[1] - ca[1]), norm(n[2] - ca[2])], float64), ddof=1) 682 expected = [] 683 expected.append("# %18s %20s\n" % (":4@N", ":4@CA")) 684 expected.append("%20.15f %20.15f\n" % (0.0, sd)) 685 expected.append("%20.15f %20.15f\n" % (sd, 0.0)) 686 687 # Check the text file. 688 file = open("%s%s%s" % (ds.tmpdir, sep, 'matrix')) 689 lines = file.readlines() 690 self.assertEqual(len(expected), len(lines)) 691 for i in range(len(lines)): 692 self.assertEqual(expected[i], lines[i]) 693 694 # Check the gnuplot file. 695 script = [ 696 "#!/usr/bin/env gnuplot\n", 697 "\n", 698 "# Set up the terminal type and make the plot square.\n", 699 "set terminal postscript eps size 10,10 enhanced color font 'Helvetica,20' linewidth 0.1\n", 700 "set size square\n", 701 "\n", 702 "# Blue-red colour map.\n", 703 "set palette model RGB\n", 704 "set palette defined\n", 705 "\n", 706 "# Labels.\n", 707 "set xtics out rotate font \",8\" (\":4\\\\@N\" 0, \":4\\\\@CA\" 1)\n", 708 "set ytics out font \",8\" (\":4\\\\@N\" 0, \":4\\\\@CA\" 1)\n", 709 "\n", 710 "# Output to EPS.\n", 711 "set output \"matrix.eps\"\n", 712 "\n", 713 "# Load and show the text data\n", 714 "plot \"matrix\" matrix with image\n" 715 ] 716 file = open("%s%s%s" % (ds.tmpdir, sep, 'matrix.gnu')) 717 lines = file.readlines() 718 print("Script:") 719 print("\"\"\"") 720 for line in lines: 721 print(line[:-1]) 722 print("\"\"\"") 723 self.assertEqual(len(script), len(lines)) 724 for i in range(len(lines)): 725 self.assertEqual(script[i], lines[i])
726 727
729 """Check the operation of the structure.atomic_fluctuations user function when no data matches the atom ID. 730 731 This checks the interatomic distance fluctuations calculated by the U{structure.atomic_fluctuations user function<http://www.nmr-relax.com/manual/structure_atomic_fluctuations.html>}. 732 """ 733 734 # Load the file. 735 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 736 self.interpreter.structure.read_pdb('web_of_motion.pdb', dir=path) 737 738 # Run the structure.atomic_fluctuations user function and collect the results in a dummy file object. 739 file = DummyFileObject() 740 self.assertRaises(RelaxError, self.interpreter.structure.atomic_fluctuations, atom_id='@X', file=file, format='text')
741 742
744 """Check the parallax shift fluctuations calculated by the structure.atomic_fluctuations user function. 745 746 This checks the text file (with the format argument set to text) of interatomic parallax shift fluctuations calculated by the U{structure.atomic_fluctuations user function<http://www.nmr-relax.com/manual/structure_atomic_fluctuations.html>}. 747 """ 748 749 # Load the file. 750 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 751 self.interpreter.structure.read_pdb('web_of_motion.pdb', dir=path) 752 753 # Run the structure.atomic_fluctuations user function and collect the results in a dummy file object. 754 file = DummyFileObject() 755 self.interpreter.structure.atomic_fluctuations(measure='parallax shift', atom_id='@N,CA', file=file, format='text') 756 757 # The atom positions. 758 n = array([[ 9.464, -9.232, 27.573], [ 9.211, -9.425, 26.970], [ 7.761, -6.392, 27.161]], float64) 759 ca = array([[10.302, -8.195, 26.930], [10.077, -8.221, 26.720], [ 9.256, -6.332, 27.183]], float64) 760 761 # The interatom vectors. 762 vectors = ca - n 763 764 # The inter-vector projections to the average. 765 vect_ave = average(vectors, axis=0) 766 unit = vect_ave / norm(vect_ave) 767 proj = [ 768 dot(vectors[0], unit) * unit, 769 dot(vectors[1], unit) * unit, 770 dot(vectors[2], unit) * unit 771 ] 772 shift = [ 773 norm(vectors[0] - proj[0]), 774 norm(vectors[1] - proj[1]), 775 norm(vectors[2] - proj[2]) 776 ] 777 778 # The fluctuations. 779 sd = std(array(shift, float64), ddof=1) 780 expected = [] 781 expected.append("# %18s %20s\n" % (":4@N", ":4@CA")) 782 expected.append("%20.15f %20.15f\n" % (0.0, sd)) 783 expected.append("%20.15f %20.15f\n" % (sd, 0.0)) 784 785 # Check the file. 786 lines = file.readlines() 787 self.assertEqual(len(expected), len(lines)) 788 for i in range(len(lines)): 789 self.assertEqual(expected[i], lines[i])
790 791
793 """Catch U{bug #12<https://sourceforge.net/p/nmr-relax/tickets/12/>}, the failure to detect '#' in the molecule name. 794 795 This is for the case where set_mol_name argument value contains the '#' character. The test checks both the structure.read_pdb and structure.read_xyz user functions. 796 """ 797 798 # These should fail. 799 self.assertRaises(RelaxError, self.interpreter.structure.read_pdb, 'bug_12_hash_in_mol_name.pdb', dir=path.join(status.install_path, 'test_suite', 'shared_data', 'structures'), set_mol_name='bug_12_#_in_mol_name') 800 self.assertRaises(RelaxError, self.interpreter.structure.read_xyz, 'bug_12_hash_in_mol_name.xyz', dir=path.join(status.install_path, 'test_suite', 'shared_data', 'structures'), set_mol_name='bug_12_#_in_mol_name')
801 802
804 """Catch U{bug #12<https://sourceforge.net/p/nmr-relax/tickets/12/>}, the failure to detect '#' in the molecule name. 805 806 This is for the case where the PDB file itself contains the '#' character. The test checks both the structure.read_pdb and structure.read_xyz user functions. 807 """ 808 809 # These should fail. 810 self.assertRaises(RelaxError, self.interpreter.structure.read_pdb, 'bug_12_#_in_mol_name.pdb', dir=path.join(status.install_path, 'test_suite', 'shared_data', 'structures')) 811 self.assertRaises(RelaxError, self.interpreter.structure.read_xyz, 'bug_12_#_in_mol_name.xyz', dir=path.join(status.install_path, 'test_suite', 'shared_data', 'structures'))
812 813
815 """Catch U{bug #20470<https://web.archive.org/web/https://gna.org/bugs/?20470>}, the alternate location indicator problem.""" 816 817 # Path of the structure file. 818 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 819 820 # Load the file, load the spins, and attach the protons. 821 self.interpreter.structure.read_pdb('1OGT_trunc.pdb', dir=path, alt_loc='A') 822 self.interpreter.structure.load_spins(spin_id='@N', ave_pos=True) 823 self.interpreter.sequence.attach_protons()
824 825
827 """Catch U{bug #21187<https://web.archive.org/web/https://gna.org/bugs/?21187>}, the corrupted PDB with all proton atoms numbers set to zero.""" 828 829 # Path of the structure file. 830 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 831 832 # Load the file. 833 self.interpreter.structure.read_pdb('bug_21187_molecule.pdb', dir=path) 834 835 # Load the @N, @H, and @NE1 spins (needed to create the :60@0 spin to trigger the bug later). 836 self.interpreter.structure.load_spins(spin_id='@N', ave_pos=True) 837 self.interpreter.structure.load_spins(spin_id='@NE1', ave_pos=True) 838 self.interpreter.structure.load_spins(spin_id='@H', ave_pos=True) 839 840 # Load the :60@HE1 spin - this clashes with the :60@H spin as both have the spin ID of ':60@0'. 841 self.interpreter.structure.load_spins(spin_id='@HE1', ave_pos=True)
842 843
845 """Catch U{bug #21522<https://web.archive.org/web/https://gna.org/bugs/?21522>}, the structure.write_pdb user function creating an incorrect MASTER record. 846 847 This also triggers U{bug #21520<https://web.archive.org/web/https://gna.org/bugs/?21520>}, the failure of the structure.write_pdb user function when creating the MASTER record due to too many ATOM and HETATM records being present. 848 """ 849 850 # Create 2 models. 851 self.interpreter.structure.add_model(model_num=1) 852 self.interpreter.structure.add_model(model_num=2) 853 854 # Add a single atom. 855 self.interpreter.structure.add_atom(atom_name='N', res_name='Pro', res_num=2, pos=[1., 2., 3.], element='N') 856 857 # Create a PDB file. 858 file = DummyFileObject() 859 self.interpreter.structure.write_pdb(file=file, force=True) 860 861 # The file contents, without remarks, as they should be. 862 contents = [ 863 "MODEL 1 \n", 864 "ATOM 1 N Pro A 2 1.000 2.000 3.000 1.00 0.00 N \n", 865 "TER 2 Pro A 2 \n", 866 "ENDMDL \n", 867 "MODEL 2 \n", 868 "ATOM 1 N Pro A 2 1.000 2.000 3.000 1.00 0.00 N \n", 869 "TER 2 Pro A 2 \n", 870 "ENDMDL \n", 871 "MASTER 0 0 0 0 0 0 0 0 1 1 0 0 \n", 872 "END \n" 873 ] 874 875 # Check the created PDB file. 876 lines = file.readlines() 877 self.strip_remarks(lines) 878 self.assertEqual(len(contents), len(lines)) 879 for i in range(len(lines)): 880 self.assertEqual(contents[i], lines[i])
881 882
884 """Catch U{bug #21814<https://web.archive.org/web/https://gna.org/bugs/?21814>}, the PDB reading failure when not padded to 80 spaces.""" 885 886 # Path of the structure file. 887 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 888 889 # Load the file. 890 self.interpreter.structure.read_pdb('SpUreE_dimer_H_new', dir=path)
891 892
894 """Catch U{bug #22041<https://web.archive.org/web/https://gna.org/bugs/?22041>}, the atom serial number not being sequential from 1 onwards.""" 895 896 # Path of the structure file. 897 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 898 899 # Read a PDB file twice as two different molecules. 900 self.interpreter.structure.read_pdb('1RTE_trunc.pdb', dir=path, set_mol_name='N-dom') 901 self.interpreter.structure.read_pdb('1RTE_trunc.pdb', dir=path, set_mol_name='C-dom') 902 903 # Create a PDB file. 904 file = DummyFileObject() 905 self.interpreter.structure.write_pdb(file=file, force=True) 906 907 # The file contents, without remarks, as they should be. 908 contents = [ 909 "HET CYN A 445 1 \n", 910 "HET CYN B 445 1 \n", 911 "HETNAM CYN UNKNOWN \n", 912 "FORMUL 1 CYN C1 \n", 913 "ATOM 1 N LEU A 3 49.617 4.693 46.426 1.00 0.00 N \n", 914 "ATOM 2 CA LEU A 3 49.432 5.476 45.190 1.00 0.00 C \n", 915 "ATOM 3 C LEU A 3 50.346 4.980 44.055 1.00 0.00 C \n", 916 "ATOM 4 O LEU A 3 49.924 4.868 42.889 1.00 0.00 O \n", 917 "ATOM 5 CB LEU A 3 49.673 6.968 45.457 1.00 0.00 C \n", 918 "ATOM 6 CG LEU A 3 49.804 7.863 44.222 1.00 0.00 C \n", 919 "ATOM 7 CD1 LEU A 3 48.564 7.837 43.327 1.00 0.00 C \n", 920 "ATOM 8 CD2 LEU A 3 50.075 9.282 44.625 1.00 0.00 C \n", 921 "TER 9 LEU A 3 \n", 922 "HETATM 10 C CYN A 445 29.160 13.127 62.533 1.00 0.00 C \n", 923 "ATOM 11 N LEU B 3 49.617 4.693 46.426 1.00 0.00 N \n", 924 "ATOM 12 CA LEU B 3 49.432 5.476 45.190 1.00 0.00 C \n", 925 "ATOM 13 C LEU B 3 50.346 4.980 44.055 1.00 0.00 C \n", 926 "ATOM 14 O LEU B 3 49.924 4.868 42.889 1.00 0.00 O \n", 927 "ATOM 15 CB LEU B 3 49.673 6.968 45.457 1.00 0.00 C \n", 928 "ATOM 16 CG LEU B 3 49.804 7.863 44.222 1.00 0.00 C \n", 929 "ATOM 17 CD1 LEU B 3 48.564 7.837 43.327 1.00 0.00 C \n", 930 "ATOM 18 CD2 LEU B 3 50.075 9.282 44.625 1.00 0.00 C \n", 931 "TER 19 LEU B 3 \n", 932 "HETATM 20 C CYN B 445 29.160 13.127 62.533 1.00 0.00 C \n", 933 "MASTER 0 0 2 0 0 0 0 0 18 2 0 0 \n", 934 "END \n" 935 ] 936 937 # Check the created PDB file. 938 lines = file.readlines() 939 self.strip_remarks(lines) 940 self.assertEqual(len(contents), len(lines)) 941 for i in range(len(lines)): 942 self.assertEqual(contents[i], lines[i])
943 944
946 """Catch U{bug #22069<https://web.archive.org/web/https://gna.org/bugs/?22069>}, the failure of the structure.delete user function with helix attribute errors.""" 947 948 # Path of the structure file. 949 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'cam' 950 951 # Load the structure. 952 self.interpreter.structure.read_pdb('1J7P_1st_NH_rot.pdb', dir=path) 953 954 # Delete the calciums. 955 self.interpreter.structure.delete(atom_id='@CA')
956 957
959 """Catch U{bug #22070<https://web.archive.org/web/https://gna.org/bugs/?22070>}, the failure of the structure.superimpose user function after deleting atoms with structure.delete.""" 960 961 # Path of the structure file. 962 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'cam' 963 964 # Load the structures to superimpose. 965 self.interpreter.structure.read_pdb('1J7P_1st_NH.pdb', dir=path, set_mol_name='C-dom', set_model_num=1) 966 self.interpreter.structure.read_pdb('1J7P_1st_NH_rot.pdb', dir=path, set_mol_name='C-dom', set_model_num=2) 967 968 # Delete the calciums. 969 self.interpreter.structure.delete(atom_id='@CA') 970 971 # Check the deleted atoms of both models (the last atoms should now be the last ATOM record proton and not the HETATOM CA). 972 for i in range(2): 973 print("Checking the last atom of model %s." % i) 974 self.assertEqual(cdp.structure.structural_data[i].mol[0].atom_name[-1], 'H') 975 976 # Superimpose. 977 self.interpreter.structure.superimpose(method='fit to first', centre_type='CoM') 978 979 # Align. 980 self.interpreter.structure.superimpose(method='fit to first', centre_type='CoM')
981 982
984 """Catch U{bug #22860<https://web.archive.org/web/https://gna.org/bugs/?22860>}, the failure of the structure.com user function after calling structure.delete.""" 985 986 # Path of the structure file. 987 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'cam' 988 989 # Load a random structure, then delete it. 990 self.interpreter.structure.read_pdb('1J7P_1st_NH.pdb', dir=path, set_mol_name='C-dom', set_model_num=1) 991 self.interpreter.structure.delete() 992 993 # CoM. 994 self.assertRaises(RelaxError, self.interpreter.structure.com)
995 996
998 """Catch U{bug #22861<https://web.archive.org/web/https://gna.org/bugs/?22861>}, the chain IDs in the structure.write_pdb user function PDB files are incorrect after calling structure.delete.""" 999 1000 # Add one atom to two different molecules. 1001 self.interpreter.structure.add_atom(mol_name='A', atom_name='N', res_name='Phe', res_num=1, pos=[1.0, 1.0, 1.0], element='N') 1002 self.interpreter.structure.add_atom(mol_name='B', atom_name='N', res_name='Phe', res_num=1, pos=[1.0, 1.0, 1.0], element='N') 1003 1004 # Add some metadata to demonstrate a problem with the structure.delete user function. 1005 cdp.structure.structural_data[0].mol[0].file_name = 'test.pdb' 1006 cdp.structure.structural_data[0].mol[1].file_name = 'test2.pdb' 1007 1008 # Delete the first molecule. 1009 self.interpreter.structure.delete('#A') 1010 1011 # Create a PDB file. 1012 file = DummyFileObject() 1013 self.interpreter.structure.write_pdb(file=file, force=True) 1014 1015 # The file contents, without remarks, as they should be. 1016 contents = [ 1017 "ATOM 1 N Phe A 1 1.000 1.000 1.000 1.00 0.00 N \n", 1018 "TER 2 Phe A 1 \n", 1019 "MASTER 0 0 0 0 0 0 0 0 1 1 0 0 \n", 1020 "END \n" 1021 ] 1022 1023 # Check the created PDB file. 1024 lines = file.readlines() 1025 self.strip_remarks(lines) 1026 self.assertEqual(len(contents), len(lines)) 1027 for i in range(len(lines)): 1028 self.assertEqual(contents[i], lines[i])
1029 1030
1032 """Catch U{bug #23293<https://web.archive.org/web/https://gna.org/bugs/?23293>}, the PDB HETATM loading error whereby the last HETATM record is sometimes not read from the PDB file.""" 1033 1034 # Path of the structure file. 1035 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 1036 1037 # Load the file. 1038 self.interpreter.structure.read_pdb('bug_23293_missing_hetatm.pdb', dir=path) 1039 1040 # Create a PDB file. 1041 file = DummyFileObject() 1042 self.interpreter.structure.write_pdb(file=file, force=True) 1043 1044 # The file contents, without remarks, as they should be. 1045 contents = [ 1046 "HET CA A 501 1 \n", 1047 "HET CA A 502 1 \n", 1048 "HET CA B 503 1 \n", 1049 "HET CA B 504 1 \n", 1050 "HET CA C 505 1 \n", 1051 "HET CA C 506 1 \n", 1052 "HETNAM CA UNKNOWN \n", 1053 "FORMUL 1 CA CA1 \n", 1054 "MODEL 1 \n", 1055 "ATOM 1 N LEU A 1 1.000 -2.000 20.000 1.00 0.00 N \n", 1056 "ATOM 2 H LEU A 1 2.000 -2.000 20.000 1.00 0.00 H \n", 1057 "TER 3 LEU A 1 \n", 1058 "HETATM 4 CA CA A 501 17.000 12.000 14.000 1.00 0.00 CA \n", 1059 "HETATM 5 CA CA A 502 6.000 9.000 14.000 1.00 0.00 CA \n", 1060 "ATOM 6 N LEU B 1 9.000 -9.000 27.000 1.00 0.00 N \n", 1061 "ATOM 7 H LEU B 1 8.000 -8.000 27.000 1.00 0.00 H \n", 1062 "TER 8 LEU B 1 \n", 1063 "HETATM 9 CA CA B 503 17.000 12.000 14.000 1.00 0.00 CA \n", 1064 "HETATM 10 CA CA B 504 6.000 9.000 14.000 1.00 0.00 CA \n", 1065 "ATOM 11 N LEU C 1 12.000 -12.000 7.000 1.00 0.00 N \n", 1066 "ATOM 12 H LEU C 1 11.000 -12.000 7.000 1.00 0.00 H \n", 1067 "TER 13 LEU C 1 \n", 1068 "HETATM 14 CA CA C 505 31.000 -10.000 -0.000 1.00 0.00 CA \n", 1069 "HETATM 15 CA CA C 506 31.000 -19.000 6.000 1.00 0.00 CA \n", 1070 "ENDMDL \n", 1071 "MASTER 0 0 6 0 0 0 0 0 12 3 0 0 \n", 1072 "END \n" 1073 ] 1074 1075 # Check the created PDB file. 1076 lines = file.readlines() 1077 self.strip_remarks(lines) 1078 self.assertEqual(len(contents), len(lines)) 1079 for i in range(len(lines)): 1080 self.assertEqual(contents[i], lines[i])
1081 1082
1084 """Catch U{bug #23294<https://web.archive.org/web/https://gna.org/bugs/?23294>}, the automatic merging of PDB molecules results in an IndexError.""" 1085 1086 # Path of the structure file. 1087 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 1088 1089 # Load the file. 1090 self.interpreter.structure.read_pdb('bug_23294_multi_mol_automerge.pdb', dir=path, read_model=1, set_mol_name='merged mol') 1091 1092 # Create a PDB file. 1093 file = DummyFileObject() 1094 self.interpreter.structure.write_pdb(file=file, force=True) 1095 1096 # The file contents, without remarks, as they should be. 1097 contents = [ 1098 "MODEL 1 \n", 1099 "ATOM 1 N LEU A 1 1.000 0.000 0.000 1.00 0.00 N \n", 1100 "ATOM 2 H LEU A 1 2.000 0.000 0.000 1.00 0.00 H \n", 1101 "ATOM 3 N GLU A 2 3.000 0.000 0.000 1.00 0.00 N \n", 1102 "ATOM 4 H GLU A 2 4.000 0.000 0.000 1.00 0.00 H \n", 1103 "TER 5 GLU A 2 \n", 1104 "ENDMDL \n", 1105 "MASTER 0 0 0 0 0 0 0 0 4 1 0 0 \n", 1106 "END \n" 1107 ] 1108 1109 # Check the created PDB file. 1110 lines = file.readlines() 1111 self.strip_remarks(lines) 1112 self.assertEqual(len(contents), len(lines)) 1113 for i in range(len(lines)): 1114 self.assertEqual(contents[i], lines[i])
1115 1116
1118 """Catch U{bug #23295<https://web.archive.org/web/https://gna.org/bugs/?23295>}, the PDB secondary structure HELIX and SHEET records not updated when merging molecules.""" 1119 1120 # Path of the structure file. 1121 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 1122 1123 # Load the file. 1124 self.interpreter.structure.read_pdb('2BE6_secondary_structure.pdb', dir=path, read_mol=[1, 4], set_mol_name='CaM A') 1125 self.interpreter.structure.read_pdb('2BE6_secondary_structure.pdb', dir=path, read_mol=[2, 5], set_mol_name='CaM B') 1126 self.interpreter.structure.read_pdb('2BE6_secondary_structure.pdb', dir=path, read_mol=[3, 6], set_mol_name='CaM C') 1127 1128 # Create a PDB file. 1129 file = DummyFileObject() 1130 self.interpreter.structure.write_pdb(file=file, force=True) 1131 1132 # The HELIX and SHEET contents, as they should be. 1133 # First, the original contents: 1134 # "HELIX 1 1 THR A 5 ASP A 20 1 16 " 1135 # "HELIX 2 2 THR A 28 LEU A 39 1 12 " 1136 # "HELIX 3 3 THR A 44 ASP A 56 1 13 " 1137 # "HELIX 4 4 PHE A 65 MET A 76 1 12 " 1138 # "HELIX 5 5 SER A 81 ASP A 93 1 13 " 1139 # "HELIX 6 6 SER A 101 LEU A 112 1 12 " 1140 # "HELIX 7 7 THR A 117 ASP A 129 1 13 " 1141 # "HELIX 8 8 TYR A 138 THR A 146 1 9 " 1142 # "HELIX 9 9 VAL D 1615 GLY D 1638 1 24 " 1143 # "HELIX 10 10 THR B 5 ASP B 20 1 16 " 1144 # "HELIX 11 11 THR B 28 LEU B 39 1 12 " 1145 # "HELIX 12 12 THR B 44 ASP B 56 1 13 " 1146 # "HELIX 13 13 PHE B 65 ASP B 78 1 14 " 1147 # "HELIX 14 14 GLU B 82 ASP B 93 1 12 " 1148 # "HELIX 15 15 SER B 101 GLY B 113 1 13 " 1149 # "HELIX 16 16 THR B 117 ASP B 129 1 13 " 1150 # "HELIX 17 17 TYR B 138 MET B 145 1 8 " 1151 # "HELIX 18 18 GLU E 1612 GLN E 1625 1 14 " 1152 # "HELIX 19 19 THR C 5 ASP C 20 1 16 " 1153 # "HELIX 20 20 THR C 28 LEU C 39 1 12 " 1154 # "HELIX 21 21 THR C 44 ASP C 56 1 13 " 1155 # "HELIX 22 22 PHE C 65 LYS C 75 1 11 " 1156 # "HELIX 23 23 GLU C 82 ASP C 93 1 12 " 1157 # "HELIX 24 24 SER C 101 LEU C 112 1 12 " 1158 # "HELIX 25 25 THR C 117 ASP C 129 1 13 " 1159 # "HELIX 26 26 TYR C 138 MET C 145 1 8 " 1160 # "HELIX 27 27 LYS F 1617 GLU F 1636 1 20 " 1161 # "SHEET 1 A 2 THR A 26 ILE A 27 0 " 1162 # "SHEET 2 A 2 ILE A 63 ASP A 64 -1 O ILE A 63 N ILE A 27 " 1163 # "SHEET 1 B 2 TYR A 99 ILE A 100 0 " 1164 # "SHEET 2 B 2 VAL A 136 ASN A 137 -1 O VAL A 136 N ILE A 100 " 1165 # "SHEET 1 C 2 THR B 26 ILE B 27 0 " 1166 # "SHEET 2 C 2 ILE B 63 ASP B 64 -1 O ILE B 63 N ILE B 27 " 1167 # "SHEET 1 D 2 TYR B 99 ILE B 100 0 " 1168 # "SHEET 2 D 2 VAL B 136 ASN B 137 -1 O VAL B 136 N ILE B 100 " 1169 # "SHEET 1 E 2 THR C 26 ILE C 27 0 " 1170 # "SHEET 2 E 2 ILE C 63 ASP C 64 -1 O ILE C 63 N ILE C 27 " 1171 # "SHEET 1 F 2 TYR C 99 ILE C 100 0 " 1172 # "SHEET 2 F 2 VAL C 136 ASN C 137 -1 O VAL C 136 N ILE C 100 " 1173 # Then the modified contents: 1174 contents = [ 1175 "HELIX 1 1 THR A 5 ASP A 20 1 16 \n", 1176 "HELIX 2 2 THR A 28 LEU A 39 1 12 \n", 1177 "HELIX 3 3 THR A 44 ASP A 56 1 13 \n", 1178 "HELIX 4 4 PHE A 65 MET A 76 1 12 \n", 1179 "HELIX 5 5 SER A 81 ASP A 93 1 13 \n", 1180 "HELIX 6 6 SER A 101 LEU A 112 1 12 \n", 1181 "HELIX 7 7 THR A 117 ASP A 129 1 13 \n", 1182 "HELIX 8 8 TYR A 138 THR A 146 1 9 \n", 1183 "HELIX 9 9 VAL A 1615 GLY A 1638 1 24 \n", 1184 "HELIX 10 10 THR B 5 ASP B 20 1 16 \n", 1185 "HELIX 11 11 THR B 28 LEU B 39 1 12 \n", 1186 "HELIX 12 12 THR B 44 ASP B 56 1 13 \n", 1187 "HELIX 13 13 PHE B 65 ASP B 78 1 14 \n", 1188 "HELIX 14 14 GLU B 82 ASP B 93 1 12 \n", 1189 "HELIX 15 15 SER B 101 GLY B 113 1 13 \n", 1190 "HELIX 16 16 THR B 117 ASP B 129 1 13 \n", 1191 "HELIX 17 17 TYR B 138 MET B 145 1 8 \n", 1192 "HELIX 18 18 GLU B 1612 GLN B 1625 1 14 \n", 1193 "HELIX 19 19 THR C 5 ASP C 20 1 16 \n", 1194 "HELIX 20 20 THR C 28 LEU C 39 1 12 \n", 1195 "HELIX 21 21 THR C 44 ASP C 56 1 13 \n", 1196 "HELIX 22 22 PHE C 65 LYS C 75 1 11 \n", 1197 "HELIX 23 23 GLU C 82 ASP C 93 1 12 \n", 1198 "HELIX 24 24 SER C 101 LEU C 112 1 12 \n", 1199 "HELIX 25 25 THR C 117 ASP C 129 1 13 \n", 1200 "HELIX 26 26 TYR C 138 MET C 145 1 8 \n", 1201 "HELIX 27 27 LYS C 1617 GLU C 1636 1 20 \n", 1202 "SHEET 1 A 2 THR A 26 ILE A 27 0 \n", 1203 "SHEET 2 A 2 ILE A 63 ASP A 64 -1 O ILE A 63 N ILE A 27 \n", 1204 "SHEET 1 B 2 TYR A 99 ILE A 100 0 \n", 1205 "SHEET 2 B 2 VAL A 136 ASN A 137 -1 O VAL A 136 N ILE A 100 \n", 1206 "SHEET 1 C 2 THR B 26 ILE B 27 0 \n", 1207 "SHEET 2 C 2 ILE B 63 ASP B 64 -1 O ILE B 63 N ILE B 27 \n", 1208 "SHEET 1 D 2 TYR B 99 ILE B 100 0 \n", 1209 "SHEET 2 D 2 VAL B 136 ASN B 137 -1 O VAL B 136 N ILE B 100 \n", 1210 "SHEET 1 E 2 THR C 26 ILE C 27 0 \n", 1211 "SHEET 2 E 2 ILE C 63 ASP C 64 -1 O ILE C 63 N ILE C 27 \n", 1212 "SHEET 1 F 2 TYR C 99 ILE C 100 0 \n", 1213 "SHEET 2 F 2 VAL C 136 ASN C 137 -1 O VAL C 136 N ILE C 100 \n", 1214 ] 1215 1216 # Check the created PDB file. 1217 lines = file.readlines() 1218 index = 0 1219 for line in lines: 1220 # Skip non-secondary structure records. 1221 if not search('^HELIX', line) and not search('^SHEET', line): 1222 continue 1223 1224 # Check the line. 1225 print("\nOrig: %s" % repr(contents[index])) 1226 print("New: %s" % repr(line)) 1227 self.assertEqual(contents[index], line) 1228 1229 # Increment the secondary structure index. 1230 index += 1 1231 1232 # Check the count to make sure that secondary structure records have at all been created. 1233 self.assertEqual(len(contents), index)
1234 1235
1237 """Test the bug reported as the U{support request #2998<https://web.archive.org/web/https://gna.org/support/?2998>}, the broken CONECT records.""" 1238 1239 # Path of the structure file. 1240 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' 1241 1242 # Load the file. 1243 self.interpreter.structure.read_pdb('1RTE_trunc.pdb', dir=path)
1244 1245
1246 - def test_collapse_ensemble(self):
1247 """Test the collapse_ensemble() method of the internal structural object.""" 1248 1249 # Create 2 models. 1250 self.interpreter.structure.add_model(model_num=1) 1251 self.interpreter.structure.add_model(model_num=2) 1252 1253 # Add an atom. 1254 self.interpreter.structure.add_atom(atom_name='H', res_name='Gly', res_num=1, pos=[[0.0, 1.0, 2.0], [1.0, 2.0, 3.0]], element='H') 1255 1256 # Check the atomic data. 1257 for i in range(2): 1258 mol = cdp.structure.structural_data[i].mol[0] 1259 self.assertEqual(len(mol.atom_name), 1) 1260 self.assertEqual(mol.x[0], 0.0+i) 1261 self.assertEqual(mol.y[0], 1.0+i) 1262 self.assertEqual(mol.z[0], 2.0+i) 1263 1264 # Collapse the ensemble to the 2nd model. 1265 cdp.structure.collapse_ensemble(model_num=2, model_to=1) 1266 1267 # Check the collapsed ensemble. 1268 self.assert_(hasattr(cdp, 'structure')) 1269 self.assertEqual(len(cdp.structure.structural_data), 1) 1270 self.assertEqual(cdp.structure.structural_data[0].num, 1) 1271 self.assertEqual(len(cdp.structure.structural_data[0].mol), 1) 1272 1273 # Check the atomic data. 1274 mol = cdp.structure.structural_data[0].mol[0] 1275 self.assertEqual(len(mol.atom_name), 1) 1276 self.assertEqual(mol.x[0], 1.0) 1277 self.assertEqual(mol.y[0], 2.0) 1278 self.assertEqual(mol.z[0], 3.0)
1279 1280
1282 """Test the deletion of non-existent structural data.""" 1283 1284 # Delete all structural data. 1285 self.interpreter.structure.delete() 1286 1287 # Set up a diffusion tensor. 1288 self.interpreter.diffusion_tensor.init((8.5e-9, 1.1, 20.0, 20.0), param_types=2) 1289 1290 # Create the PDB representation. 1291 self.interpreter.structure.create_diff_tensor_pdb(scale=1.8e-06, file='prolate.pdb', dir=ds.tmpdir, force=True)
1292 1293
1295 """Test the creation of the diffusion tensor PDB representation, after deleting structural data.""" 1296 1297 # Path of the files. 1298 path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures'+sep+'lactose' 1299 1300 # Read the PDBs. 1301 self.interpreter.structure.read_pdb(file='lactose_MCMM4_S1_1.pdb', dir=path, set_mol_name='L1') 1302 self.interpreter.structure.read_pdb(file='lactose_MCMM4_S1_2.pdb', dir=path, set_mol_name='L2') 1303 1304 # Delete all structural data. 1305 self.interpreter.structure.delete() 1306 1307 # Set up a diffusion tensor. 1308 self.interpreter.diffusion_tensor.init((8.5e-9, 1.1, 20.0, 20.0), param_types=2) 1309 1310 # Create the PDB representation. 1311 self.interpreter.structure.create_diff_tensor_pdb(scale=1.8e-06, file='prolate.pdb', dir=ds.tmpdir, force=True)
1312 1313
1315 """Check that the ellipsoid diffusion tensor optimisation functions correctly.""" 1316 1317 # Reset relax. 1318 self.interpreter.reset() 1319 1320 # Create a temporary file. 1321 ds.tmpfile_handle, ds.tmpfile = mkstemp(suffix='.pdb') 1322 1323 # The diffusion type (used by the script). 1324 ds.diff_dir = 'ellipsoid' 1325 ds.diff_type = 'ellipsoid' 1326 1327 # Execute the script. 1328 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'diff_tensor'+sep+'tensor_opt.py') 1329 1330 # Create the PDB representation. 1331 self.interpreter.structure.create_diff_tensor_pdb(scale=1.8e-06, file=ds.tmpfile, force=True) 1332 1333 # Read the contents of the file. 1334 file = open(ds.tmpfile) 1335 lines = file.readlines() 1336 file.close() 1337 1338 # What the contents should be, without remarks. 1339 real_data = [ 1340 "HET COM A 1 1 \n", 1341 "HET TNS A 2 240 \n", 1342 "HET AXS A 3 15 \n", 1343 "HETNAM COM CENTRE OF MASS \n", 1344 "HETNAM TNS TENSOR \n", 1345 "HETNAM AXS TENSOR AXES \n", 1346 "FORMUL 1 COM C1 \n", 1347 "FORMUL 2 TNS H240 \n", 1348 "FORMUL 3 AXS C9N6 \n", 1349 "HETATM 1 R COM A 1 -0.000 0.000 0.000 1.00 0.00 C \n", 1350 "HETATM 2 H2 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1351 "HETATM 3 H3 TNS A 2 34.069 -26.135 24.079 1.00 0.00 H \n", 1352 "HETATM 4 H4 TNS A 2 22.441 -24.585 22.046 1.00 0.00 H \n", 1353 "HETATM 5 H5 TNS A 2 12.181 -21.601 18.895 1.00 0.00 H \n", 1354 "HETATM 6 H6 TNS A 2 2.612 -17.891 15.178 1.00 0.00 H \n", 1355 "HETATM 7 H7 TNS A 2 -6.450 -13.649 11.046 1.00 0.00 H \n", 1356 "HETATM 8 H8 TNS A 2 -15.068 -8.941 6.552 1.00 0.00 H \n", 1357 "HETATM 9 H9 TNS A 2 -23.243 -3.767 1.694 1.00 0.00 H \n", 1358 "HETATM 10 H10 TNS A 2 -30.910 1.939 -3.577 1.00 0.00 H \n", 1359 "HETATM 11 H11 TNS A 2 -37.886 8.372 -9.415 1.00 0.00 H \n", 1360 "HETATM 12 H12 TNS A 2 -43.495 16.239 -16.370 1.00 0.00 H \n", 1361 "HETATM 13 H13 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1362 "HETATM 14 H14 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1363 "HETATM 15 H15 TNS A 2 34.065 -22.779 27.601 1.00 0.00 H \n", 1364 "HETATM 16 H16 TNS A 2 22.436 -19.088 27.815 1.00 0.00 H \n", 1365 "HETATM 17 H17 TNS A 2 12.174 -14.935 25.891 1.00 0.00 H \n", 1366 "HETATM 18 H18 TNS A 2 2.605 -10.548 22.885 1.00 0.00 H \n", 1367 "HETATM 19 H19 TNS A 2 -6.458 -5.990 19.085 1.00 0.00 H \n", 1368 "HETATM 20 H20 TNS A 2 -15.076 -1.281 14.590 1.00 0.00 H \n", 1369 "HETATM 21 H21 TNS A 2 -23.250 3.577 9.401 1.00 0.00 H \n", 1370 "HETATM 22 H22 TNS A 2 -30.917 8.606 3.419 1.00 0.00 H \n", 1371 "HETATM 23 H23 TNS A 2 -37.892 13.869 -3.645 1.00 0.00 H \n", 1372 "HETATM 24 H24 TNS A 2 -43.499 19.594 -12.848 1.00 0.00 H \n", 1373 "HETATM 25 H25 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1374 "HETATM 26 H26 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1375 "HETATM 27 H27 TNS A 2 34.523 -19.268 30.401 1.00 0.00 H \n", 1376 "HETATM 28 H28 TNS A 2 23.187 -13.335 32.402 1.00 0.00 H \n", 1377 "HETATM 29 H29 TNS A 2 13.085 -7.958 31.453 1.00 0.00 H \n", 1378 "HETATM 30 H30 TNS A 2 3.608 -2.863 29.011 1.00 0.00 H \n", 1379 "HETATM 31 H31 TNS A 2 -5.412 2.026 25.475 1.00 0.00 H \n", 1380 "HETATM 32 H32 TNS A 2 -14.030 6.734 20.981 1.00 0.00 H \n", 1381 "HETATM 33 H33 TNS A 2 -22.247 11.261 15.528 1.00 0.00 H \n", 1382 "HETATM 34 H34 TNS A 2 -30.006 15.583 8.982 1.00 0.00 H \n", 1383 "HETATM 35 H35 TNS A 2 -37.141 19.622 0.941 1.00 0.00 H \n", 1384 "HETATM 36 H36 TNS A 2 -43.041 23.105 -10.049 1.00 0.00 H \n", 1385 "HETATM 37 H37 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1386 "HETATM 38 H38 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1387 "HETATM 39 H39 TNS A 2 35.399 -15.944 32.204 1.00 0.00 H \n", 1388 "HETATM 40 H40 TNS A 2 24.621 -7.890 35.357 1.00 0.00 H \n", 1389 "HETATM 41 H41 TNS A 2 14.824 -1.355 35.037 1.00 0.00 H \n", 1390 "HETATM 42 H42 TNS A 2 5.523 4.411 32.958 1.00 0.00 H \n", 1391 "HETATM 43 H43 TNS A 2 -3.414 9.612 29.592 1.00 0.00 H \n", 1392 "HETATM 44 H44 TNS A 2 -12.032 14.321 25.098 1.00 0.00 H \n", 1393 "HETATM 45 H45 TNS A 2 -20.332 18.535 19.475 1.00 0.00 H \n", 1394 "HETATM 46 H46 TNS A 2 -28.268 22.186 12.565 1.00 0.00 H \n", 1395 "HETATM 47 H47 TNS A 2 -35.707 25.067 3.896 1.00 0.00 H \n", 1396 "HETATM 48 H48 TNS A 2 -42.165 26.429 -8.245 1.00 0.00 H \n", 1397 "HETATM 49 H49 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1398 "HETATM 50 H50 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1399 "HETATM 51 H51 TNS A 2 36.605 -13.134 32.835 1.00 0.00 H \n", 1400 "HETATM 52 H52 TNS A 2 26.597 -3.285 36.390 1.00 0.00 H \n", 1401 "HETATM 53 H53 TNS A 2 17.220 4.229 36.290 1.00 0.00 H \n", 1402 "HETATM 54 H54 TNS A 2 8.163 10.561 34.339 1.00 0.00 H \n", 1403 "HETATM 55 H55 TNS A 2 -0.660 16.028 31.032 1.00 0.00 H \n", 1404 "HETATM 56 H56 TNS A 2 -9.278 20.736 26.538 1.00 0.00 H \n", 1405 "HETATM 57 H57 TNS A 2 -17.692 24.686 20.856 1.00 0.00 H \n", 1406 "HETATM 58 H58 TNS A 2 -25.871 27.770 13.818 1.00 0.00 H \n", 1407 "HETATM 59 H59 TNS A 2 -33.730 29.672 4.930 1.00 0.00 H \n", 1408 "HETATM 60 H60 TNS A 2 -40.959 29.239 -7.614 1.00 0.00 H \n", 1409 "HETATM 61 H61 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1410 "HETATM 62 H62 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1411 "HETATM 63 H63 TNS A 2 38.024 -11.112 32.231 1.00 0.00 H \n", 1412 "HETATM 64 H64 TNS A 2 28.923 0.028 35.402 1.00 0.00 H \n", 1413 "HETATM 65 H65 TNS A 2 20.041 8.247 35.091 1.00 0.00 H \n", 1414 "HETATM 66 H66 TNS A 2 11.270 14.987 33.018 1.00 0.00 H \n", 1415 "HETATM 67 H67 TNS A 2 2.580 20.644 29.654 1.00 0.00 H \n", 1416 "HETATM 68 H68 TNS A 2 -6.038 25.352 25.160 1.00 0.00 H \n", 1417 "HETATM 69 H69 TNS A 2 -14.585 29.111 19.535 1.00 0.00 H \n", 1418 "HETATM 70 H70 TNS A 2 -23.051 31.787 12.619 1.00 0.00 H \n", 1419 "HETATM 71 H71 TNS A 2 -31.405 32.985 3.941 1.00 0.00 H \n", 1420 "HETATM 72 H72 TNS A 2 -39.540 31.262 -8.218 1.00 0.00 H \n", 1421 "HETATM 73 H73 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1422 "HETATM 74 H74 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1423 "HETATM 75 H75 TNS A 2 39.518 -10.076 30.453 1.00 0.00 H \n", 1424 "HETATM 76 H76 TNS A 2 31.370 1.725 32.487 1.00 0.00 H \n", 1425 "HETATM 77 H77 TNS A 2 23.008 10.305 31.557 1.00 0.00 H \n", 1426 "HETATM 78 H78 TNS A 2 14.538 17.254 29.125 1.00 0.00 H \n", 1427 "HETATM 79 H79 TNS A 2 5.989 23.008 25.594 1.00 0.00 H \n", 1428 "HETATM 80 H80 TNS A 2 -2.629 27.717 21.100 1.00 0.00 H \n", 1429 "HETATM 81 H81 TNS A 2 -11.316 31.378 15.642 1.00 0.00 H \n", 1430 "HETATM 82 H82 TNS A 2 -20.083 33.846 9.085 1.00 0.00 H \n", 1431 "HETATM 83 H83 TNS A 2 -28.958 34.682 1.027 1.00 0.00 H \n", 1432 "HETATM 84 H84 TNS A 2 -38.046 32.298 -9.997 1.00 0.00 H \n", 1433 "HETATM 85 H85 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1434 "HETATM 86 H86 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1435 "HETATM 87 H87 TNS A 2 40.940 -10.127 27.673 1.00 0.00 H \n", 1436 "HETATM 88 H88 TNS A 2 33.699 1.641 27.933 1.00 0.00 H \n", 1437 "HETATM 89 H89 TNS A 2 25.832 10.202 26.033 1.00 0.00 H \n", 1438 "HETATM 90 H90 TNS A 2 17.649 17.141 23.041 1.00 0.00 H \n", 1439 "HETATM 91 H91 TNS A 2 9.234 22.891 19.248 1.00 0.00 H \n", 1440 "HETATM 92 H92 TNS A 2 0.616 27.599 14.754 1.00 0.00 H \n", 1441 "HETATM 93 H93 TNS A 2 -8.205 31.265 9.558 1.00 0.00 H \n", 1442 "HETATM 94 H94 TNS A 2 -17.259 33.743 3.562 1.00 0.00 H \n", 1443 "HETATM 95 H95 TNS A 2 -26.629 34.598 -3.528 1.00 0.00 H \n", 1444 "HETATM 96 H96 TNS A 2 -36.624 32.246 -12.777 1.00 0.00 H \n", 1445 "HETATM 97 H97 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1446 "HETATM 98 H98 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1447 "HETATM 99 H99 TNS A 2 42.150 -11.262 24.164 1.00 0.00 H \n", 1448 "HETATM 100 H100 TNS A 2 35.682 -0.218 22.184 1.00 0.00 H \n", 1449 "HETATM 101 H101 TNS A 2 28.237 7.949 19.062 1.00 0.00 H \n", 1450 "HETATM 102 H102 TNS A 2 20.298 14.659 15.362 1.00 0.00 H \n", 1451 "HETATM 103 H103 TNS A 2 11.997 20.302 11.238 1.00 0.00 H \n", 1452 "HETATM 104 H104 TNS A 2 3.379 25.010 6.744 1.00 0.00 H \n", 1453 "HETATM 105 H105 TNS A 2 -5.557 28.783 1.879 1.00 0.00 H \n", 1454 "HETATM 106 H106 TNS A 2 -14.854 31.490 -3.410 1.00 0.00 H \n", 1455 "HETATM 107 H107 TNS A 2 -24.646 32.739 -9.277 1.00 0.00 H \n", 1456 "HETATM 108 H108 TNS A 2 -35.414 31.112 -16.286 1.00 0.00 H \n", 1457 "HETATM 109 H109 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1458 "HETATM 110 H110 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1459 "HETATM 111 H111 TNS A 2 43.031 -13.367 20.269 1.00 0.00 H \n", 1460 "HETATM 112 H112 TNS A 2 37.125 -3.668 15.803 1.00 0.00 H \n", 1461 "HETATM 113 H113 TNS A 2 29.987 3.765 11.324 1.00 0.00 H \n", 1462 "HETATM 114 H114 TNS A 2 22.225 10.050 6.838 1.00 0.00 H \n", 1463 "HETATM 115 H115 TNS A 2 14.007 15.495 2.348 1.00 0.00 H \n", 1464 "HETATM 116 H116 TNS A 2 5.389 20.203 -2.146 1.00 0.00 H \n", 1465 "HETATM 117 H117 TNS A 2 -3.629 24.175 -6.645 1.00 0.00 H \n", 1466 "HETATM 118 H118 TNS A 2 -13.104 27.306 -11.148 1.00 0.00 H \n", 1467 "HETATM 119 H119 TNS A 2 -23.203 29.289 -15.658 1.00 0.00 H \n", 1468 "HETATM 120 H120 TNS A 2 -34.533 29.006 -20.181 1.00 0.00 H \n", 1469 "HETATM 121 H121 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1470 "HETATM 122 H122 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1471 "HETATM 123 H123 TNS A 2 43.495 -16.239 16.370 1.00 0.00 H \n", 1472 "HETATM 124 H124 TNS A 2 37.886 -8.372 9.415 1.00 0.00 H \n", 1473 "HETATM 125 H125 TNS A 2 30.910 -1.939 3.577 1.00 0.00 H \n", 1474 "HETATM 126 H126 TNS A 2 23.243 3.767 -1.694 1.00 0.00 H \n", 1475 "HETATM 127 H127 TNS A 2 15.068 8.941 -6.552 1.00 0.00 H \n", 1476 "HETATM 128 H128 TNS A 2 6.450 13.649 -11.046 1.00 0.00 H \n", 1477 "HETATM 129 H129 TNS A 2 -2.612 17.891 -15.178 1.00 0.00 H \n", 1478 "HETATM 130 H130 TNS A 2 -12.181 21.601 -18.895 1.00 0.00 H \n", 1479 "HETATM 131 H131 TNS A 2 -22.441 24.585 -22.046 1.00 0.00 H \n", 1480 "HETATM 132 H132 TNS A 2 -34.069 26.135 -24.079 1.00 0.00 H \n", 1481 "HETATM 133 H133 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1482 "HETATM 134 H134 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1483 "HETATM 135 H135 TNS A 2 43.499 -19.594 12.848 1.00 0.00 H \n", 1484 "HETATM 136 H136 TNS A 2 37.892 -13.869 3.645 1.00 0.00 H \n", 1485 "HETATM 137 H137 TNS A 2 30.917 -8.606 -3.419 1.00 0.00 H \n", 1486 "HETATM 138 H138 TNS A 2 23.250 -3.577 -9.401 1.00 0.00 H \n", 1487 "HETATM 139 H139 TNS A 2 15.076 1.281 -14.590 1.00 0.00 H \n", 1488 "HETATM 140 H140 TNS A 2 6.458 5.990 -19.085 1.00 0.00 H \n", 1489 "HETATM 141 H141 TNS A 2 -2.605 10.548 -22.885 1.00 0.00 H \n", 1490 "HETATM 142 H142 TNS A 2 -12.174 14.935 -25.891 1.00 0.00 H \n", 1491 "HETATM 143 H143 TNS A 2 -22.436 19.088 -27.815 1.00 0.00 H \n", 1492 "HETATM 144 H144 TNS A 2 -34.065 22.779 -27.601 1.00 0.00 H \n", 1493 "HETATM 145 H145 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1494 "HETATM 146 H146 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1495 "HETATM 147 H147 TNS A 2 43.041 -23.105 10.049 1.00 0.00 H \n", 1496 "HETATM 148 H148 TNS A 2 37.141 -19.622 -0.941 1.00 0.00 H \n", 1497 "HETATM 149 H149 TNS A 2 30.006 -15.583 -8.982 1.00 0.00 H \n", 1498 "HETATM 150 H150 TNS A 2 22.247 -11.261 -15.528 1.00 0.00 H \n", 1499 "HETATM 151 H151 TNS A 2 14.030 -6.734 -20.981 1.00 0.00 H \n", 1500 "HETATM 152 H152 TNS A 2 5.412 -2.026 -25.475 1.00 0.00 H \n", 1501 "HETATM 153 H153 TNS A 2 -3.608 2.863 -29.011 1.00 0.00 H \n", 1502 "HETATM 154 H154 TNS A 2 -13.085 7.958 -31.453 1.00 0.00 H \n", 1503 "HETATM 155 H155 TNS A 2 -23.187 13.335 -32.402 1.00 0.00 H \n", 1504 "HETATM 156 H156 TNS A 2 -34.523 19.268 -30.401 1.00 0.00 H \n", 1505 "HETATM 157 H157 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1506 "HETATM 158 H158 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1507 "HETATM 159 H159 TNS A 2 42.165 -26.429 8.245 1.00 0.00 H \n", 1508 "HETATM 160 H160 TNS A 2 35.707 -25.067 -3.896 1.00 0.00 H \n", 1509 "HETATM 161 H161 TNS A 2 28.268 -22.186 -12.565 1.00 0.00 H \n", 1510 "HETATM 162 H162 TNS A 2 20.332 -18.535 -19.475 1.00 0.00 H \n", 1511 "HETATM 163 H163 TNS A 2 12.032 -14.321 -25.098 1.00 0.00 H \n", 1512 "HETATM 164 H164 TNS A 2 3.414 -9.612 -29.592 1.00 0.00 H \n", 1513 "HETATM 165 H165 TNS A 2 -5.523 -4.411 -32.958 1.00 0.00 H \n", 1514 "HETATM 166 H166 TNS A 2 -14.824 1.355 -35.037 1.00 0.00 H \n", 1515 "HETATM 167 H167 TNS A 2 -24.621 7.890 -35.357 1.00 0.00 H \n", 1516 "HETATM 168 H168 TNS A 2 -35.399 15.944 -32.204 1.00 0.00 H \n", 1517 "HETATM 169 H169 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1518 "HETATM 170 H170 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1519 "HETATM 171 H171 TNS A 2 40.959 -29.239 7.614 1.00 0.00 H \n", 1520 "HETATM 172 H172 TNS A 2 33.730 -29.672 -4.930 1.00 0.00 H \n", 1521 "HETATM 173 H173 TNS A 2 25.871 -27.770 -13.818 1.00 0.00 H \n", 1522 "HETATM 174 H174 TNS A 2 17.692 -24.686 -20.856 1.00 0.00 H \n", 1523 "HETATM 175 H175 TNS A 2 9.278 -20.736 -26.538 1.00 0.00 H \n", 1524 "HETATM 176 H176 TNS A 2 0.660 -16.028 -31.032 1.00 0.00 H \n", 1525 "HETATM 177 H177 TNS A 2 -8.163 -10.561 -34.339 1.00 0.00 H \n", 1526 "HETATM 178 H178 TNS A 2 -17.220 -4.229 -36.290 1.00 0.00 H \n", 1527 "HETATM 179 H179 TNS A 2 -26.597 3.285 -36.390 1.00 0.00 H \n", 1528 "HETATM 180 H180 TNS A 2 -36.605 13.134 -32.835 1.00 0.00 H \n", 1529 "HETATM 181 H181 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1530 "HETATM 182 H182 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1531 "HETATM 183 H183 TNS A 2 39.540 -31.262 8.218 1.00 0.00 H \n", 1532 "HETATM 184 H184 TNS A 2 31.405 -32.985 -3.941 1.00 0.00 H \n", 1533 "HETATM 185 H185 TNS A 2 23.051 -31.787 -12.619 1.00 0.00 H \n", 1534 "HETATM 186 H186 TNS A 2 14.585 -29.111 -19.535 1.00 0.00 H \n", 1535 "HETATM 187 H187 TNS A 2 6.038 -25.352 -25.160 1.00 0.00 H \n", 1536 "HETATM 188 H188 TNS A 2 -2.580 -20.644 -29.654 1.00 0.00 H \n", 1537 "HETATM 189 H189 TNS A 2 -11.270 -14.987 -33.018 1.00 0.00 H \n", 1538 "HETATM 190 H190 TNS A 2 -20.041 -8.247 -35.091 1.00 0.00 H \n", 1539 "HETATM 191 H191 TNS A 2 -28.923 -0.028 -35.402 1.00 0.00 H \n", 1540 "HETATM 192 H192 TNS A 2 -38.024 11.112 -32.231 1.00 0.00 H \n", 1541 "HETATM 193 H193 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1542 "HETATM 194 H194 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1543 "HETATM 195 H195 TNS A 2 38.046 -32.298 9.997 1.00 0.00 H \n", 1544 "HETATM 196 H196 TNS A 2 28.958 -34.682 -1.027 1.00 0.00 H \n", 1545 "HETATM 197 H197 TNS A 2 20.083 -33.846 -9.085 1.00 0.00 H \n", 1546 "HETATM 198 H198 TNS A 2 11.316 -31.378 -15.642 1.00 0.00 H \n", 1547 "HETATM 199 H199 TNS A 2 2.629 -27.717 -21.100 1.00 0.00 H \n", 1548 "HETATM 200 H200 TNS A 2 -5.989 -23.008 -25.594 1.00 0.00 H \n", 1549 "HETATM 201 H201 TNS A 2 -14.538 -17.254 -29.125 1.00 0.00 H \n", 1550 "HETATM 202 H202 TNS A 2 -23.008 -10.305 -31.557 1.00 0.00 H \n", 1551 "HETATM 203 H203 TNS A 2 -31.370 -1.725 -32.487 1.00 0.00 H \n", 1552 "HETATM 204 H204 TNS A 2 -39.518 10.076 -30.453 1.00 0.00 H \n", 1553 "HETATM 205 H205 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1554 "HETATM 206 H206 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1555 "HETATM 207 H207 TNS A 2 36.624 -32.246 12.777 1.00 0.00 H \n", 1556 "HETATM 208 H208 TNS A 2 26.629 -34.598 3.528 1.00 0.00 H \n", 1557 "HETATM 209 H209 TNS A 2 17.259 -33.743 -3.562 1.00 0.00 H \n", 1558 "HETATM 210 H210 TNS A 2 8.205 -31.265 -9.558 1.00 0.00 H \n", 1559 "HETATM 211 H211 TNS A 2 -0.616 -27.599 -14.754 1.00 0.00 H \n", 1560 "HETATM 212 H212 TNS A 2 -9.234 -22.891 -19.248 1.00 0.00 H \n", 1561 "HETATM 213 H213 TNS A 2 -17.649 -17.141 -23.041 1.00 0.00 H \n", 1562 "HETATM 214 H214 TNS A 2 -25.832 -10.202 -26.033 1.00 0.00 H \n", 1563 "HETATM 215 H215 TNS A 2 -33.699 -1.641 -27.933 1.00 0.00 H \n", 1564 "HETATM 216 H216 TNS A 2 -40.940 10.127 -27.673 1.00 0.00 H \n", 1565 "HETATM 217 H217 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1566 "HETATM 218 H218 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1567 "HETATM 219 H219 TNS A 2 35.414 -31.112 16.286 1.00 0.00 H \n", 1568 "HETATM 220 H220 TNS A 2 24.646 -32.739 9.277 1.00 0.00 H \n", 1569 "HETATM 221 H221 TNS A 2 14.854 -31.490 3.410 1.00 0.00 H \n", 1570 "HETATM 222 H222 TNS A 2 5.557 -28.783 -1.879 1.00 0.00 H \n", 1571 "HETATM 223 H223 TNS A 2 -3.379 -25.010 -6.744 1.00 0.00 H \n", 1572 "HETATM 224 H224 TNS A 2 -11.997 -20.302 -11.238 1.00 0.00 H \n", 1573 "HETATM 225 H225 TNS A 2 -20.298 -14.659 -15.362 1.00 0.00 H \n", 1574 "HETATM 226 H226 TNS A 2 -28.237 -7.949 -19.062 1.00 0.00 H \n", 1575 "HETATM 227 H227 TNS A 2 -35.682 0.218 -22.184 1.00 0.00 H \n", 1576 "HETATM 228 H228 TNS A 2 -42.150 11.262 -24.164 1.00 0.00 H \n", 1577 "HETATM 229 H229 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1578 "HETATM 230 H230 TNS A 2 43.091 -23.541 22.472 1.00 0.00 H \n", 1579 "HETATM 231 H231 TNS A 2 34.533 -29.006 20.181 1.00 0.00 H \n", 1580 "HETATM 232 H232 TNS A 2 23.203 -29.289 15.658 1.00 0.00 H \n", 1581 "HETATM 233 H233 TNS A 2 13.104 -27.306 11.148 1.00 0.00 H \n", 1582 "HETATM 234 H234 TNS A 2 3.629 -24.175 6.645 1.00 0.00 H \n", 1583 "HETATM 235 H235 TNS A 2 -5.389 -20.203 2.146 1.00 0.00 H \n", 1584 "HETATM 236 H236 TNS A 2 -14.007 -15.495 -2.348 1.00 0.00 H \n", 1585 "HETATM 237 H237 TNS A 2 -22.225 -10.050 -6.838 1.00 0.00 H \n", 1586 "HETATM 238 H238 TNS A 2 -29.987 -3.765 -11.324 1.00 0.00 H \n", 1587 "HETATM 239 H239 TNS A 2 -37.125 3.668 -15.803 1.00 0.00 H \n", 1588 "HETATM 240 H240 TNS A 2 -43.031 13.367 -20.269 1.00 0.00 H \n", 1589 "HETATM 241 H241 TNS A 2 -43.091 23.541 -22.472 1.00 0.00 H \n", 1590 "HETATM 242 R AXS A 3 -0.000 0.000 0.000 1.00 0.00 C \n", 1591 "HETATM 243 Dx AXS A 3 -10.813 -11.352 8.843 1.00 0.00 C \n", 1592 "HETATM 244 Dx AXS A 3 10.813 11.352 -8.843 1.00 0.00 C \n", 1593 "HETATM 245 Dx AXS A 3 -11.895 -12.487 9.728 1.00 0.00 N \n", 1594 "HETATM 246 Dx AXS A 3 11.895 12.487 -9.728 1.00 0.00 N \n", 1595 "HETATM 247 R AXS A 3 -0.000 0.000 0.000 1.00 0.00 C \n", 1596 "HETATM 248 Dy AXS A 3 -1.738 23.114 27.545 1.00 0.00 C \n", 1597 "HETATM 249 Dy AXS A 3 1.738 -23.114 -27.545 1.00 0.00 C \n", 1598 "HETATM 250 Dy AXS A 3 -1.912 25.425 30.300 1.00 0.00 N \n", 1599 "HETATM 251 Dy AXS A 3 1.912 -25.425 -30.300 1.00 0.00 N \n", 1600 "HETATM 252 R AXS A 3 -0.000 0.000 0.000 1.00 0.00 C \n", 1601 "HETATM 253 Dz AXS A 3 -43.091 23.541 -22.472 1.00 0.00 C \n", 1602 "HETATM 254 Dz AXS A 3 43.091 -23.541 22.472 1.00 0.00 C \n", 1603 "HETATM 255 Dz AXS A 3 -47.400 25.895 -24.719 1.00 0.00 N \n", 1604 "HETATM 256 Dz AXS A 3 47.400 -25.895 24.719 1.00 0.00 N \n", 1605 "CONECT 2 3 14 230 \n", 1606 "CONECT 3 2 4 15 231 \n", 1607 "CONECT 4 3 5 16 232 \n", 1608 "CONECT 5 4 6 17 233 \n", 1609 "CONECT 6 5 7 18 234 \n", 1610 "CONECT 7 6 8 19 235 \n", 1611 "CONECT 8 7 9 20 236 \n", 1612 "CONECT 9 8 10 21 237 \n", 1613 "CONECT 10 9 11 22 238 \n", 1614 "CONECT 11 10 12 23 239 \n", 1615 "CONECT 12 11 13 24 240 \n", 1616 "CONECT 13 12 25 241 \n", 1617 "CONECT 14 2 15 26 \n", 1618 "CONECT 15 14 3 16 27 \n", 1619 "CONECT 16 15 4 17 28 \n", 1620 "CONECT 17 16 5 18 29 \n", 1621 "CONECT 18 17 6 19 30 \n", 1622 "CONECT 19 18 7 20 31 \n", 1623 "CONECT 20 19 8 21 32 \n", 1624 "CONECT 21 20 9 22 33 \n", 1625 "CONECT 22 21 10 23 34 \n", 1626 "CONECT 23 22 11 24 35 \n", 1627 "CONECT 24 23 12 25 36 \n", 1628 "CONECT 25 24 13 37 \n", 1629 "CONECT 26 14 27 38 \n", 1630 "CONECT 27 26 15 28 39 \n", 1631 "CONECT 28 27 16 29 40 \n", 1632 "CONECT 29 28 17 30 41 \n", 1633 "CONECT 30 29 18 31 42 \n", 1634 "CONECT 31 30 19 32 43 \n", 1635 "CONECT 32 31 20 33 44 \n", 1636 "CONECT 33 32 21 34 45 \n", 1637 "CONECT 34 33 22 35 46 \n", 1638 "CONECT 35 34 23 36 47 \n", 1639 "CONECT 36 35 24 37 48 \n", 1640 "CONECT 37 36 25 49 \n", 1641 "CONECT 38 26 39 50 \n", 1642 "CONECT 39 38 27 40 51 \n", 1643 "CONECT 40 39 28 41 52 \n", 1644 "CONECT 41 40 29 42 53 \n", 1645 "CONECT 42 41 30 43 54 \n", 1646 "CONECT 43 42 31 44 55 \n", 1647 "CONECT 44 43 32 45 56 \n", 1648 "CONECT 45 44 33 46 57 \n", 1649 "CONECT 46 45 34 47 58 \n", 1650 "CONECT 47 46 35 48 59 \n", 1651 "CONECT 48 47 36 49 60 \n", 1652 "CONECT 49 48 37 61 \n", 1653 "CONECT 50 38 51 62 \n", 1654 "CONECT 51 50 39 52 63 \n", 1655 "CONECT 52 51 40 53 64 \n", 1656 "CONECT 53 52 41 54 65 \n", 1657 "CONECT 54 53 42 55 66 \n", 1658 "CONECT 55 54 43 56 67 \n", 1659 "CONECT 56 55 44 57 68 \n", 1660 "CONECT 57 56 45 58 69 \n", 1661 "CONECT 58 57 46 59 70 \n", 1662 "CONECT 59 58 47 60 71 \n", 1663 "CONECT 60 59 48 61 72 \n", 1664 "CONECT 61 60 49 73 \n", 1665 "CONECT 62 50 63 74 \n", 1666 "CONECT 63 62 51 64 75 \n", 1667 "CONECT 64 63 52 65 76 \n", 1668 "CONECT 65 64 53 66 77 \n", 1669 "CONECT 66 65 54 67 78 \n", 1670 "CONECT 67 66 55 68 79 \n", 1671 "CONECT 68 67 56 69 80 \n", 1672 "CONECT 69 68 57 70 81 \n", 1673 "CONECT 70 69 58 71 82 \n", 1674 "CONECT 71 70 59 72 83 \n", 1675 "CONECT 72 71 60 73 84 \n", 1676 "CONECT 73 72 61 85 \n", 1677 "CONECT 74 62 75 86 \n", 1678 "CONECT 75 74 63 76 87 \n", 1679 "CONECT 76 75 64 77 88 \n", 1680 "CONECT 77 76 65 78 89 \n", 1681 "CONECT 78 77 66 79 90 \n", 1682 "CONECT 79 78 67 80 91 \n", 1683 "CONECT 80 79 68 81 92 \n", 1684 "CONECT 81 80 69 82 93 \n", 1685 "CONECT 82 81 70 83 94 \n", 1686 "CONECT 83 82 71 84 95 \n", 1687 "CONECT 84 83 72 85 96 \n", 1688 "CONECT 85 84 73 97 \n", 1689 "CONECT 86 74 87 98 \n", 1690 "CONECT 87 86 75 88 99 \n", 1691 "CONECT 88 87 76 89 100 \n", 1692 "CONECT 89 88 77 90 101 \n", 1693 "CONECT 90 89 78 91 102 \n", 1694 "CONECT 91 90 79 92 103 \n", 1695 "CONECT 92 91 80 93 104 \n", 1696 "CONECT 93 92 81 94 105 \n", 1697 "CONECT 94 93 82 95 106 \n", 1698 "CONECT 95 94 83 96 107 \n", 1699 "CONECT 96 95 84 97 108 \n", 1700 "CONECT 97 96 85 109 \n", 1701 "CONECT 98 86 99 110 \n", 1702 "CONECT 99 98 87 100 111 \n", 1703 "CONECT 100 99 88 101 112 \n", 1704 "CONECT 101 100 89 102 113 \n", 1705 "CONECT 102 101 90 103 114 \n", 1706 "CONECT 103 102 91 104 115 \n", 1707 "CONECT 104 103 92 105 116 \n", 1708 "CONECT 105 104 93 106 117 \n", 1709 "CONECT 106 105 94 107 118 \n", 1710 "CONECT 107 106 95 108 119 \n", 1711 "CONECT 108 107 96 109 120 \n", 1712 "CONECT 109 108 97 121 \n", 1713 "CONECT 110 98 111 122 \n", 1714 "CONECT 111 110 99 112 123 \n", 1715 "CONECT 112 111 100 113 124 \n", 1716 "CONECT 113 112 101 114 125 \n", 1717 "CONECT 114 113 102 115 126 \n", 1718 "CONECT 115 114 103 116 127 \n", 1719 "CONECT 116 115 104 117 128 \n", 1720 "CONECT 117 116 105 118 129 \n", 1721 "CONECT 118 117 106 119 130 \n", 1722 "CONECT 119 118 107 120 131 \n", 1723 "CONECT 120 119 108 121 132 \n", 1724 "CONECT 121 120 109 133 \n", 1725 "CONECT 122 110 123 134 \n", 1726 "CONECT 123 122 111 124 135 \n", 1727 "CONECT 124 123 112 125 136 \n", 1728 "CONECT 125 124 113 126 137 \n", 1729 "CONECT 126 125 114 127 138 \n", 1730 "CONECT 127 126 115 128 139 \n", 1731 "CONECT 128 127 116 129 140 \n", 1732 "CONECT 129 128 117 130 141 \n", 1733 "CONECT 130 129 118 131 142 \n", 1734 "CONECT 131 130 119 132 143 \n", 1735 "CONECT 132 131 120 133 144 \n", 1736 "CONECT 133 132 121 145 \n", 1737 "CONECT 134 122 135 146 \n", 1738 "CONECT 135 134 123 136 147 \n", 1739 "CONECT 136 135 124 137 148 \n", 1740 "CONECT 137 136 125 138 149 \n", 1741 "CONECT 138 137 126 139 150 \n", 1742 "CONECT 139 138 127 140 151 \n", 1743 "CONECT 140 139 128 141 152 \n", 1744 "CONECT 141 140 129 142 153 \n", 1745 "CONECT 142 141 130 143 154 \n", 1746 "CONECT 143 142 131 144 155 \n", 1747 "CONECT 144 143 132 145 156 \n", 1748 "CONECT 145 144 133 157 \n", 1749 "CONECT 146 134 147 158 \n", 1750 "CONECT 147 146 135 148 159 \n", 1751 "CONECT 148 147 136 149 160 \n", 1752 "CONECT 149 148 137 150 161 \n", 1753 "CONECT 150 149 138 151 162 \n", 1754 "CONECT 151 150 139 152 163