Skip to content

Commit

Permalink
accessibility tested inside structural models now
Browse files Browse the repository at this point in the history
  • Loading branch information
fransua committed Aug 11, 2015
1 parent ae031a3 commit 4a3a839
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

+-------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+
| | .. image:: https://travis-ci.org/3DGenomes/tadbit.png?branch=master | .. image:: https://coveralls.io/repos/3DGenomes/tadbit/badge.svg?branch=master&service=github |
| Current version: 0.1_alpha.410 | :target: https://travis-ci.org/3DGenomes/tadbit | :target: https://coveralls.io/github/3DGenomes/tadbit?branch=master |
| Current version: 0.1_alpha.411 | :target: https://travis-ci.org/3DGenomes/tadbit | :target: https://coveralls.io/github/3DGenomes/tadbit?branch=master |
| | | |
+-------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+

Expand Down
2 changes: 1 addition & 1 deletion _pytadbit/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1_alpha.410"
__version__ = "0.1_alpha.411"
19 changes: 14 additions & 5 deletions test/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,19 +496,24 @@ def test_15_3d_modelling(self):
self.assertEqual(round(models.angle_between_3_particles(15,14,11)/5, 0),
13)
# coordinates
# self.assertEqual([round(x, 3) for x in models.particle_coordinates(15)],
# [2372.253, -1193.602, -1145.397])
self.assertEqual([round(x, 2) for x in models.particle_coordinates(15)],
[-1060.85, -3046.43, 4247.42])
# dihedral_angle
# self.assertTrue(round(models.dihedral_angle(2,8,15, 16), 3), -13.443)
# self.assertEqual(round(models.dihedral_angle(15,19,20,21), 3), 79.439)
# self.assertEqual(round(models.dihedral_angle(15,14,11, 12), 3), 8.136)
self.assertTrue (round(models.dihedral_angle(2,8,15, 16) , 2), -13.44)
self.assertEqual(round(models.dihedral_angle(15,19,20,21) , 2), 14.76 )
self.assertEqual(round(models.dihedral_angle(15,14,11, 12), 2), 5.93 )
# median distance
self.assertEqual(round(models.median_3d_dist(3, 20, plot=False)/100, 0),
15)
self.assertEqual(round(models.median_3d_dist(3, 20, cluster=1,
plot=False)/200, 0), 8)
self.assertEqual(round(models.median_3d_dist(7, 10, models=range(5),
plot=False), 0), 250)
# accessibility
models.accessibility(radius=75, nump=10, plot=False, savedata='models.acc')
vals = [l.split() for l in open('models.acc').readlines()[1:]]
self.assertEqual(vals[0][1:3], ['0.640', '0.960'])
self.assertEqual(vals[20][1:3], ['0.960', '0.392'])
# write cmm
models.write_cmm('.', model_num=2)
models.write_cmm('.', models=range(5))
Expand All @@ -517,6 +522,10 @@ def test_15_3d_modelling(self):
models.write_xyz('.', model_num=2)
models.write_xyz('.', models=range(5))
models.write_xyz('.', cluster=2)
# write json
models.write_json('model.json', model_num=2)
models.write_json('model.json', models=range(5))
models.write_json('model.json', cluster=2)
# clean
system('rm -f model.*')
system('rm -f lala')
Expand Down

0 comments on commit 4a3a839

Please sign in to comment.