<s> """<STR_LIT>""" <EOL> import unittest <EOL> from pyproct . driver . handlers . matrix . test . data . dihedral_angles_pdb_data import pdb1 , expected_dihedrals <EOL> import prody <EOL> import StringIO <EOL> from pyproct . driver . handlers . matrix . dihedralRMSDMatrixCalculator import DihedralRMSDMatrixCalculator , rmsd <EOL> import numpy <EOL> class Test ( unittest . TestCase ) : <EOL> def test_get_dihedrals ( self ) : <EOL> input = StringIO . StringIO ( pdb1 ) <EOL> pdb_structure = prody . parsePDBStream ( input ) <EOL> dihedrals = DihedralRMSDMatrixCalculator . calculateDihedralsForCoordset ( pdb_structure , pdb_structure . getCoordsets ( ) [ <NUM_LIT:0> ] ) <EOL> numpy . testing . assert_array_almost_equal ( numpy . array ( expected_dihedrals [ <NUM_LIT:1> : - <NUM_LIT:1> ] ) , numpy . array ( dihedrals [ <NUM_LIT:2> : - <NUM_LIT:2> ] ) , <NUM_LIT:2> ) <EOL> def test_calc_matrix ( self ) : <EOL> pdb_structure = prody . parsePDB ( "<STR_LIT>" ) <EOL> expected = [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> product_matrix = DihedralRMSDMatrixCalculator . build ( pdb_structure ) <EOL> numpy . testing . assert_almost_equal ( expected , product_matrix . get_data ( ) , <NUM_LIT:8> ) <EOL> def test_rmsd ( self ) : <EOL> a = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> ] <EOL> b = [ <NUM_LIT:10> , <NUM_LIT:20> , <NUM_LIT:30> , <NUM_LIT> , <NUM_LIT:50> ] <EOL> self . assertAlmostEqual ( <NUM_LIT> , rmsd ( numpy . array ( a ) , numpy . array ( b ) ) , <NUM_LIT:8> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
