def test_write_improperlib(self): """Test the write_improperlib function""" mlib = self.get_mdt_library() mlib.dihedral_classes.read('data/impgrp.lib') angtype = mdt.features.DihedralType(mlib) ang = mdt.features.Dihedral(mlib, bins=mdt.uniform_bins(180, 0.0, 2.0)) m = self.get_test_mdt(mlib, [angtype, ang]) mdt.write_improperlib(open('test.out', 'w'), m) # Make sure that valid Python code was produced code = compile(open('test.out').read(), 'test.out', 'exec') os.unlink('test.out')
def test_write_improperlib(self): """Test the write_improperlib function""" mlib = self.get_mdt_library() mlib.dihedral_classes.read('data/impgrp.lib') angtype = mdt.features.DihedralType(mlib) ang = mdt.features.Dihedral(mlib, bins=mdt.uniform_bins(180, 0.0, 2.0)) m = self.get_test_mdt(mlib, [angtype, ang]) with open('test.out', 'w') as fh: mdt.write_improperlib(fh, m) # Make sure that valid Python code was produced with open('test.out') as fh: _ = compile(fh.read(), 'test.out', 'exec') os.unlink('test.out')
from modeller import * import mdt import mdt.features env = environ() mlib = mdt.Library(env) mlib.dihedral_classes.read('${LIB}/impgrp.lib') xray = mdt.features.XRayResolution(mlib, bins=[(0.51, 2.001, 'High res(2.0A)')]) impr_type = mdt.features.DihedralType(mlib) improper = mdt.features.Dihedral(mlib, bins=mdt.uniform_bins(400, 1.0, 0.0025)) m = mdt.Table(mlib, file='mdt.mdt') m = m.reshape(features=(xray, impr_type, improper), offset=(0,0,0), shape=(1,-1,-1)) m = m.integrate(features=(impr_type, improper)) mdt.write_improperlib(file('impropers.py', 'w'), m, density_cutoff=0.1)
from modeller import * import mdt import mdt.features env = Environ() mlib = mdt.Library(env) mlib.dihedral_classes.read('${LIB}/impgrp.lib') xray = mdt.features.XRayResolution(mlib, bins=[(0.51, 2.001, 'High res(2.0A)')]) impr_type = mdt.features.DihedralType(mlib) improper = mdt.features.Dihedral(mlib, bins=mdt.uniform_bins(400, 1.0, 0.0025)) m = mdt.Table(mlib, file='mdt.mdt') m = m.reshape(features=(xray, impr_type, improper), offset=(0,0,0), shape=(1,-1,-1)) m = m.integrate(features=(impr_type, improper)) mdt.write_improperlib(file('impropers.py', 'w'), m, density_cutoff=0.1)