From 449dbbdba3835051df8fc87fa6f3b57834574f6f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 11 Jan 2024 15:58:05 +0000 Subject: [PATCH] Update documentation --- _modules/transformato/mutate.html | 144 ++++++++++++++++++++---- _modules/transformato/state.html | 159 ++++++++++++++++----------- _modules/transformato/system.html | 72 ++++++++---- autosummary/transformato.mutate.html | 25 +++++ autosummary/transformato.state.html | 16 +++ genindex.html | 10 +- objects.inv | Bin 1810 -> 1841 bytes searchindex.js | 2 +- 8 files changed, 318 insertions(+), 110 deletions(-) diff --git a/_modules/transformato/mutate.html b/_modules/transformato/mutate.html index 522dc5ad..c687e9d1 100644 --- a/_modules/transformato/mutate.html +++ b/_modules/transformato/mutate.html @@ -108,6 +108,7 @@

Source code for transformato.mutate

 
 
 logger = logging.getLogger(__name__)
+logging.getLogger().setLevel(logging.DEBUG)
 
 
 def _flattened(list_of_lists: list) -> list:
@@ -139,7 +140,7 @@ 

Source code for transformato.mutate

     for lambda_value in np.linspace(1, 0, nr_of_steps + 1)[1:]:
         print("####################")
         print(
-            f"Perform paramteter scaling on cc in step: {intermediate_factory.current_step} with lamb: {lambda_value}"
+            f"Perform parameter scaling on cc in step: {intermediate_factory.current_step} with lamb: {lambda_value}"
         )
         print("####################")
         intermediate_factory.write_state(
@@ -449,7 +450,7 @@ 

Source code for transformato.mutate

             self.dummy_region_cc2: DummyRegion
 
             self.asfe: bool = False
-            self._check_cgenff_versions()
+            # self._check_cgenff_versions()
 
         except:
             logger.info(
@@ -744,7 +745,6 @@ 

Source code for transformato.mutate

 
         for atom in psf.view[f":{tlc}"].atoms:
             if atom.name.find("LP") == False:
-                print(f"die Atome {atom}")
                 if atom.frame_type.atom1.idx in flat_ordered_connected_dummy_regions:
                     lp_dict_dummy_region[atom.frame_type.atom1.idx].append(atom.idx)
 
@@ -1820,8 +1820,6 @@ 

Source code for transformato.mutate

             cc_names_struc1.append(ligand1_atom.name)
             cc_names_struc2.append(ligand2_atom.name)
 
-        print(f"CC Struc1: {cc_names_struc1}")
-        print(f"CC Struc2: {cc_names_struc2}")
         return match_atom_names_cc1_to_cc2
@@ -1911,6 +1909,20 @@

Source code for transformato.mutate

                             ligand1_atom.mod_type = mod_type(
                                 modified_epsilon, modified_rmin
                             )
+                            # do this only when using GAFF
+                            if type(psf) == pm.amber.AmberParm:
+                                assert (
+                                    psf[f":{self.tlc_cc1}@{ligand1_atom.idx+1}"]
+                                    .atoms[0]
+                                    .name
+                                    == ligand1_atom.name
+                                )
+                                pm.tools.actions.changeLJSingleType(
+                                    psf,
+                                    f":{self.tlc_cc1}@{ligand1_atom.idx+1}",
+                                    modified_rmin,
+                                    modified_epsilon,
+                                ).execute()
 
             if not found:
                 raise RuntimeError("No corresponding atom in cc2 found")
@@ -1980,6 +1992,16 @@

Source code for transformato.mutate

                     ligand1_bond.mod_type = mod_type(modified_k, modified_req)
                     logger.debug(ligand1_bond.mod_type)
 
+                    # do this only when using GAFF
+                    if type(psf) == pm.amber.AmberParm:
+                        pm.tools.actions.setBond(
+                            psf,
+                            f":{self.tlc_cc1}@{ligand1_bond.atom1.idx+1}",
+                            f":{self.tlc_cc1}@{ligand1_bond.atom2.idx+1}",
+                            modified_k,
+                            modified_req,
+                        ).execute()
+
             if not found:
                 logger.critical(ligand1_bond)
                 raise RuntimeError(
@@ -2054,6 +2076,17 @@ 

Source code for transformato.mutate

 
                     cc1_angle.mod_type = mod_type(modified_k, modified_theteq)
 
+                    # do this only when using GAFF
+                    if type(psf) == pm.amber.AmberParm:
+                        pm.tools.actions.setAngle(
+                            psf,
+                            f":{self.tlc_cc1}@{cc1_angle.atom1.idx+1}",
+                            f":{self.tlc_cc1}@{cc1_angle.atom2.idx+1}",
+                            f":{self.tlc_cc1}@{cc1_angle.atom3.idx+1}",
+                            modified_k,
+                            modified_theteq,
+                        ).execute()
+
             if not found:
                 logger.critical(cc1_angle)
                 raise RuntimeError("No corresponding angle in cc2 found")
@@ -2164,6 +2197,21 @@ 

Source code for transformato.mutate

 
                     original_torsion.mod_type = mod_types
 
+                    # do this only when using GAFF
+                    if type(psf) == pm.amber.AmberParm:
+                        pm.tools.actions.addDihedral(
+                            psf,
+                            f":{self.tlc_cc1}@{original_torsion.atom1.idx+1}",
+                            f":{self.tlc_cc1}@{original_torsion.atom2.idx+1}",
+                            f":{self.tlc_cc1}@{original_torsion.atom3.idx+1}",
+                            f":{self.tlc_cc1}@{original_torsion.atom4.idx+1}",
+                            modified_phi_k,
+                            torsion_t.per,
+                            torsion_t.phase,
+                            torsion_t.scnb,
+                            torsion_t.see,
+                        ).execute()
+
             if not found:
                 logger.critical(original_torsion)
                 raise RuntimeError("No corresponding torsion in cc2 found")
@@ -2180,8 +2228,11 @@ 

Source code for transformato.mutate

         lambda_value : float
             lambda_value
         """
+        try:
+            assert type(psf) == pm.charmm.CharmmPsfFile
+        except AssertionError:
+            assert type(psf) == pm.amber.AmberParm
 
-        assert type(psf) == pm.charmm.CharmmPsfFile
         if self.charge_mutation:
             logger.info(f" -- Charge parameters from cc1 are transformed to cc2.")
             logger.info(f"Lambda value:{lambda_value}")
@@ -2230,8 +2281,10 @@ 

Source code for transformato.mutate

     def _mutate_charge(
         self, psf: pm.charmm.CharmmPsfFile, lambda_value: float, offset: int
     ):
-        total_charge = int(
-            round(sum([atom.initial_charge for atom in psf.view[f":{self.tlc}"].atoms]))
+        total_charge = float(
+            round(
+                sum([atom.initial_charge for atom in psf.view[f":{self.tlc}"].atoms]), 4
+            ),
         )
         # scale the charge of all atoms
         print(f"Scaling charge on: {self.atoms_to_be_mutated}")
@@ -2244,6 +2297,16 @@ 

Source code for transformato.mutate

             atom.charge = atom.initial_charge * lambda_value
             logger.debug(f"New charge: {atom.charge}")
 
+            # in the end, we save the topology for amber (lig_in_env.parm7) using parmed
+            # pm.save_parm(), this requires all changes applied via an action tool
+            if type(psf) == pm.amber.AmberParm:
+                pm.tools.actions.change(
+                    psf,
+                    "CHARGE",
+                    f":{self.tlc}@{idx+1}",
+                    atom.initial_charge * lambda_value,
+                ).execute()
+
         # check to avoid compensating charges when doing asfe
         if (
             lambda_value != 1
@@ -2252,6 +2315,8 @@ 

Source code for transformato.mutate

             # compensate for the total change in charge the terminal atom
             self._compensate_charge(psf, total_charge, offset)
 
+
+[docs] def _mutate_vdw( self, psf: pm.charmm.CharmmPsfFile, @@ -2260,6 +2325,9 @@

Source code for transformato.mutate

         offset: int,
         to_default: bool,
     ):
+        """
+        This is used to scale the LJ parameters of the DDD and DDX atoms to zero in phase II and III
+        """
         if not set(vdw_atom_idx).issubset(set(self.atoms_to_be_mutated)):
             raise RuntimeError(
                 f"Specified atom {vdw_atom_idx} is not in atom_idx list {self.atoms_to_be_mutated}. Aborting."
@@ -2275,13 +2343,24 @@ 

Source code for transformato.mutate

                 atom_type_suffix = "DDX"
                 atom.rmin = 1.5
                 atom.epsilon = -0.15
+                # do this only when using GAFF
+                if type(psf) == pm.amber.AmberParm:
+                    assert psf[f":{self.tlc}@{atom.idx+1}"].atoms[0].name == atom.name
+                    pm.tools.actions.changeLJSingleType(
+                        psf,
+                        f":{self.tlc}@{atom.idx+1}",
+                        1.5,
+                        0.15,  ### ATTENTION: This should be -0.15 but somehow GAFF does not like negative values
+                    ).execute()
+
             else:
                 logger.info("Mutate to dummy")
                 atom_type_suffix = f"DDD"
-                self._scale_epsilon(atom, lambda_value)
-                self._scale_rmin(atom, lambda_value)
+                self._scale_epsilon_and_rmin(atom, lambda_value, psf, self.tlc)
+
             # NOTEthere is always a type change
-            self._modify_type(atom, psf, atom_type_suffix)
+            self._modify_type(atom, psf, atom_type_suffix, self.tlc)
+
[docs] @@ -2387,7 +2466,7 @@

Source code for transformato.mutate

                 connecting_real_atom_for_this_dummy_region
             )
 
-        # check if rest charge is missing
+        #### check if rest charge is missing
         new_charge = sum(
             [atom.charge for atom in psf.view[f":{self.tlc.upper()}"].atoms]
         )
@@ -2398,20 +2477,37 @@ 

Source code for transformato.mutate

             )
+
+[docs] @staticmethod - def _scale_epsilon(atom, lambda_value: float): + def _scale_epsilon_and_rmin(atom, lambda_value, psf, tlc): + """ + This scales the LJ interactions (epsilon and rmin) from non-interacting DDD atom (no charge) + to 'real' dummy atom (no LJ!), typically this is performed in one step, but to be sure + we offer scalling possibility here as well + """ logger.debug(atom) logger.debug(atom.initial_epsilon) - atom.epsilon = atom.initial_epsilon * lambda_value - - @staticmethod - def _scale_rmin(atom, lambda_value: float): - logger.debug(atom) logger.debug(atom.initial_rmin) + + atom.epsilon = atom.initial_epsilon * lambda_value atom.rmin = atom.initial_rmin * lambda_value + ### do this only when using GAFF + if type(psf) == pm.amber.AmberParm: + # Quick check, if selected atom via AMBER mask is the same as the atom + # we want to modify + assert psf[f":{tlc}@{atom.idx+1}"].atoms[0].type == atom.type + pm.tools.actions.addLJType( + psf, + f":{tlc}@{atom.idx+1}", + radius=atom.initial_rmin * lambda_value, + epsilon=atom.initial_epsilon * lambda_value, + ).execute()
+ + @staticmethod - def _modify_type(atom, psf, atom_type_suffix: str): + def _modify_type(atom, psf, atom_type_suffix, tlc): if hasattr(atom, "initial_type"): # only change parameters pass @@ -2424,7 +2520,15 @@

Source code for transformato.mutate

                 psf.mutations_to_default += 1
                 new_type = f"{atom_type_suffix}{psf.mutations_to_default}"
 
-            atom.type = new_type
+ atom.type = new_type + + if type(psf) == pm.amber.AmberParm: + pm.tools.actions.change( + psf, + "AMBER_ATOM_TYPE", + f":{tlc}@{atom.idx+1}", + new_type, + ).execute()
diff --git a/_modules/transformato/state.html b/_modules/transformato/state.html index 0ef1bc28..c302caf2 100644 --- a/_modules/transformato/state.html +++ b/_modules/transformato/state.html @@ -178,6 +178,50 @@

Source code for transformato.state

         fin.close()
         fout.close()
 
+
+[docs] + def _write_amber_files( + self, psf: pm.amber.AmberParm, output_file_base: str, tlc: str, env: str + ): + """ + Write a parm7 and rst7 file for each intermediate step, including information about the dummy atoms + """ + if env == "waterbox": + psf.write_parm(f"{output_file_base}/lig_in_{env}.parm7") + psf.write_rst7(f"{output_file_base}/lig_in_{env}.rst7") + elif env == "vacuum": + psf[f":{tlc}"].write_parm(f"{output_file_base}/lig_in_{env}.parm7") + psf[f":{tlc}"].write_rst7(f"{output_file_base}/lig_in_{env}.rst7") + ### This is only necessary, because we create the parm7 and rst7 by slicing the corresponding waterbox + ### In this case there is one flag left which tells openmm when reading in the parm7 file, that there is + ### a box (PBC). For that reason we have to manually set this flag to False (0). + lines_left = 0 + with open(f"{output_file_base}/lig_in_{env}.parm7", "r") as file: + with open( + f"{output_file_base}/lig_in_{env}_temp.parm7", "w" + ) as tempFile: + for line in file: + if line.startswith("%FLAG POINTERS"): + lines_left = 6 + if lines_left > 0: + lines_left -= 1 + if lines_left == 1: + newLine = line[:63] + "0" + line[64:] + assert ( + line.split()[7] == "1" + ) # in this position it is usually 1 indicating a box, if we change it to 0, openmm thinks there is no box (see: https://ambermd.org/FileFormats.php#topo.cntrl) + tempFile.write(newLine) + else: + tempFile.write(line) + else: + tempFile.write(line) + + shutil.move(tempFile.name, file.name) + + else: + logger.critical(f"Environment {env} not supported")
+ +
[docs] def write_state( @@ -211,7 +255,8 @@

Source code for transformato.state

             for mutation_type in mutation_conf:
                 if (
                     common_core_transformation < 1.0
-                ):  # NOTE: THis is inconsisten -- the mutatino_type is the actual mutation in this case
+                ):  # NOTE: THis is inconsistent -- the mutatino_type is the actual mutation in this case
+                    # This happens only for one ligand and starts the process of changing cc1 into cc2
                     mutation_type.mutate(
                         psf=self.system.psfs[env],
                         lambda_value=common_core_transformation,
@@ -226,7 +271,6 @@ 

Source code for transformato.state

                         atoms_to_be_mutated=mutation_type.atoms_to_be_mutated,
                         dummy_region=mutation_type.dummy_region,
                     )
-
                     mutator.mutate(
                         psf=self.system.psfs[env],
                         lambda_value_electrostatic=lambda_value_electrostatic,
@@ -234,10 +278,24 @@ 

Source code for transformato.state

                         vdw_atom_idx=mutation_type.vdw_atom_idx,
                         steric_mutation_to_default=mutation_type.steric_mutation_to_default,
                     )
-            self._write_psf(self.system.psfs[env], output_file_base, env)
-        self._write_rtf_file(self.system.psfs[env], output_file_base, self.system.tlc)
-        self._write_prm_file(self.system.psfs[env], output_file_base, self.system.tlc)
-        self._write_toppar_str(output_file_base)
+            if self.system.ff == "amber":
+                # needed for each environment
+                self._write_amber_files(
+                    self.system.psfs[env], output_file_base, self.system.tlc, env
+                )
+            elif self.system.ff == "charmm":
+                self._write_psf(self.system.psfs[env], output_file_base, env)
+
+        if self.system.ff == "charmm":
+            # needed only once per intermediate state
+            self._write_rtf_file(
+                self.system.psfs[env], output_file_base, self.system.tlc
+            )
+            self._write_prm_file(
+                self.system.psfs[env], output_file_base, self.system.tlc
+            )
+            self._write_toppar_str(output_file_base)
+
         self._copy_files(output_file_base)
 
         # Create run folder for dcd output for each intst state
@@ -265,21 +323,6 @@ 

Source code for transformato.state

         self.current_step += 1
- def _add_serializer(self, file): - # adding serializer functions - with open(file, "a") as f: - f.write( - """ -# mw: adding xml serializer to the simulation script -file_name = str(args.psffile).replace('.psf', '') -print(file_name) -with open(file_name + '_integrator.xml','w') as outfile: - outfile.write(XmlSerializer.serialize(integrator)) -with open(file_name + '_system.xml','w') as outfile: - outfile.write(XmlSerializer.serialize(system)) -""" - ) - def _get_simulations_parameters(self): prms = {} for key in self.configuration["simulation"]["parameters"]: @@ -457,7 +500,7 @@

Source code for transformato.state

             try:
                 shutil.copyfile(rst_file_source, rst_file_target)
             except FileNotFoundError:
-                logger.warning(
+                logger.info(
                     f"No restart file found for {env} -- starting simulation from crd file."
                 )
@@ -470,11 +513,11 @@

Source code for transformato.state

         fout = open(f"{shFile}.tmp", "wt")
         with open(f"{shFile}", "r+") as f:
             for line in f:
-                if line.startswith(f"input=lig_in_"):
+                if line.startswith(f"istep=lig_in_"):
                     fout.write("for i in {1.." + f"{self.multiple_runs}" + "};\n")
                     fout.write("do \n")
                     fout.write(line)
-                elif line.startswith("python -u openmm"):
+                elif line.startswith("python openmm"):
                     line = line.replace("${istep}.dcd", "run_${i}/${istep}.dcd")
                     fout.write(
                         line.replace(
@@ -577,13 +620,9 @@ 

Source code for transformato.state

 
         # copy diverse set of helper functions for openMM
         FILES = [
-            "omm_barostat.py",
             "omm_readinputs.py",
             "omm_readparams.py",
-            "omm_restraints.py",
-            "omm_rewrap.py",
             "omm_vfswitch.py",
-            "omm_hmr.py",
         ]
         for f in FILES:
             try:
@@ -594,31 +633,13 @@ 

Source code for transformato.state

                 logger.critical(f"Could not find file: {f}")
 
         # copy omm simulation script
-        # start with waterbox
         omm_simulation_script_source = f"{self.configuration['bin_dir']}/openmm_run.py"
         omm_simulation_script_target = f"{intermediate_state_file_path}/openmm_run.py"
         shutil.copyfile(omm_simulation_script_source, omm_simulation_script_target)
         # add serialization
         self._check_hmr(omm_simulation_script_target)
-        self._add_serializer(omm_simulation_script_target)
-        self._change_platform(omm_simulation_script_target)
-        check_switching_function(self.vdw_switch)
-
-        if (
-            self.configuration["simulation"]["free-energy-type"] == "rsfe"
-            or self.configuration["simulation"]["free-energy-type"] == "asfe"
-        ):
-            # add vacuum scripts
-            omm_simulation_script_source = (
-                f"{self.configuration['bin_dir']}/openmm_run_vacuum.py"
-            )
-            omm_simulation_script_target = (
-                f"{intermediate_state_file_path}/openmm_run_vacuum.py"
-            )
-            shutil.copyfile(omm_simulation_script_source, omm_simulation_script_target)
-            self._check_hmr(omm_simulation_script_target)
-            self._add_serializer(omm_simulation_script_target)
-            self._change_platform(omm_simulation_script_target)
+ # self._change_platform(omm_simulation_script_target) + check_switching_function(self.vdw_switch)
@@ -733,8 +754,10 @@

Source code for transformato.state

             self._copy_ligand_specific_str(basedir, intermediate_state_file_path)
 
         # copy crd file
-        self._copy_crd_file((intermediate_state_file_path))
-
+        try:
+            self._copy_crd_file((intermediate_state_file_path))
+        except:
+            pass
         # copy openMM and charmm specific scripts
         self._copy_omm_files(intermediate_state_file_path)
         self._copy_charmm_files(intermediate_state_file_path)
@@ -804,21 +827,27 @@

Source code for transformato.state

                         )
                         logger.critical(f"###################")
 
-        for l in input_simulation_parameter.readlines():
-            if l.strip():
-                t1, t2_comment = [e.strip() for e in l.split("=")]
-                t2, comment = [e.strip() for e in t2_comment.split("#")]
-                comment = comment.strip()
-                if t1 in overwrite_parameters.keys():
-                    t2 = overwrite_parameters[t1]
-                    del overwrite_parameters[t1]  # remove from dict
-                if t1 == "vdw":
-                    t2 = t2.capitalize()
-                output_simulation_parameter.write(
-                    f"{t1:<25} = {t2:<25} # {comment:<30}\n"
-                )
-            else:
-                output_simulation_parameter.write("\n")
+        try:
+            for l in input_simulation_parameter.readlines():
+                if l.strip():
+                    t1, t2_comment = [e.strip() for e in l.split("=")]
+                    t2, comment = [e.strip() for e in t2_comment.split("#")]
+                    comment = comment.strip()
+                    if t1 in overwrite_parameters.keys():
+                        t2 = overwrite_parameters[t1]
+                        del overwrite_parameters[t1]  # remove from dict
+                    if t1 == "vdw":
+                        t2 = t2.capitalize()
+                    output_simulation_parameter.write(
+                        f"{t1:<25} = {t2:<25} # {comment:<30}\n"
+                    )
+                else:
+                    output_simulation_parameter.write("\n")
+        except ValueError:
+            logger.critical(
+                f"The original inp {input_simulation_parameter.name} file  contains a line without a comment "
+            )
+            raise SystemExit
 
         # set parameters that have no equivalent in the pregenerated parameter file
         for t1 in overwrite_parameters.keys():
diff --git a/_modules/transformato/system.html b/_modules/transformato/system.html
index fcb84e69..229305c9 100644
--- a/_modules/transformato/system.html
+++ b/_modules/transformato/system.html
@@ -115,11 +115,20 @@ 

Source code for transformato.system

         self.name: str = configuration["system"][structure]["name"]
         self.tlc: str = configuration["system"][structure]["tlc"]
         self.charmm_gui_base: str = configuration["system"][structure]["charmm_gui_dir"]
-        self.psfs: defaultdict = defaultdict(pm.charmm.CharmmPsfFile)
         self.offset: defaultdict = defaultdict(int)
-        self.parameter = self._read_parameters("waterbox")
-        self.cgenff_version: float
         self.envs = set()
+
+        try:
+            self.ff: str = str.lower(configuration["simulation"]["forcefield"])
+            self.psfs: defaultdict = defaultdict(pm.amber.AmberParm)
+        except KeyError:
+            self.ff: str = "charmm"
+            self.psfs: defaultdict = defaultdict(pm.charmm.CharmmPsfFile)
+            self.parameter = self._read_parameters(
+                "waterbox"
+            )  # not sure if this is really needed
+            self.cgenff_version: float
+
         # running a binding-free energy calculation?
         if configuration["simulation"]["free-energy-type"] == "rbfe":
             self.envs = set(["complex", "waterbox"])
@@ -148,17 +157,32 @@ 

Source code for transformato.system

         ):
             self.envs = set(["waterbox", "vacuum"])
             for env in self.envs:
-                parameter = self._read_parameters(env)
-                # set up system
-                self.psfs[env] = self._initialize_system(configuration, env)
-                # load parameters
-                self.psfs[env].load_parameters(parameter)
-                # get offset
-                self.offset[
-                    env
-                ] = self._determine_offset_and_set_possible_dummy_properties(
-                    self.psfs[env]
-                )
+                if self.ff == "charmm":
+                    parameter = self._read_parameters(env)
+                    # set up system
+                    self.psfs[env] = self._initialize_system(configuration, env)
+                    # load parameters
+                    self.psfs[env].load_parameters(parameter)
+                    self.offset[
+                        env
+                    ] = self._determine_offset_and_set_possible_dummy_properties(
+                        self.psfs[env]
+                    )
+
+                elif self.ff == "amber":
+                    self.psfs[env] = pm.load_file(
+                        f"{self.charmm_gui_base}/waterbox/openmm/step3_input.parm7"
+                    )
+                    self.psfs[env].load_rst7(
+                        f"{self.charmm_gui_base}/waterbox/openmm/step3_input.rst7"
+                    )
+                    self.offset[
+                        env
+                    ] = self._determine_offset_and_set_possible_dummy_properties(
+                        self.psfs[env]
+                    )
+                    # if env == "vacuum":
+                    #     self.psfs["vacuum"] = self.psfs["waterbox"][f":{self.tlc}"]
 
             # generate rdkit mol object of small molecule
             self.mol: Chem.Mol = self._generate_rdkit_mol(
@@ -269,7 +293,7 @@ 

Source code for transformato.system

                 )
 
         # check cgenff versions
-        if parameter_files:
+        if parameter_files and self.ff == "charmm":
             with open(parameter_files[0]) as f:
                 _ = f.readline()
                 cgenff = f.readline().rstrip()
@@ -392,7 +416,11 @@ 

Source code for transformato.system

         Returns
         ----------
         """
-        assert type(psf) == pm.charmm.CharmmPsfFile
+        if self.ff == "amber":
+            assert type(psf) == pm.amber._amberparm.AmberParm
+        else:
+            assert type(psf) == pm.charmm.CharmmPsfFile
+
         if len(psf.view[f":{self.tlc}"].atoms) < 1:
             raise RuntimeError(f"No ligand selected for tlc: {self.tlc}")
 
@@ -462,7 +490,6 @@ 

Source code for transformato.system

         mol: rdkit.Chem.rdchem.Mol
         """
 
-        assert type(psf) == pm.charmm.CharmmPsfFile
         mol = self._return_small_molecule(env)
         (
             atom_idx_to_atom_name,
@@ -483,11 +510,12 @@ 

Source code for transformato.system

             )
 
         # check if psf and sdf have same indeces
-        for a in mol.GetAtoms():
-            if str(psf[a.GetIdx()].element_name) == str(a.GetSymbol()):
-                pass
-            else:
-                raise RuntimeError("PSF to mol conversion did not work! Aborting.")
+        # if self.ff == "charmm":
+        #     for a in mol.GetAtoms():
+        #         if str(psf[a.GetIdx()].element_name) == str(a.GetSymbol()):
+        #             pass
+        #         else:
+        #             raise RuntimeError("PSF to mol conversion did not work! Aborting.")
 
         return mol
diff --git a/autosummary/transformato.mutate.html b/autosummary/transformato.mutate.html index 9c64fbc8..693f6cfa 100644 --- a/autosummary/transformato.mutate.html +++ b/autosummary/transformato.mutate.html @@ -331,6 +331,31 @@

Description +
+_mutate_vdw(psf, lambda_value, vdw_atom_idx, offset, to_default)[source]
+

This is used to scale the LJ parameters of the DDD and DDX atoms to zero in phase II and III

+
+
Parameters:
+
    +
  • psf (CharmmPsfFile) –

  • +
  • lambda_value (float) –

  • +
  • vdw_atom_idx (List[int]) –

  • +
  • offset (int) –

  • +
  • to_default (bool) –

  • +
+
+
+
+ +
+
+static _scale_epsilon_and_rmin(atom, lambda_value, psf, tlc)[source]
+

This scales the LJ interactions (epsilon and rmin) from non-interacting DDD atom (no charge) +to ‘real’ dummy atom (no LJ!), typically this is performed in one step, but to be sure +we offer scalling possibility here as well

+
+
mutate(psf, lambda_value_electrostatic=1.0, lambda_value_vdw=1.0, vdw_atom_idx=[], steric_mutation_to_default=False)[source]
diff --git a/autosummary/transformato.state.html b/autosummary/transformato.state.html index aa7fa755..cd5d6a93 100644 --- a/autosummary/transformato.state.html +++ b/autosummary/transformato.state.html @@ -220,6 +220,22 @@

Description +
+_write_amber_files(psf, output_file_base, tlc, env)[source]
+

Write a parm7 and rst7 file for each intermediate step, including information about the dummy atoms

+
+
Parameters:
+
    +
  • psf (AmberParm) –

  • +
  • output_file_base (str) –

  • +
  • tlc (str) –

  • +
  • env (str) –

  • +
+
+
+

+
static _write_psf(psf, output_file_base, env)[source]
diff --git a/genindex.html b/genindex.html index 00999709..e1b5bf49 100644 --- a/genindex.html +++ b/genindex.html @@ -194,12 +194,12 @@

_

  • _check_for_lp() (transformato.mutate.ProposeMutationRoute method)
  • - - +