def test(self): BuildMSM.run(lagtime=1, assignments=get('Assignments.h5')['arr_0'], symmetrize='MLE', out_dir=self.td) eq(load(pjoin(self.td, 'tProb.mtx')), get('tProb.mtx'), decimal=5) eq(load(pjoin(self.td, 'tCounts.mtx')), get('tCounts.mtx'), decimal=3) eq(load(pjoin(self.td, 'Mapping.dat')), get('Mapping.dat')) eq(load(pjoin(self.td, 'Assignments.Fixed.h5')), get('Assignments.Fixed.h5')) eq(load(pjoin(self.td, 'Populations.dat')), get('Populations.dat'))
def test(self): BuildMSM.run(LagTime=1, assignments=get('Assignments.h5')['arr_0'], Symmetrize='MLE', OutDir=self.td) eq(load(pjoin(self.td, 'tProb.mtx')), get('tProb.mtx')) eq(load(pjoin(self.td, 'tCounts.mtx')), get('tCounts.mtx')) eq(load(pjoin(self.td, 'Mapping.dat')), get('Mapping.dat')) eq(load(pjoin(self.td, 'Assignments.Fixed.h5')), get('Assignments.Fixed.h5')) eq(load(pjoin(self.td, 'Populations.dat')), get('Populations.dat'))
def test(self): args, metric = Assign.parser.parse_args([ '-p', get('ProjectInfo.yaml', just_filename=True), '-g', get('Gens.lh5', just_filename=True), '-o', self.td, 'rmsd', '-a', get('AtomIndices.dat', just_filename=True)], print_banner=False) Assign.main(args, metric) eq(load(pjoin(self.td, 'Assignments.h5')), get('assign/Assignments.h5')) eq(load(pjoin(self.td, 'Assignments.h5.distances')), get('assign/Assignments.h5.distances'))
def test(self): args, metric = Cluster.parser.parse_args([ '-p', get('points_on_cube/ProjectInfo.yaml', just_filename=True), '-o', self.td, 'rmsd', '-a', get('points_on_cube/AtomIndices.dat', just_filename=True), 'kcenters', '-k', '4'], print_banner=False) Cluster.main(args, metric) assignments = load(pjoin(self.td, 'Assignments.h5'))["arr_0"] assignment_counts = np.bincount(assignments.flatten()) eq(assignment_counts, np.array([2, 2, 2, 2])) distances = load(pjoin(self.td, 'Assignments.h5.distances'))["arr_0"] eq(distances, np.zeros((1,8)))
def test(self): # extract xtcs to a temp dir xtc_fn = get('XTC.tgz', just_filename=True) fh = tarfile.open(xtc_fn, mode='r:gz') fh.extractall(self.td) fh.close() outfn = pjoin(self.td, 'ProjectInfo.yaml') # move to that directory os.chdir(self.td) atom_indices = np.arange(4) ConvertDataToHDF.run(projectfn=outfn, conf_filename=get('native.pdb', just_filename=True), input_dir=pjoin(self.td, 'XTC'), source='file', min_length=0, stride=1, rmsd_cutoff=np.inf, atom_indices=atom_indices, iext=".xtc") project = load(outfn) traj = project.load_conf() eq(traj.n_atoms, 4)
def test(self): args, metric = Assign.parser.parse_args([ '-p', get('ProjectInfo.yaml', just_filename=True), '-g', get('Gens.lh5', just_filename=True), '-o', self.td, 'rmsd', '-a', get('OldAtomIndices.dat', just_filename=True)], print_banner=False) if os.getenv('TRAVIS', None) == 'true': raise nose.SkipTest('Skipping test_Assign on TRAVIS') Assign.main(args, metric) eq(load(pjoin(self.td, 'Assignments.h5')), get('assign/Assignments.h5')) eq(load(pjoin(self.td, 'Assignments.h5.distances')), get('assign/Assignments.h5.distances'), decimal=5)
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)
def test(self): args, metric = Cluster.parser.parse_args([ '-p', get('ProjectInfo.yaml', just_filename=True), '-a', pjoin(self.td, 'Assignments.h5'), '-d', pjoin(self.td, 'Assignments.h5.distances'), '-g', pjoin(self.td, 'Gens.lh5'), 'rmsd', '-a', get('AtomIndices.dat', just_filename=True), 'kcenters', '-k', '100'], print_banner=False) Cluster.main(args, metric) eq(load(pjoin(self.td, 'Assignments.h5')), get('Assignments.h5')) eq(load(pjoin(self.td, 'Assignments.h5.distances')), get('Assignments.h5.distances')) eq(load(pjoin(self.td, 'Gens.lh5')), get('Gens.lh5'))
def test(self): args, metric = Cluster.parser.parse_args([ '-p', get('ProjectInfo.yaml', just_filename=True), '-s', '10', '-o', self.td, 'rmsd', '-a', get('AtomIndices.dat', just_filename=True), 'hierarchical'], print_banner=False) Cluster.main(args, metric) eq(load(pjoin(self.td, 'ZMatrix.h5')), get('ZMatrix.h5'))
def test(self): try: import fastcluster except ImportError: raise nose.SkipTest("Cannot find fastcluster, so skipping hierarchical clustering test.") args, metric = Cluster.parser.parse_args([ '-p', get('ProjectInfo.yaml', just_filename=True), '-s', '10', '-o', self.td, 'rmsd', '-a', get('AtomIndices.dat', just_filename=True), 'hierarchical'], print_banner=False) Cluster.main(args, metric) eq(load(pjoin(self.td, 'ZMatrix.h5')), get('ZMatrix.h5'))
def test(self): # extract xtcs to a temp dir xtc_fn = get('XTC.tgz', just_filename=True) fh = tarfile.open(xtc_fn, mode='r:gz') fh.extractall(self.td) fh.close() outfn = pjoin(self.td, 'ProjectInfo.yaml') # mode to that directory os.chdir(self.td) ConvertDataToHDF.run(projectfn=outfn, PDBfn=get('native.pdb', just_filename=True), InputDir=pjoin(self.td, 'XTC'), source='file', min_length=0, stride=1, rmsd_cutoff=np.inf) eq(load(outfn), get('ProjectInfo.yaml'))
def test(self): if os.getenv('TRAVIS', None) == 'true': raise nose.SkipTest('Skipping test_Assign on TRAVIS') try: import fastcluster except ImportError: raise nose.SkipTest("Cannot find fastcluster, so skipping hierarchical clustering test.") args, metric = Cluster.parser.parse_args([ '-p', get('ProjectInfo.yaml', just_filename=True), '-s', '10', '-o', self.td, 'rmsd', '-a', get('AtomIndices.dat', just_filename=True), 'hierarchical'], print_banner=False) Cluster.main(args, metric) eq(load(pjoin(self.td, 'ZMatrix.h5')), get('ZMatrix.h5'))