def get_pdb_writer(self) -> pdb_writer.PDBWriter: """ Get the PDBWriter """ return pdb_writer.PDBWriter( list(range(1, len(self._atom_names) + 1)), self._atom_names, self._residue_numbers, self._residue_names, )
def setUp(self): self.atom_numbers = [1000, 1001] self.atom_names = ["ABCD", "A2"] self.residue_numbers = [999, 1000] self.residue_names = ["XYZ", "R2"] self.coords = np.zeros((2, 3)) self.coords[0, :] = 0.1 self.coords[1, :] = 0.2 self.writer = pdb_writer.PDBWriter(self.atom_numbers, self.atom_names, self.residue_numbers, self.residue_names)
def setup_system(): # create a store writer = pdb_writer.PDBWriter( range(N_ATOMS), ["CA"] * N_ATOMS, [1] * N_ATOMS, ["ALA"] * N_ATOMS ) store = vault.DataStore(gen_state(0), N_REPLICAS, writer, block_size=BACKUP_FREQ) store.initialize(mode="w") # create and store the remd_runner l = ladder.NearestNeighborLadder(n_trials=100) policy = adaptor.AdaptationPolicy(1.0, 50, 100) a = adaptor.EqualAcceptanceAdaptor(n_replicas=N_REPLICAS, adaptation_policy=policy) remd_runner = leader.LeaderReplicaExchangeRunner( N_REPLICAS, max_steps=N_STEPS, ladder=l, adaptor=a ) store.save_remd_runner(remd_runner) # create and store the communicator c = comm.MPICommunicator(N_ATOMS, N_REPLICAS) store.save_communicator(c) # create and store the fake system s = helper.FakeSystem() s.temperature_scaler = temperature.ConstantTemperatureScaler(300.0) store.save_system(s) # create and store the options o = options.RunOptions() o.runner = "fake_runner" store.save_run_options(o) # create and save the initial states states = [gen_state(i) for i in range(N_REPLICAS)] store.save_states(states, 0) # save data_store store.save_data_store()
def test_should_raise_with_wrong_number_of_residue_names(self): with self.assertRaises(AssertionError): pdb_writer.PDBWriter(self.atom_numbers, self.atom_names, self.residue_numbers, ["R1"])