def test_asa_3(): traj_ref = np.loadtxt( os.path.join(reference_dir(),'g_sas_ref.dat')) Conf = Trajectory.load_from_pdb(os.path.join( fixtures_dir(), 'native.pdb')) traj = Trajectory.load_trajectory_file( os.path.join(fixtures_dir(), 'trj0.xtc') , Conf=Conf) traj_asa = calculate_asa(traj, probe_radius=0.14, n_sphere_points = 960) # the algorithm used by gromacs' g_sas is slightly different than the one # used here, so the results are not exactly the same -- see the comments # in src/python/geomtry/asa.py or the readme file src/ext/asa/README.txt # for details npt.assert_array_almost_equal(traj_asa, traj_ref, decimal=2)
def setUp(self): test_dir = os.path.join( reference_dir(), 'cfep_reference/' ) self.generators = Trajectory.load_trajectory_file(test_dir + 'Gens.lh5') N = len(self.generators) self.counts = io.mmread(test_dir + 'tCounts.mtx') self.lag_time = 1.0 self.pfolds = np.random.rand(N) self.rescale = False self.reactant = 0 self.product = N
def test_FahProjectBuilder(): cd = os.getcwd() td = tempfile.mkdtemp() os.chdir(td) traj_dir = os.path.join(reference_dir(), "project_reference/project.builder/fah_style_data") conf_filename = os.path.join(traj_dir, 'native.pdb') pb = FahProjectBuilder(traj_dir, '.xtc', conf_filename) project = pb.get_project() eq_(project.n_trajs, 4) npt.assert_array_equal(project.traj_lengths, [1001, 1001, 501, 1001]) os.chdir(cd) shutil.rmtree(td)
def setUp(self): test_dir = os.path.join(reference_dir(), 'cfep_reference/') self.generators = Trajectory.load_trajectory_file(test_dir + 'Gens.lh5') N = len(self.generators) self.counts = io.mmread(test_dir + 'tCounts.mtx') self.lag_time = 1.0 self.pfolds = np.random.rand(N) self.rescale = False self.reactant = 0 self.product = N
def setUp(self): # load in the reference data self.tpt_ref_dir = os.path.join(reference_dir(), "transition_path_theory_reference") self.tprob = scipy.io.mmread( os.path.join(self.tpt_ref_dir, "tProb.mtx") ) #.toarray() self.sources = [0] # chosen arbitarily by TJL self.sinks = [70] # chosen arbitarily by TJL self.waypoints = [60] # chosen arbitarily by TJL self.lag_time = 1.0 # chosen arbitarily by TJL # set up the reference data for hub scores self.hub_ref_dir = os.path.join(self.tpt_ref_dir, "hub_ref") K = np.loadtxt( os.path.join(self.hub_ref_dir, 'ratemat_1.dat') ) #self.hub_T = scipy.linalg.expm( K ) # delta-t should not affect hub scores self.hub_T = np.transpose( np.genfromtxt(os.path.join(self.hub_ref_dir, 'mat_1.dat'))[:,:-3] ) for i in range(self.hub_T.shape[0]): self.hub_T[i,:] /= np.sum(self.hub_T[i,:]) self.hc = np.loadtxt( os.path.join(self.hub_ref_dir, 'fraction_visited.dat') ) self.Hc = np.loadtxt( os.path.join(self.hub_ref_dir, 'hub_scores.dat') )[:,2]