diff --git a/transformato/state.py b/transformato/state.py index dd88900e..deee1a00 100644 --- a/transformato/state.py +++ b/transformato/state.py @@ -627,17 +627,23 @@ def _change_platform(self, file): def _copy_ligand_specific_top_and_par( self, basedir: str, intermediate_state_file_path: str ): - # copy ligand rtf file - ligand_rtf = f"{basedir}/waterbox/{self.system.tlc.lower()}/{self.system.tlc.lower()}_g.rtf" - toppar_target = ( - f"{intermediate_state_file_path}/{self.system.tlc.lower()}_g.rtf" - ) - shutil.copyfile(ligand_rtf, toppar_target) + # If the tlc is no name, we assume that there is no str/rtf file (as for point mutations in RNAs) + if len(self.system.tlc) > 3: + # copy ligand rtf file + ligand_rtf = f"{basedir}/waterbox/{self.system.tlc.lower()}/{self.system.tlc.lower()}_g.rtf" + toppar_target = ( + f"{intermediate_state_file_path}/{self.system.tlc.lower()}_g.rtf" + ) + shutil.copyfile(ligand_rtf, toppar_target) - # copy ligand prm file - ligand_prm = f"{basedir}/waterbox/{self.system.tlc.lower()}/{self.system.tlc.lower()}.prm" - toppar_target = f"{intermediate_state_file_path}/{self.system.tlc.lower()}.prm" - shutil.copyfile(ligand_prm, toppar_target) + # copy ligand prm file + ligand_prm = f"{basedir}/waterbox/{self.system.tlc.lower()}/{self.system.tlc.lower()}.prm" + toppar_target = ( + f"{intermediate_state_file_path}/{self.system.tlc.lower()}.prm" + ) + shutil.copyfile(ligand_prm, toppar_target) + else: + pass def _copy_ligand_specific_str( self, basedir: str, intermediate_state_file_path: str @@ -1106,6 +1112,7 @@ def _write_toppar_str(self, output_file_base): ../../toppar/toppar_all36_lipid_model.str ../../toppar/toppar_all36_lipid_prot.str ../../toppar/toppar_all36_lipid_sphingo.str +../../toppar/toppar_all36_na_rna_modified.str """ if os.path.isfile( f"{self.system.charmm_gui_base}/waterbox/{self.system.tlc.lower()}/{self.system.tlc.lower()}_g.rtf" @@ -1115,10 +1122,15 @@ def _write_toppar_str(self, output_file_base): dummy_atom_definitions.rtf dummy_parameters.prm """ - else: + elif len(self.system.tlc) > 3: toppar_format += f"""{self.system.tlc.lower()}.str dummy_atom_definitions.rtf dummy_parameters.prm +""" + else: + toppar_format += f""" +dummy_atom_definitions.rtf +dummy_parameters.prm """ f = open(f"{output_file_base}/toppar.str", "w+") diff --git a/transformato/system.py b/transformato/system.py index f000c38f..1ee5a91a 100644 --- a/transformato/system.py +++ b/transformato/system.py @@ -240,6 +240,7 @@ def _read_parameters(self, env: str) -> pm.charmm.CharmmParameterSet: parameter_files += ( f"{toppar_dir}/toppar_all36_prot_na_combined.str", ) # if modified aminoacids are needed + parameter_files += (f"{toppar_dir}/toppar_all36_na_rna_modified.str",) if os.path.isfile(f"{toppar_dir}/toppar_all36_moreions.str"): parameter_files += (f"{toppar_dir}/toppar_all36_moreions.str",) # set up parameter objec