Author: bugman
Date: Tue Dec 2 16:16:33 2014
New Revision: 26898
URL: http://svn.gna.org/viewcvs/relax?rev=26898&view=rev
Log:
Created the Frame_order.test_simulate_pseudo_ellipse_xy_plane_tilt system test.
This is to check the frame_order.simulate user function for the pseudo-ellipse
model with a xz-plane
tilt.
Modified:
branches/frame_order_cleanup/test_suite/system_tests/frame_order.py
Modified: branches/frame_order_cleanup/test_suite/system_tests/frame_order.py
URL:
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/system_tests/frame_order.py?rev=26898&r1=26897&r2=26898&view=diff
==============================================================================
--- branches/frame_order_cleanup/test_suite/system_tests/frame_order.py
(original)
+++ branches/frame_order_cleanup/test_suite/system_tests/frame_order.py Tue Dec
2 16:16:33 2014
@@ -3493,6 +3493,77 @@
print("Maximum phi for X and Y: %s" % max_phi)
+ def test_simulate_pseudo_ellipse_xy_plane_tilt(self):
+ """Check the frame_order.simulate user function PDB file for the
pseudo-ellipse model along the z-axis."""
+
+ # Init.
+ cone_theta_x = 2.0
+ cone_theta_y = 0.5
+ cone_sigma_max = 0.1
+ pivot = array([1, 0, -2], float64)
+ l = 50.0
+ sim_num = 500
+
+ # The axis parameters.
+ eigen_beta = -pi/4.0
+ R = zeros((3, 3), float64)
+ euler_to_R_zyz(0.0, eigen_beta, 0.0, R)
+ print("Motional eigenframe:\n%s" % R)
+
+ # Set up.
+ self.setup_model(pipe_name='PDB model', model='pseudo-ellipse',
pivot=pivot, ave_pos_x=pivot[0], ave_pos_y=pivot[1], ave_pos_z=pivot[2],
ave_pos_alpha=0.0, ave_pos_beta=eigen_beta, ave_pos_gamma=0.0, eigen_alpha=0.0,
eigen_beta=eigen_beta, eigen_gamma=0.0, cone_theta_x=cone_theta_x,
cone_theta_y=cone_theta_y, cone_sigma_max=cone_sigma_max)
+
+ # Create the PDB.
+ self.interpreter.frame_order.simulate(file='simulation.pdb',
dir=ds.tmpdir, step_size=10.0, snapshot=10, total=sim_num)
+
+ # Delete all structural data.
+ self.interpreter.structure.delete()
+
+ # Read the contents of the file.
+ self.interpreter.structure.read_pdb(file='simulation.pdb',
dir=ds.tmpdir)
+
+ # Check the atomic coordinates.
+ selection = cdp.structure.selection()
+ epsilon = 1e-3
+ max_phi = 0.0
+ lateral_slide = 0.17
+ vertical_slide = 0.02
+ for res_num, res_name, atom_num, atom_name, pos in
cdp.structure.atom_loop(selection=selection, res_num_flag=True,
res_name_flag=True, atom_num_flag=True, atom_name_flag=True, pos_flag=True):
+ # Loop over all positions.
+ for i in range(sim_num):
+ # Shift the position back to the origin, and decompose into
spherical coordinates.
+ new_pos = pos[i] - pivot
+ r, theta, phi = cartesian_to_spherical(dot(transpose(R),
new_pos))
+
+ # Printout.
+ print("Checking residue %s %s, atom %s %s, at shifted position
[%8.3f, %8.3f, %8.3f], with spherical coordinates [%8.3f, %8.3f, %8.3f]." %
(res_num, res_name, atom_num, atom_name, new_pos[0], new_pos[1], new_pos[2], r,
theta, phi))
+
+ # The vector length.
+ self.assertAlmostEqual(r/100.0, 1.0, 4)
+
+ # Check the X vector.
+ if res_name == 'X':
+ self.assert_(theta >= pi/2.0 - cone_theta_x - epsilon)
+ self.assert_(theta <= pi/2.0 + cone_theta_x + epsilon)
+
+ # Check the Y vector.
+ elif res_name == 'Y':
+ if abs(phi-pi/2.0) > max_phi:
+ max_phi = abs(phi-pi/2.0)
+ self.assert_(theta >= pi/2.0 - cone_theta_y -
vertical_slide)
+ self.assert_(theta <= pi/2.0 + cone_theta_y +
vertical_slide)
+ self.assert_(phi-pi/2.0 >= -cone_sigma_max - lateral_slide)
+ self.assert_(phi-pi/2.0 <= cone_sigma_max + lateral_slide)
+
+ # Check the Z vector (should be in the cone defined by theta).
+ elif res_name == 'Z':
+ theta_max = cone_theta_x * cone_theta_y /
sqrt((cos(phi)*cone_theta_y)**2 + (sin(phi)*cone_theta_x)**2)
+ self.assert_(theta <= theta_max + epsilon)
+
+ # Print out the maximum phi value.
+ print("Maximum phi-pi/2.0 for Y: %s" % max_phi)
+
+
def test_simulate_pseudo_ellipse_z_axis(self):
"""Check the frame_order.simulate user function PDB file for the
pseudo-ellipse model along the z-axis."""
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits