Esempio n. 1
0
 def test_resolution_steric_conflicts(self):
     os.mkdir('/steric_conflict_resolution_work/multi_residue_cg_test') #probably don't need a proper temporary object for now because only running on travis where it will get wiped anyway
     run_steric_resolution.run_steric_resolution_loop(input_coord_file = '/steric_conflict_resolution_work/test_data/multiple_lipids_MARTINI/multiple_MARTINI_residues_steric_conflicts.gro', index_list = [1, 60, 61, 130, 131, 250, 251, 325], residue_names_list = ['DOPC', 'PRPC', 'XNG3', 'XNSM'], cutoff = 2.0, list_particles_per_residue = [12, 14, 24, 15], output_path = '/steric_conflict_resolution_work/multi_residue_cg_test', topology_filepath = '/steric_conflict_resolution_work/test_data/multiple_lipids_MARTINI/sys.top')
     list_steric_conflicts_by_round = []
     for steric_conflict_pickle_file in glob.glob('/steric_conflict_resolution_work/multi_residue_cg_test/results/cumulative_array_per_residue_steric_conflicts_round_*.p'):
         steric_conflict_data_array = pickle.load(open(steric_conflict_pickle_file, 'rb'))
         num_residues_with_steric_conflicts = np.count_nonzero(steric_conflict_data_array)
         list_steric_conflicts_by_round.append(num_residues_with_steric_conflicts)
     self.assertEqual(min(list_steric_conflicts_by_round), 0, "The multiple_MARTINI_residues_steric_conflicts.gro file should have all steric conflicts resolved by the last round of steric resolution.")
Esempio n. 2
0
 def test_resolution_steric_conflicts(self):
     os.mkdir('/steric_conflict_resolution_work/dppc_large_test') #probably don't need a proper temporary object for now because only running on travis where it will get wiped anyway
     run_steric_resolution.run_steric_resolution_loop(input_coord_file = '/steric_conflict_resolution_work/test_data/dppc_many_copies/dppc_many_copies.gro', index_list = [1, 240], residue_names_list = ['DPPC'], cutoff = 2.0, list_particles_per_residue = [12], output_path = '/steric_conflict_resolution_work/dppc_large_test', topology_filepath = '/steric_conflict_resolution_work/test_data/dppc_many_copies/sys.top')
     list_steric_conflicts_by_round = []
     for steric_conflict_pickle_file in glob.glob('/steric_conflict_resolution_work/dppc_large_test/results/cumulative_array_per_residue_steric_conflicts_round_*.p'):
         steric_conflict_data_array = pickle.load(open(steric_conflict_pickle_file, 'rb'))
         num_residues_with_steric_conflicts = np.count_nonzero(steric_conflict_data_array)
         list_steric_conflicts_by_round.append(num_residues_with_steric_conflicts)
     self.assertEqual(min(list_steric_conflicts_by_round), 0, "The dppc_many_copies.gro file should have all steric conflicts resolved by the last round of steric resolution.")
Esempio n. 3
0
 def test_list_particles_per_residue(self):
     with self.assertRaises(SystemExit) as context:
         run_steric_resolution.run_steric_resolution_loop(input_coord_file='dummy', index_list = [1, 24,48,60], residue_names_list = ['DPPC', 'POPS'], cutoff = 2.0, list_particles_per_residue = [12], output_path = 'dummy', topology_filepath = 'dummy', alchembed_b_value = 2, alchembed_resolution = 'CG', alchembed_steps = 1000, alchembed_alpha = 0.1, alchembed_dt = 0.01)
     self.assertEqual('The list_particles_per_residue should be half as long as the index_list as the latter contains start & end indices for each residue.', context.exception.message)