Back to index

python-biopython  1.60
Functions | Variables
test_SVDSuperimposer Namespace Reference

Functions

def simple_matrix_print

Variables

tuple x
tuple y
tuple sup = SVDSuperimposer()
tuple rms = sup.get_rms()
tuple y_on_x1 = dot(y, rot)
tuple y_on_x2 = sup.get_transformed()

Function Documentation

Simple string to display a floating point matrix

This should give the same output on multiple systems.  This is
needed because a simple "print matrix" uses scientific notation
which varies between platforms.

Only 4 decimal places are used to avoid false test failures due
to slight differences in the calculation (e.g. due to different
versions of the underlying libraries or the compilation options
they used).

Definition at line 49 of file test_SVDSuperimposer.py.

00049 
00050 def simple_matrix_print(matrix):
00051     """Simple string to display a floating point matrix
00052 
00053     This should give the same output on multiple systems.  This is
00054     needed because a simple "print matrix" uses scientific notation
00055     which varies between platforms.
00056 
00057     Only 4 decimal places are used to avoid false test failures due
00058     to slight differences in the calculation (e.g. due to different
00059     versions of the underlying libraries or the compilation options
00060     they used).
00061     """
00062 
00063     #This uses a fancy double nested list expression.
00064     #If and when Biopython requires Python 2.4 or later,
00065     #it would be slightly nicer to use generator expressions.
00066     return "[" \
00067     + "\n ".join(["[" \
00068                  + " ".join(["% 1.4f" % val for val in row]) \
00069                  + "]" for row in matrix]) \
00070     + "]"
00071 
# output results

Variable Documentation

tuple test_SVDSuperimposer.rms = sup.get_rms()

Definition at line 38 of file test_SVDSuperimposer.py.

Definition at line 28 of file test_SVDSuperimposer.py.

Initial value:
00001 array([[51.65, -1.90, 50.07],
00002          [50.40, -1.23, 50.65],
00003          [50.68, -0.04, 51.54],
00004          [50.22, -0.02, 52.85]], 'f')

Definition at line 18 of file test_SVDSuperimposer.py.

Initial value:
00001 array([[51.30, -2.99, 46.54],
00002          [51.09, -1.88, 47.58],
00003          [52.36, -1.20, 48.03],
00004          [52.71, -1.18, 49.38]], 'f')

Definition at line 23 of file test_SVDSuperimposer.py.

tuple test_SVDSuperimposer.y_on_x1 = dot(y, rot)

Definition at line 44 of file test_SVDSuperimposer.py.

tuple test_SVDSuperimposer.y_on_x2 = sup.get_transformed()

Definition at line 47 of file test_SVDSuperimposer.py.