def test(self):

        prep_metric = metrics.Dihedral(angles='phi/psi')
        project = get('ProjectInfo.yaml')

        os.chdir(self.td)
        tICA_train.run(prep_metric, project, delta_time=10, atom_indices=None,
                       output='tICAtest.h5', min_length=0, stride=1)

        ref_tICA = get('tICA_ref_mle.h5')

        ref_vals = ref_tICA['vals']
        ref_vecs = ref_tICA['vecs']
        ref_inds = np.argsort(ref_vals)
        ref_vals = ref_vals[ref_inds]
        ref_vecs = ref_vecs[:, ref_inds]

        test_tICA = load('tICAtest.h5')

        test_vals = test_tICA['vals']
        test_vecs = test_tICA['vecs']
        test_inds = np.argsort(test_vals)
        test_vals = test_vals[test_inds]
        test_vecs = test_vecs[:, test_inds]

        eq(test_vals, ref_vals)
        eq(test_vecs, test_vecs)
Ejemplo n.º 2
0
 def setup(self):
     self.metric = metrics.Dihedral()
     self.pdb_fn = os.path.join(fixtures_dir(), 'native.pdb')
     self.trj_fn = os.path.join(fixtures_dir(), 'trj0.lh5')
     self.project = Project({'traj_lengths': [501], 'traj_paths': [self.trj_fn],
                        'conf_filename': self.pdb_fn, 'traj_converted_from': [None],
                        'traj_errors': [None]})
     self.vtraj = partition(self.project, chunk_size=501)[0]
Ejemplo n.º 3
0
 def setup(self):
     self.metric = metrics.Dihedral()
     self.pdb_fn = os.path.join(fixtures_dir(), 'native.pdb')
     self.trj_fn = os.path.join(fixtures_dir(), 'trj0.lh5')
     self.project = Project({
         'NumTrajs': 1,
         'TrajLengths': [501],
         'TrajFileBaseName': 'trj',
         'TrajFileType': '.lh5',
         'ConfFilename': self.pdb_fn,
         'TrajFilePath': fixtures_dir()
     })
     self.vtraj = partition(self.project, chunk_size=501)[0]
Ejemplo n.º 4
0
 def setup(self):
     self.metric = metrics.Dihedral()