diff --git a/devtools/conda/meta.yaml b/devtools/conda/meta.yaml index e858c968..f5e73c09 100644 --- a/devtools/conda/meta.yaml +++ b/devtools/conda/meta.yaml @@ -26,7 +26,7 @@ requirements: - networkx - rdkit - ambertools - - openforcefield==0.8.0 + - openforcefield==0.8.3 about: home: https://github.com/martimunicoy/peleffy diff --git a/devtools/envs/standard.yaml b/devtools/envs/standard.yaml index 725992d4..a247706a 100644 --- a/devtools/envs/standard.yaml +++ b/devtools/envs/standard.yaml @@ -13,4 +13,4 @@ dependencies: - coverage < 5.0 - ambertools - rdkit - - openforcefield ==0.8.0 + - openforcefield ==0.8.3 diff --git a/docs/index.rst b/docs/index.rst index 2382785b..85311cd9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,6 +7,8 @@ are: * The following force field from the `Open Force Field toolkit `_: + * openff_unconstrained-1.3.0.offxml + * openff_unconstrained-1.2.1.offxml * openff_unconstrained-1.2.0.offxml diff --git a/docs/releasehistory.rst b/docs/releasehistory.rst index f0497883..396038dc 100644 --- a/docs/releasehistory.rst +++ b/docs/releasehistory.rst @@ -7,8 +7,32 @@ Releases follow the ``major.minor.micro`` scheme recommended by `PEP440 `_: New method to assign external partial charges. +- `PR #118 `_: New method to load parameters from an Impact Template. +- `PR #119 `_: Adds explanatory error message when using an invalid Impact Template in the from_impact_template method. +- `PR #119 `_: Supports Openforcefield-0.8.3 . +- `PR #126 `_: Allows the Solvent class to be compatible with multiple topologies. + +Bugfixes +"""""""" +- `PR #125 `_: A bad index slicing in the molecule.Molecule._pdb_checkup() is now fixed. + +Tests added +""""""""""" +- `PR #117 `_: Adds tests to validate the MAE parse for external partial charges. +- `PR #118 `_: Adds tests to validate the new method to load parameters from an Impact Template. +- `PR #119 `_: Adds tests for the new error message when using an invalid Impact Template in the from_impact_template method. +- `PR #126 `_: Adds tests for the new compatibility of the Solvent class with multiple topologies. + + +1.1.0 - Improvements in parameterization API, OBC template for OPLS2005 and Molecule initializators --------------------------------------------------------------------------------------------------- This minor release introduces improvements to the parameterization API of peleffy. It also integrates the parameterization of OBC radii and scale factors required by the OPLS2005 implementation of PELE. It also improves the initialization of the Molecule class with a PDB checking and fixer and taking RDKit and OpenFF molecular representations as input. It also adds support for the new openff-1.3.0. Besides, it fixes a serious bug in the atom ordering of the Impact template that affected PELE's side chain prediction algorithm. diff --git a/docs/usage.rst b/docs/usage.rst index 30243d53..76ed91c9 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -206,6 +206,19 @@ It sets the method to compute the partial charges. $ python -m peleffy.main path/to/my_ligand.pdb -c gasteiger +Charge from file +---------------- +It sets the method to load external partial charges. + +- Flag: ``--charges_from_file PATH`` +- Type: ``string`` +- Default: ``None`` +- Example: the code below will load the partial charges from a MAE file + + .. code-block:: bash + + $ python -m peleffy.main path/to/my_ligand.pdb --charges_from_file path/to/my_ligand.mae + Include terminal rotamers ------------------------- It always includes terminal rotamers, even if they belong to a terminal methyl group whose rotation is trivial in PELE. diff --git a/examples/OFF_parameterization/parameterize.ipynb b/examples/OFF_parameterization/parameterize.ipynb index 6fc1214b..15fa6b69 100644 --- a/examples/OFF_parameterization/parameterize.ipynb +++ b/examples/OFF_parameterization/parameterize.ipynb @@ -590,6 +590,289 @@ "solvent = OBC2(topology)\n", "solvent.to_file('ligandParams.txt')" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4: BHP\n", + "This example shows how to load and parameterize the phosphine-borane molecule with `peleffy` assigning the partial charges from an external file." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Load required files for this test" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "from peleffy.utils import get_data_file_path\n", + "BHP_pdb_path = get_data_file_path('ligands/BHP.pdb')\n", + "BHP_mae_path = get_data_file_path('ligands/BHP.mae')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Load `peleffy`'s molecule representation with a PDB file of BHP" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "from peleffy.topology import Molecule" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + " - Initializing molecule from PDB\n", + " - Loading molecule from RDKit\n", + " - Assigning stereochemistry from 3D coordinates\n", + " - Setting molecule name to 'BHP'\n", + " - Setting molecule tag to 'BHP'\n", + " - Representing molecule with the Open Force Field Toolkit\n", + " - Generating rotamer library\n", + " - Core set to the center of the molecule\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + " \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "molecule = Molecule(BHP_pdb_path)\n", + "display(molecule)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Generate the Rotamer library file\n", + "We are generating the Rotamer library and saving it to a file named __BHP.rot.assign__." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "from peleffy.topology import RotamerLibrary" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "rotamer_library = RotamerLibrary(molecule)\n", + "rotamer_library.to_file('BHP.rot.assign')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Parameterize with Open Force Field Toolkit and generate the Impact template\n", + "We parameterize the `Molecule`, using the __openff_unconstrained-1.2.0.offxml__ force field. However, in this case, instead of computing partial charges they are assigned from an extarnal file coming from external suites such as Jaguar. A __mae__ file with charges information is requiered. \n", + "\n", + "Then, the Impact template, named __bhpz__, is generated." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "from peleffy.forcefield import OpenForceField\n", + "from peleffy.topology import Topology\n", + "from peleffy.template import Impact" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "from peleffy.utils import parse_charges_from_mae" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [], + "source": [ + "openff = OpenForceField('openff_unconstrained-1.2.0.offxml')\n", + "parameters = openff.parameterize(molecule, charge_method='dummy')\n", + "parameters = parse_charges_from_mae(BHP_mae_path, parameters)" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "topology = Topology(molecule, parameters)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "impact = Impact(topology)\n", + "impact.to_file('bhpz')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Generate the Solvent parameters file\n", + "We generate the OBC2 Solvent parameters file, named ligandParams.txt." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "from peleffy.solvent import OBC2" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + " - Generating solvent parameters\n" + ] + } + ], + "source": [ + "solvent = OBC2(topology)\n", + "solvent.to_file('ligandParams.txt')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/examples/molecular_representations/benzamidine_representation.ipynb b/examples/molecular_representations/benzamidine_representation.ipynb new file mode 100644 index 00000000..a6855691 --- /dev/null +++ b/examples/molecular_representations/benzamidine_representation.ipynb @@ -0,0 +1,145 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Benzamidine representation\n", + "This notebook checks that the molecular representation of benzamidine (problematic compound according to one RDKit's [issue](https://github.com/rdkit/rdkit/issues/1031)) is of correct type." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from peleffy.topology import Molecule\n", + "from peleffy.utils import get_data_file_path" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + " - Initializing molecule from PDB\n", + " - Loading molecule from RDKit\n", + " - Assigning stereochemistry from 3D coordinates\n", + " - Setting molecule name to 'benzamidine'\n", + " - Setting molecule tag to 'BEN'\n", + " - Representing molecule with the Open Force Field Toolkit\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f962e6415594449fbfad0b728d1b3cb8", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + " - Generating rotamer library\n", + " - Core set to the center of the molecule\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + " \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "m = Molecule(get_data_file_path('ligands/benzamidine.pdb'))\n", + "display(m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As long as the input PDB file has the connectivity properly assigned, the molecular representation obtained by RDKit in peleffy is valid." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.8" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/peleffy/data/ligands/BHP.mae b/peleffy/data/ligands/BHP.mae new file mode 100644 index 00000000..95633945 --- /dev/null +++ b/peleffy/data/ligands/BHP.mae @@ -0,0 +1,452 @@ +{ + s_m_m2io_version + ::: + 2.0.0 +} + +f_m_ct { + s_m_title + s_m_entry_id + s_m_entry_name + s_m_Source_Path + s_m_Source_File + i_m_Source_File_Index + i_m_Spin_multiplicity + s_j_Task + s_j_Jaguar_input_file + s_j_Jaguar_restart_input_file + s_j_Jaguar_restart_mae_file + s_j_Jaguar_output_file + s_j_Jaguar_log_file + s_j_Jaguar_mae_file + s_j_QM_Method + s_j_QM_Basis + i_j_Number_of_canonical_orbitals + r_j_Gas_Phase_Energy + r_j_HOMO + r_j_LUMO + s_m_job_name + i_sd_PUBCHEM\_COMPOUND\_CID + r_sd_PUBCHEM\_CONFORMER\_RMSD + s_sd_PUBCHEM\_CONFORMER\_DIVERSEORDER + s_sd_PUBCHEM\_MMFF94\_PARTIAL\_CHARGES + i_sd_PUBCHEM\_EFFECTIVE\_ROTOR\_COUNT + s_sd_PUBCHEM\_PHARMACOPHORE\_FEATURES + i_sd_PUBCHEM\_HEAVY\_ATOM\_COUNT + i_sd_PUBCHEM\_ATOM\_DEF\_STEREO\_COUNT + i_sd_PUBCHEM\_ATOM\_UDEF\_STEREO\_COUNT + i_sd_PUBCHEM\_BOND\_DEF\_STEREO\_COUNT + i_sd_PUBCHEM\_BOND\_UDEF\_STEREO\_COUNT + i_sd_PUBCHEM\_ISOTOPIC\_ATOM\_COUNT + i_sd_PUBCHEM\_COMPONENT\_COUNT + i_sd_PUBCHEM\_CACTVS\_TAUTO\_COUNT + r_sd_PUBCHEM\_CONFORMER\_ID + r_sd_PUBCHEM\_MMFF94\_ENERGY + r_sd_PUBCHEM\_FEATURE\_SELFOVERLAP + s_sd_PUBCHEM\_SHAPE\_FINGERPRINT + s_sd_PUBCHEM\_SHAPE\_MULTIPOLES + r_sd_PUBCHEM\_SHAPE\_SELFOVERLAP + r_sd_PUBCHEM\_SHAPE\_VOLUME + s_sd_PUBCHEM\_COORDINATE\_TYPE + b_sd_chiral_flag + i_sd_version + s_st_Chirality_1 + i_m_ct_enhanced_stereo_status + s_m_subgroup_title + s_m_subgroupid + b_m_subgroup_collapsed + i_m_ct_format + ::: + BHP + 38 + Conformer3D_CID_9992574.1 + /home/home/sergiroda/Documents/LAE5_project/BHPP + BHPP.mae + 1 + 1 + "Single Point" + /home/alma/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2.in + /home/alma/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2.01.in + /home/alma/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2.01.mae + /home/alma/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2.out + /home/alma/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2.log + /home/alma/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2/jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2.mae + DFT(b3lyp-d3) + cc-pvtz + 781 + -845.346984400771 + -0.247480727714395 + -0.0312438417389906 + jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_2 + 9992574 + 0.8 + "1 +48 +11 +37 +20 +101 +76 +5 +108 +82 +69 +35 +89 +107 +43 +12 +93 +86 +49 +68 +42 +56 +88 +55 +79 +50 +4 +52 +13 +66 +45 +95 +27 +7 +16 +24 +59 +8 +73 +106 +17 +87 +10 +36 +105 +28 +2 +29 +40 +104 +63 +94 +96 +67 +103 +65 +41 +54 +3 +83 +72 +71 +22 +33 +97 +99 +6 +64 +39 +80 +51 +90 +74 +60 +58 +85 +92 +15 +21 +18 +46 +61 +9 +34 +25 +91 +32 +100 +70 +102 +38 +53 +81 +30 +84 +19 +26 +14 +77 +57 +62 +44 +75 +23 +47 +78 +98 +31" + "30 +1 -0.43 +10 0.42 +11 -0.14 +12 -0.15 +13 -0.15 +14 -0.15 +15 -0.15 +16 -0.15 +17 -0.15 +18 -0.15 +19 -0.15 +2 -0.68 +23 0.15 +24 0.15 +27 0.15 +28 0.15 +29 0.4 +3 -0.57 +30 0.15 +31 0.15 +32 0.15 +33 0.15 +34 0.15 +35 0.15 +4 0.14 +5 0.34 +6 -0.14 +7 0.66 +8 -0.15 +9 -0.15" + 6 + "5 +1 2 acceptor +1 2 donor +1 3 acceptor +6 11 15 16 17 18 19 rings +6 6 8 9 12 13 14 rings" + 19 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 987970 + 39.8082 + 25.38 + "10498660 4 18342745151926713408 +10670039 82 18336558131415248884 +10928967 22 9727636132838798420 +11405975 8 18334574633903092626 +12173636 292 18411979191103413791 +12390115 104 18339095868117131715 +12596602 18 17313101994437249977 +12633257 1 15864075407464067032 +12788726 201 17681843139123945178 +13590594 115 17474963021260540330 +13828863 39 14420420012012480838 +13887833 79 15625950793744188728 +13965767 371 17968370148593990252 +1420 369 8934997066344951324 +14251757 17 17346874554935998368 +14251764 75 18337966652580484992 +14468879 13 18060145361535215823 +14739800 52 18270099310757339424 +14767858 380 18268975623096277279 +14840074 17 17531258287201624492 +14848178 96 18411982421008250440 +15342168 16 18335423418161148341 +15342816 4 9727631730855295010 +15885798 251 9151173151388630586 +1741750 31 18409448119910711306 +17810953 82 18336548192396669188 +17834072 32 18336830878743736548 +1798214 55 18410293592680708852 +18222031 100 8142079866607103905 +18785283 64 18190459359685459938 +204376 136 18333733498790892735 +22182937 141 18410862100221519633 +22950370 63 9511458948240325017 +23227448 37 18341330088930309477 +235170 7 16200432463735462989 +23557571 272 18268163126214830958 +23559900 14 18127690431030573150 +245318 6 17823435952883370076 +341906 21 18338512053755892544 +3472631 163 18201719518600472845 +3680242 22 18335981978431588240 +474 4 18334577901966515975 +5104073 3 18261114032868159491 +6328613 192 18334019419834273508 +633830 44 18341891827660989527 +67856867 119 18266169531392700467 +7064713 232 18334293180042294972 +76465 3 9583518706989223462 +7808743 9 18337673147895821432 +7970288 3 9511464415929839636 +960060 61 12031779284253631160 +9981440 41 18408319999458564419" + "373.4 +12.27 +3 +1.02 +0.31 +1.31 +0.06 +-10 +-0.13 +-0.7 +-0.39 +0.97 +-0.29 +-0.5" + 788.099 + 208.6 + "2 +5 +10" + 1 + 0 + 5_R_2_7_4_22 + 0 + jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_21 + jag_gamma-valerolactone_spe_B3LYP-D3_CC-PVTZ_211 + 0 + 2 + m_depend[16] { + # First column is dependency index # + i_m_depend_dependency + s_m_depend_property + ::: + 1 20 i_m_Spin_multiplicity + 2 20 s_j_Task + 3 20 s_j_Jaguar_input_file + 4 20 s_j_Jaguar_restart_input_file + 5 20 s_j_Jaguar_restart_mae_file + 6 20 s_j_Jaguar_output_file + 7 20 s_j_Jaguar_log_file + 8 20 s_j_Jaguar_mae_file + 9 20 s_j_QM_Method + 10 20 s_j_QM_Basis + 11 20 i_j_Number_of_canonical_orbitals + 12 20 r_j_Gas_Phase_Energy + 13 20 r_j_HOMO + 14 20 r_j_LUMO + 15 30 s_m_job_name + 16 10 s_st_Chirality_1 + ::: + } + m_atom[35] { + # First column is atom index # + i_m_mmod_type + r_m_x_coord + r_m_y_coord + r_m_z_coord + i_m_residue_number + s_m_chain_name + i_m_color + r_m_charge1 + r_m_charge2 + s_m_pdb_residue_name + s_m_pdb_atom_name + i_m_atomic_number + s_m_color_rgb + s_m_atom_name + s_m_label_format + i_m_label_color + s_m_label_user_text + r_j_ESP_Charges + i_m_atom_chirality + i_m_bond_stereo + i_m_minimize_atom_index + s_bioluminate_saved_label_format + i_sd_original_parity + ::: + 1 16 1.082246 -1.164428 0.187051 1 L 16 -0.35703 -0.35703 "BHP " " O1 " 8 E11E1E O1 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.357030509013447 0 10 1 "" <> + 2 16 -2.289677 -2.551950 0.410570 1 L 16 -0.59535 -0.59535 "BHP " " O2 " 8 E11E1E O2 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.595354552354532 0 10 2 "" <> + 3 15 0.328148 -3.315381 -0.065134 1 L 16 -0.50292 -0.50292 "BHP " " O3 " 8 E11E1E O3 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.502920604123228 0 10 3 "" <> + 4 3 -1.683347 -0.534890 -0.776190 1 L 10 -0.25243 -0.25243 "BHP " " C1 " 6 1EE11E C4 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.252432508745142 0 10 4 "" <> + 5 3 -1.295879 -1.524738 0.344510 1 L 10 0.30438 0.30438 "BHP " " C2 " 6 1EE11E C5 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.30437714992254 1 10 5 "" 2 + 6 2 -2.839729 0.368631 -0.380423 1 L 10 0.22092 0.22092 "BHP " " C3 " 6 1EE11E C6 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.220923341075242 0 10 6 "" <> + 7 2 0.124865 -2.116773 0.147366 1 L 10 0.54336 0.54336 "BHP " " C4 " 6 1EE11E C7 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.543358319602461 0 10 7 "" <> + 8 2 -4.157224 -0.047375 -0.594782 1 L 10 -0.20569 -0.20569 "BHP " " C5 " 6 1EE11E C8 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.20569458863582 0 10 8 "" <> + 9 2 -2.578247 1.603649 0.216813 1 L 10 -0.20192 -0.20192 "BHP " " C6 " 6 1EE11E C9 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.201917063920989 0 10 9 "" <> + 10 3 2.441218 -1.485246 -0.088292 1 L 10 0.16631 0.16631 "BHP " " C7 " 6 1EE11E C10 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.166314921392934 0 10 10 "" <> + 11 2 3.279778 -0.218135 -0.059328 1 L 10 0.02422 0.02422 "BHP " " C8 " 6 1EE11E C11 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.0242204498783285 0 10 11 "" <> + 12 2 -5.212396 0.783014 -0.225826 1 L 10 -0.09115 -0.09115 "BHP " " C9 " 6 1EE11E C12 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.0911502129276023 0 10 12 "" <> + 13 2 -3.633828 2.433091 0.585359 1 L 10 -0.09904 -0.09904 "BHP " " C10" 6 1EE11E C13 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.0990379734219864 0 10 13 "" <> + 14 2 -4.947758 2.020255 0.358908 1 L 10 -0.15673 -0.15673 "BHP " " C11" 6 1EE11E C14 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.156731451023703 0 10 14 "" <> + 15 2 3.510163 0.502162 -1.236320 1 L 10 -0.13245 -0.13245 "BHP " " C12" 6 1EE11E C15 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.132448267464731 0 10 15 "" <> + 16 2 3.847981 0.201531 1.145746 1 L 10 -0.17806 -0.17806 "BHP " " C13" 6 1EE11E C16 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.178062756672596 0 10 16 "" <> + 17 2 4.319732 1.636025 -1.206906 1 L 10 -0.12489 -0.12489 "BHP " " C14" 6 1EE11E C17 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.124888851194865 0 10 17 "" <> + 18 2 4.657453 1.333948 1.174256 1 L 10 -0.09307 -0.09307 "BHP " " C15" 6 1EE11E C18 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.093067562500934 0 10 18 "" <> + 19 2 4.893442 2.045702 -0.002445 1 L 10 -0.08973 -0.08973 "BHP " " C16" 6 1EE11E C19 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" -0.0897265949087118 0 10 19 "" <> + 20 41 -0.842372 0.105196 -1.054289 1 L 21 0.05397 0.05397 "BHP " " H1 " 1 FFFFFF H20 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.0539678458608934 0 10 20 "" <> + 21 41 -1.934996 -1.073994 -1.691275 1 L 21 0.07338 0.07338 "BHP " " H2 " 1 FFFFFF H21 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.0733751245441545 0 10 21 "" <> + 22 41 -1.284639 -0.998810 1.301168 1 L 21 0.04514 0.04514 "BHP " " H3 " 1 FFFFFF H22 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.0451373736804906 0 10 22 "" <> + 23 41 -4.357314 -1.017283 -1.024555 1 L 21 0.12979 0.12979 "BHP " " H4 " 1 FFFFFF H23 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.129786256204015 0 10 23 "" <> + 24 41 -1.560889 1.917222 0.403192 1 L 21 0.11025 0.11025 "BHP " " H5 " 1 FFFFFF H24 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.110246762459741 0 10 24 "" <> + 25 41 2.543089 -1.959372 -1.063694 1 L 21 0.04054 0.04054 "BHP " " H6 " 1 FFFFFF H25 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.0405425094521452 0 10 25 "" <> + 26 41 2.825567 -2.192587 0.645431 1 L 21 0.04581 0.04581 "BHP " " H7 " 1 FFFFFF H26 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.0458137470605686 0 10 26 "" <> + 27 41 -6.230511 0.459404 -0.382777 1 L 21 0.11444 0.11444 "BHP " " H8 " 1 FFFFFF H27 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.114439454734196 0 10 27 "" <> + 28 41 -3.434239 3.385202 1.050541 1 L 21 0.11761 0.11761 "BHP " " H9 " 1 FFFFFF H28 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.117607691364182 0 10 28 "" <> + 29 42 -2.185076 -3.147327 -0.340386 1 L 21 0.37274 0.37274 "BHP " " H10" 1 FFFFFF H29 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.37274163202657 0 10 29 "" <> + 30 41 -5.766827 2.659891 0.653532 1 L 21 0.11825 0.11825 "BHP " " H11" 1 FFFFFF H30 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.118254468540995 0 10 30 "" <> + 31 41 3.067505 0.188312 -2.169197 1 L 21 0.12584 0.12584 "BHP " " H12" 1 FFFFFF H31 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.125844241612749 0 10 31 "" <> + 32 41 3.661643 -0.348493 2.054974 1 L 21 0.13810 0.13810 "BHP " " H13" 1 FFFFFF H32 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.13809821271347 0 10 32 "" <> + 33 41 4.508034 2.194613 -2.111727 1 L 21 0.11696 0.11696 "BHP " " H14" 1 FFFFFF H33 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.116961339538331 0 10 33 "" <> + 34 41 5.103758 1.656881 2.102431 1 L 21 0.11148 0.11148 "BHP " " H15" 1 FFFFFF H34 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.111484203218553 0 10 34 "" <> + 35 41 5.529525 2.922553 0.020097 1 L 21 0.10697 0.10697 "BHP " " H16" 1 FFFFFF H35 "%UA:r_j_ESP_Charges:%ST%CY %FC" 2 "" 0.106968452025727 0 10 35 "" <> + ::: + } + m_bond[36] { + # First column is bond index # + i_m_from + i_m_to + i_m_order + i_m_from_rep + i_m_to_rep + ::: + 1 1 7 1 2 2 + 2 1 10 1 2 2 + 3 2 5 1 2 2 + 4 2 29 1 2 2 + 5 3 7 2 2 2 + 6 4 5 1 2 2 + 7 4 6 1 2 2 + 8 4 20 1 2 2 + 9 4 21 1 2 2 + 10 5 7 1 2 2 + 11 5 22 1 2 2 + 12 6 8 2 2 2 + 13 6 9 1 2 2 + 14 8 12 1 2 2 + 15 8 23 1 2 2 + 16 9 13 2 2 2 + 17 9 24 1 2 2 + 18 10 11 1 2 2 + 19 10 25 1 2 2 + 20 10 26 1 2 2 + 21 11 15 2 2 2 + 22 11 16 1 2 2 + 23 12 14 2 2 2 + 24 12 27 1 2 2 + 25 13 14 1 2 2 + 26 13 28 1 2 2 + 27 14 30 1 2 2 + 28 15 17 1 2 2 + 29 15 31 1 2 2 + 30 16 18 2 2 2 + 31 16 32 1 2 2 + 32 17 19 2 2 2 + 33 17 33 1 2 2 + 34 18 19 1 2 2 + 35 18 34 1 2 2 + 36 19 35 1 2 2 + ::: + } +} + diff --git a/peleffy/data/ligands/BHP.pdb b/peleffy/data/ligands/BHP.pdb new file mode 100644 index 00000000..c59044d4 --- /dev/null +++ b/peleffy/data/ligands/BHP.pdb @@ -0,0 +1,89 @@ +TITLE BHP +REMARK 4 COMPLIES WITH FORMAT V. 3.0, 1-DEC-2006 +REMARK 888 +REMARK 888 WRITTEN BY MAESTRO (A PRODUCT OF SCHRODINGER, LLC) +HETATM 1 O1 BHP L 1 1.082 -1.164 0.187 1.00 0.00 O +HETATM 2 O2 BHP L 1 -2.290 -2.552 0.411 1.00 0.00 O +HETATM 3 O3 BHP L 1 0.328 -3.315 -0.065 1.00 0.00 O +HETATM 4 C1 BHP L 1 -1.683 -0.535 -0.776 1.00 0.00 C +HETATM 5 C2 BHP L 1 -1.296 -1.525 0.345 1.00 0.00 C +HETATM 6 C3 BHP L 1 -2.840 0.369 -0.380 1.00 0.00 C +HETATM 7 C4 BHP L 1 0.125 -2.117 0.147 1.00 0.00 C +HETATM 8 C5 BHP L 1 -4.157 -0.047 -0.595 1.00 0.00 C +HETATM 9 C6 BHP L 1 -2.578 1.604 0.217 1.00 0.00 C +HETATM 10 C7 BHP L 1 2.441 -1.485 -0.088 1.00 0.00 C +HETATM 11 C8 BHP L 1 3.280 -0.218 -0.059 1.00 0.00 C +HETATM 12 C9 BHP L 1 -5.212 0.783 -0.226 1.00 0.00 C +HETATM 13 C10 BHP L 1 -3.634 2.433 0.585 1.00 0.00 C +HETATM 14 C11 BHP L 1 -4.948 2.020 0.359 1.00 0.00 C +HETATM 15 C12 BHP L 1 3.510 0.502 -1.236 1.00 0.00 C +HETATM 16 C13 BHP L 1 3.848 0.202 1.146 1.00 0.00 C +HETATM 17 C14 BHP L 1 4.320 1.636 -1.207 1.00 0.00 C +HETATM 18 C15 BHP L 1 4.657 1.334 1.174 1.00 0.00 C +HETATM 19 C16 BHP L 1 4.893 2.046 -0.002 1.00 0.00 C +HETATM 20 H1 BHP L 1 -0.842 0.105 -1.054 1.00 0.00 H +HETATM 21 H2 BHP L 1 -1.935 -1.074 -1.691 1.00 0.00 H +HETATM 22 H3 BHP L 1 -1.285 -0.999 1.301 1.00 0.00 H +HETATM 23 H4 BHP L 1 -4.357 -1.017 -1.025 1.00 0.00 H +HETATM 24 H5 BHP L 1 -1.561 1.917 0.403 1.00 0.00 H +HETATM 25 H6 BHP L 1 2.543 -1.959 -1.064 1.00 0.00 H +HETATM 26 H7 BHP L 1 2.826 -2.193 0.645 1.00 0.00 H +HETATM 27 H8 BHP L 1 -6.231 0.459 -0.383 1.00 0.00 H +HETATM 28 H9 BHP L 1 -3.434 3.385 1.051 1.00 0.00 H +HETATM 29 H10 BHP L 1 -2.185 -3.147 -0.340 1.00 0.00 H +HETATM 30 H11 BHP L 1 -5.767 2.660 0.654 1.00 0.00 H +HETATM 31 H12 BHP L 1 3.068 0.188 -2.169 1.00 0.00 H +HETATM 32 H13 BHP L 1 3.662 -0.348 2.055 1.00 0.00 H +HETATM 33 H14 BHP L 1 4.508 2.195 -2.112 1.00 0.00 H +HETATM 34 H15 BHP L 1 5.104 1.657 2.102 1.00 0.00 H +HETATM 35 H16 BHP L 1 5.530 2.923 0.020 1.00 0.00 H +CONECT 1 7 10 +CONECT 2 5 29 +CONECT 3 7 +CONECT 3 7 +CONECT 4 5 6 20 21 +CONECT 5 2 4 7 22 +CONECT 6 4 8 9 +CONECT 6 8 +CONECT 7 1 3 5 +CONECT 7 3 +CONECT 8 6 12 23 +CONECT 8 6 +CONECT 9 6 13 24 +CONECT 9 13 +CONECT 10 1 11 25 26 +CONECT 11 10 15 16 +CONECT 11 15 +CONECT 12 8 14 27 +CONECT 12 14 +CONECT 13 9 14 28 +CONECT 13 9 +CONECT 14 12 13 30 +CONECT 14 12 +CONECT 15 11 17 31 +CONECT 15 11 +CONECT 16 11 18 32 +CONECT 16 18 +CONECT 17 15 19 33 +CONECT 17 19 +CONECT 18 16 19 34 +CONECT 18 16 +CONECT 19 17 18 35 +CONECT 19 17 +CONECT 20 4 +CONECT 21 4 +CONECT 22 5 +CONECT 23 8 +CONECT 24 9 +CONECT 25 10 +CONECT 26 10 +CONECT 27 12 +CONECT 28 13 +CONECT 29 2 +CONECT 30 14 +CONECT 31 15 +CONECT 32 16 +CONECT 33 17 +CONECT 34 18 +CONECT 35 19 +END diff --git a/peleffy/data/ligands/benzamidine.pdb b/peleffy/data/ligands/benzamidine.pdb new file mode 100644 index 00000000..5edbbee8 --- /dev/null +++ b/peleffy/data/ligands/benzamidine.pdb @@ -0,0 +1,65 @@ +HEADER HYDROLASE (SERINE PROTEINASE) 27-SEP-82 3PTB +REMARK 4 3PTB COMPLIES WITH FORMAT V. 3.15, 01-DEC-08 +REMARK 888 +REMARK 888 WRITTEN BY MAESTRO (A PRODUCT OF SCHRODINGER, LLC) +TITLE THE GEOMETRY OF THE REACTIVE SITE AND OF THE PEPTIDE GROUPS +TITLE 2 IN TRYPSIN, TRYPSINOGEN AND ITS COMPLEXES WITH INHIBITORS +EXPDTA X-RAY DIFFRACTION +REMARK 2 RESOLUTION. 1.70 ANGSTROMS +REMARK 3 R VALUE : 0.182000 +REMARK 200 TEMPERATURE (KELVIN) : NULL +REMARK 200 PH : NULL +REMARK 350 BIOMOLECULE: 1 +REMARK 350 APPLY THE FOLLOWING TO CHAINS: A +REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.000000 +REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.000000 +REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.000000 +CRYST1 54.890 58.520 67.630 90.00 90.00 90.00 P 21 21 21 4 +HET BEN A 1 17 +HETNAM BEN BENZAMIDINE +FORMUL 1 BEN C7 H8 N2 +MODEL 1 +HETATM 1 C1 BEN A 1 -1.853 14.311 16.658 1.00 19.86 C +HETATM 2 C2 BEN A 1 -2.107 15.653 16.758 1.00 19.86 C +HETATM 3 C3 BEN A 1 -1.774 16.341 17.932 1.00 19.86 C +HETATM 4 C4 BEN A 1 -1.175 15.662 19.005 1.00 19.86 C +HETATM 5 C5 BEN A 1 -0.914 14.295 18.885 1.00 19.86 C +HETATM 6 C6 BEN A 1 -1.257 13.634 17.708 1.00 19.86 C +HETATM 7 C BEN A 1 -2.193 13.627 15.496 1.00 19.86 C +HETATM 8 N1 BEN A 1 -2.797 14.235 14.491 1.00 19.86 N +HETATM 9 N2 BEN A 1 -1.762 12.391 15.309 1.00 19.86 N +HETATM 10 H2 BEN A 1 -2.563 16.179 15.933 1.00 0.00 H +HETATM 11 H3 BEN A 1 -1.978 17.398 18.015 1.00 0.00 H +HETATM 12 H4 BEN A 1 -0.922 16.197 19.909 1.00 0.00 H +HETATM 13 H5 BEN A 1 -0.450 13.760 19.701 1.00 0.00 H +HETATM 14 H6 BEN A 1 -1.051 12.577 17.622 1.00 0.00 H +HETATM 15 H1 1 BEN A 1 -3.034 13.717 13.657 1.00 0.00 H +HETATM 16 H1 2 BEN A 1 -3.022 15.218 14.557 1.00 0.00 H +HETATM 17 HN2 BEN A 1 -2.008 11.893 14.466 1.00 0.00 H +CONECT 1 2 6 7 +CONECT 1 2 +CONECT 2 1 3 10 +CONECT 2 1 +CONECT 3 2 4 11 +CONECT 3 4 +CONECT 4 3 5 12 +CONECT 4 3 +CONECT 5 4 6 13 +CONECT 5 6 +CONECT 6 1 5 14 +CONECT 6 5 +CONECT 7 1 8 9 +CONECT 7 9 +CONECT 8 7 15 16 +CONECT 9 7 17 +CONECT 9 7 +CONECT 10 2 +CONECT 11 3 +CONECT 12 4 +CONECT 13 5 +CONECT 14 6 +CONECT 15 8 +CONECT 16 8 +CONECT 17 9 +ENDMDL +END diff --git a/peleffy/data/ligands/ethylene.mae b/peleffy/data/ligands/ethylene.mae new file mode 100644 index 00000000..62aa000e --- /dev/null +++ b/peleffy/data/ligands/ethylene.mae @@ -0,0 +1,51 @@ +{ + s_m_m2io_version + ::: + 2.0.0 +} + +f_m_ct { + s_m_title + i_m_ct_format + ::: + "Displayed atoms" + 2 + m_atom[6] { + # First column is atom index # + i_m_mmod_type + r_m_x_coord + r_m_y_coord + r_m_z_coord + i_m_residue_number + i_m_color + s_m_pdb_atom_name + i_m_atomic_number + s_m_color_rgb + s_m_atom_name + r_m_pdb_occupancy + i_m_pdb_convert_problem + i_pdb_PDB_serial + ::: + 1 2 0.634000 -0.083000 0.007000 1 24 " C1 " 6 808080 C1 1 4 1 + 2 2 -0.671000 0.098000 -0.007000 1 24 " C2 " 6 808080 C2 1 4 2 + 3 41 1.354000 0.739000 0.049000 1 21 " H1 " 1 FFFFFF H3 1 4 3 + 4 41 1.082000 -1.071000 -0.022000 1 21 " H2 " 1 FFFFFF H4 1 4 4 + 5 41 -1.096000 1.088000 0.022000 1 21 " H3 " 1 FFFFFF H5 1 4 5 + 6 41 -1.302000 -0.770000 -0.049000 1 21 " H4 " 1 FFFFFF H6 1 4 6 + ::: + } + m_bond[5] { + # First column is bond index # + i_m_from + i_m_to + i_m_order + ::: + 1 1 2 2 + 2 1 3 1 + 3 1 4 1 + 4 2 5 1 + 5 2 6 1 + ::: + } +} + diff --git a/peleffy/data/ligands/malonate.mae b/peleffy/data/ligands/malonate.mae new file mode 100644 index 00000000..244b2394 --- /dev/null +++ b/peleffy/data/ligands/malonate.mae @@ -0,0 +1,61 @@ +{ + s_m_m2io_version + ::: + 2.0.0 +} + +f_m_ct { + s_m_title + i_m_ct_format + ::: + "Displayed atoms" + 2 + m_atom[10] { + # First column is atom index # + i_m_mmod_type + r_m_x_coord + r_m_y_coord + r_m_z_coord + i_m_residue_number + i_m_color + s_m_pdb_residue_name + s_m_pdb_atom_name + i_m_atomic_number + i_m_formal_charge + s_m_color_rgb + s_m_atom_name + r_m_pdb_occupancy + i_m_pdb_convert_problem + i_pdb_PDB_serial + ::: + 1 15 -1.598000 -1.076000 1.038000 1 70 "UNL " " O1 " 8 0 FF2E2E O1 1 4 1 + 2 2 -1.509000 -0.220000 0.134000 1 10 "UNL " " C1 " 6 0 1EE11E C2 1 4 2 + 3 18 -2.594000 0.553000 -0.220000 1 70 "UNL " " O2 " 8 -1 FF2E2E O3 1 4 3 + 4 3 -0.228000 -0.031000 -0.564000 1 10 "UNL " " C2 " 6 0 1EE11E C4 1 4 4 + 5 2 0.811000 0.299000 0.424000 1 10 "UNL " " C3 " 6 0 1EE11E C5 1 4 5 + 6 16 2.138000 0.539000 0.046000 1 70 "UNL " " O3 " 8 0 FF2E2E O6 1 4 6 + 7 15 0.529000 0.371000 1.629000 1 70 "UNL " " O4 " 8 0 FF2E2E O7 1 4 7 + 8 41 0.047000 -0.941000 -1.147000 1 21 "UNL " " H1 " 1 0 FFFFFF H8 1 4 8 + 9 41 -0.338000 0.776000 -1.310000 1 21 "UNL " " H2 " 1 0 FFFFFF H9 1 4 9 + 10 42 2.740000 -0.269000 -0.031000 1 21 "UNL " " H3 " 1 0 FFFFFF H10 1 4 10 + ::: + } + m_bond[9] { + # First column is bond index # + i_m_from + i_m_to + i_m_order + ::: + 1 1 2 2 + 2 2 3 1 + 3 2 4 1 + 4 4 5 1 + 5 4 8 1 + 6 4 9 1 + 7 5 6 1 + 8 5 7 2 + 9 6 10 1 + ::: + } +} + diff --git a/peleffy/data/tests/MAT.mae b/peleffy/data/tests/MAT.mae new file mode 100644 index 00000000..7a04cf85 --- /dev/null +++ b/peleffy/data/tests/MAT.mae @@ -0,0 +1,331 @@ +{ + s_m_m2io_version + ::: + 2.0.0 +} + +f_m_ct { + s_m_title + s_st_Chirality_1 + s_m_entry_id + s_m_entry_name + i_sd_PUBCHEM\_COMPOUND\_CID + i_sd_PUBCHEM\_HEAVY\_ATOM\_COUNT + i_sd_PUBCHEM\_ATOM\_DEF\_STEREO\_COUNT + i_sd_PUBCHEM\_ATOM\_UDEF\_STEREO\_COUNT + i_sd_PUBCHEM\_BOND\_DEF\_STEREO\_COUNT + i_sd_PUBCHEM\_BOND\_UDEF\_STEREO\_COUNT + i_sd_PUBCHEM\_ISOTOPIC\_ATOM\_COUNT + i_sd_PUBCHEM\_COMPONENT\_COUNT + i_sd_PUBCHEM\_CACTVS\_TAUTO\_COUNT + s_sd_PUBCHEM\_COORDINATE\_TYPE + b_sd_chiral_flag + i_sd_version + i_m_ct_enhanced_stereo_status + s_m_Source_Path + s_m_Source_File + i_m_Source_File_Index + r_sd_PUBCHEM\_CONFORMER\_RMSD + s_sd_PUBCHEM\_CONFORMER\_DIVERSEORDER + s_sd_PUBCHEM\_MMFF94\_PARTIAL\_CHARGES + i_sd_PUBCHEM\_EFFECTIVE\_ROTOR\_COUNT + s_sd_PUBCHEM\_PHARMACOPHORE\_FEATURES + s_sd_PUBCHEM\_CONFORMER\_ID + r_sd_PUBCHEM\_MMFF94\_ENERGY + r_sd_PUBCHEM\_FEATURE\_SELFOVERLAP + s_sd_PUBCHEM\_SHAPE\_FINGERPRINT + s_sd_PUBCHEM\_SHAPE\_MULTIPOLES + r_sd_PUBCHEM\_SHAPE\_SELFOVERLAP + r_sd_PUBCHEM\_SHAPE\_VOLUME + i_m_Spin_multiplicity + i_m_Molecular_charge + s_j_Task + s_j_Jaguar_input_file + s_j_Jaguar_restart_input_file + s_j_Jaguar_restart_mae_file + s_j_Jaguar_output_file + s_j_Jaguar_log_file + s_j_Jaguar_mae_file + s_j_QM_Method + s_j_QM_Basis + i_j_Number_of_canonical_orbitals + r_j_Gas_Phase_Energy + r_j_alpha_HOMO + r_j_alpha_LUMO + r_j_beta_HOMO + r_j_beta_LUMO + r_j_S2_Value + i_m_ct_format + ::: + MAT + 7_R_6_9_8_17 + 4 + AminoTriFB_Acid.1 + 7146283 + 16 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + "2 +5 +10" + 1 + 0 + 0 + /home/sergi/Downloads + AminoTriFB_Acid.sdf + 1 + 0.6 + "1 +29 +18 +12 +36 +27 +26 +3 +21 +22 +30 +33 +28 +34 +6 +13 +8 +20 +2 +10 +17 +14 +38 +35 +5 +15 +19 +32 +7 +11 +31 +25 +16 +37 +4 +24 +9 +23" + "21 +1 -0.19 +10 -0.14 +11 0.19 +12 -0.15 +13 0.66 +14 0.19 +15 -0.15 +16 0.19 +2 -0.19 +22 0.36 +23 0.36 +24 0.15 +25 0.15 +26 0.5 +3 -0.19 +4 -0.65 +5 -0.57 +6 -0.99 +7 0.27 +8 0.14 +9 0.06" + 4 + "6 +1 4 acceptor +1 5 acceptor +1 6 cation +1 6 donor +3 4 5 13 anion +6 10 11 12 14 15 16 rings" + 006D0B2B00000001 + 21.5392 + 30.505 + "11640471 11 15647628889830663852 +12423570 1 11493903152406358833 +14817 1 10758997178314292410 +15207287 21 18339637962036346626 +15219456 202 18413672421803698665 +15775835 57 14779556732791855478 +15852999 172 18262801886227100626 +16945 1 18343585169851076072 +17357990 137 16081095848386176836 +17834072 14 18268706100702522186 +18186145 218 18335423413576322669 +20201158 50 18341902887196267538 +20344682 1 18197214969294511237 +20645476 183 16009033937927384619 +20645477 70 17846782901367029789 +20671657 53 17844260531688729894 +21501502 16 18130801009517592297 +21947302 44 18341894073870479240 +22802520 49 18335713701730648057 +23402539 116 18043233846170889205 +23557571 272 17824559679483454083 +23559900 14 18187087291251865792 +257057 1 17838905828515207974 +2748010 2 18260829276377957649 +58245506 1 18270127807290276095 +77492 1 15626235627511717544" + "290.73 +5.02 +1.98 +1.45 +1.11 +0.1 +0.02 +-0.74 +-1.28 +-0.94 +-0.09 +-0.11 +0.4 +1.15" + 604.945 + 165.5 + 2 + -1 + "Single Point" + /gpfs/projects/bsc72/sroda/Transaminases/Pharmaceutical_compounds_PELE_simulation/jag_MAT_spe_B3LYP-D3_CC-PVTZ/jag_MAT_spe_B3LYP-D3_CC-PVTZ.in + /gpfs/projects/bsc72/sroda/Transaminases/Pharmaceutical_compounds_PELE_simulation/jag_MAT_spe_B3LYP-D3_CC-PVTZ/jag_MAT_spe_B3LYP-D3_CC-PVTZ.01.in + /gpfs/projects/bsc72/sroda/Transaminases/Pharmaceutical_compounds_PELE_simulation/jag_MAT_spe_B3LYP-D3_CC-PVTZ/jag_MAT_spe_B3LYP-D3_CC-PVTZ.01.mae + /gpfs/projects/bsc72/sroda/Transaminases/Pharmaceutical_compounds_PELE_simulation/jag_MAT_spe_B3LYP-D3_CC-PVTZ/jag_MAT_spe_B3LYP-D3_CC-PVTZ.out + /gpfs/projects/bsc72/sroda/Transaminases/Pharmaceutical_compounds_PELE_simulation/jag_MAT_spe_B3LYP-D3_CC-PVTZ/jag_MAT_spe_B3LYP-D3_CC-PVTZ.log + /gpfs/projects/bsc72/sroda/Transaminases/Pharmaceutical_compounds_PELE_simulation/jag_MAT_spe_B3LYP-D3_CC-PVTZ/jag_MAT_spe_B3LYP-D3_CC-PVTZ.mae + UDFT(b3lyp-d3) + cc-pvtz + 670 + -931.456893310843 + 0.0844465446946714 + 0.129570959700156 + -0.071527252846213 + 0.1345953522174 + 0.75483541206038 + 2 + m_depend[18] { + # First column is dependency index # + i_m_depend_dependency + s_m_depend_property + ::: + 1 20 i_m_Spin_multiplicity + 2 20 i_m_Molecular_charge + 3 20 s_j_Task + 4 20 s_j_Jaguar_input_file + 5 20 s_j_Jaguar_restart_input_file + 6 20 s_j_Jaguar_restart_mae_file + 7 20 s_j_Jaguar_output_file + 8 20 s_j_Jaguar_log_file + 9 20 s_j_Jaguar_mae_file + 10 20 s_j_QM_Method + 11 20 s_j_QM_Basis + 12 20 i_j_Number_of_canonical_orbitals + 13 20 r_j_Gas_Phase_Energy + 14 20 r_j_alpha_HOMO + 15 20 r_j_alpha_LUMO + 16 20 r_j_beta_HOMO + 17 20 r_j_beta_LUMO + 18 20 r_j_S2_Value + ::: + } + m_atom[29] { + # First column is atom index # + i_m_mmod_type + r_m_x_coord + r_m_y_coord + r_m_z_coord + i_m_residue_number + s_m_chain_name + i_m_color + r_m_charge1 + r_m_charge2 + s_m_pdb_residue_name + s_m_pdb_atom_name + i_m_atomic_number + i_m_representation + s_m_color_rgb + s_m_atom_name + r_j_ESP_Charges + b_st_NoSrcChirality + ::: + 1 56 0.136400 -1.606600 1.888400 900 L 8 -0.18938 -0.18938 "MAT " " F1 " 9 3 00FF7F F1 -0.189381007754499 <> + 2 56 -2.897800 1.781700 -1.149100 900 L 8 -0.21715 -0.21715 "MAT " " F2 " 9 3 00FF7F F2 -0.21715491188276 <> + 3 56 -3.885600 -0.660900 -0.417800 900 L 8 -0.21234 -0.21234 "MAT " " F3 " 9 3 00FF7F F3 -0.212342238602534 <> + 4 16 2.066900 -2.295900 -0.606900 900 L 70 -0.39736 -0.39736 "MAT " " O1 " 8 3 FF2F2F O4 -0.397355862098786 <> + 5 15 1.185200 -0.794400 -2.060400 900 L 70 -0.58890 -0.58890 "MAT " " O2 " 8 3 FF2F2F O5 -0.588897492157642 <> + 6 26 3.279300 2.088400 0.564700 900 L 43 -1.00825 -1.00825 "MAT " " N1 " 7 3 5757FF N6 -1.00824917291544 <> + 7 3 2.243900 1.187200 0.039600 900 L 2 0.72066 0.72066 "MAT " " C1 " 6 3 A0A0A0 C7 0.720663097266971 1 + 8 3 1.269500 0.888300 1.199200 900 L 2 -0.06281 -0.06281 "MAT " " C2 " 6 3 A0A0A0 C8 -0.0628104819120706 <> + 9 3 2.925900 -0.074300 -0.521800 900 L 2 -0.67474 -0.67474 "MAT " " C3 " 6 3 A0A0A0 C9 -0.674742507725455 <> + 10 2 -0.113200 0.469700 0.765400 900 L 2 0.10391 0.10391 "MAT " " C4 " 6 3 A0A0A0 C10 0.103911047005205 <> + 11 2 -0.601600 -0.771500 1.143900 900 L 2 0.16293 0.16293 "MAT " " C5 " 6 3 A0A0A0 C11 0.162934991438303 <> + 12 2 -0.873200 1.336800 -0.004400 900 L 2 -0.61076 -0.61076 "MAT " " C6 " 6 3 A0A0A0 C12 -0.610758716911476 <> + 13 2 1.955500 -1.054600 -1.145800 900 L 2 0.78183 0.78183 "MAT " " C7 " 6 3 A0A0A0 C13 0.781832745506856 <> + 14 2 -2.152900 0.953500 -0.405500 900 L 2 0.27041 0.27041 "MAT " " C8 " 6 3 A0A0A0 C14 0.270409269249383 <> + 15 2 -1.881300 -1.154900 0.742700 900 L 2 -0.48769 -0.48769 "MAT " " C9 " 6 3 A0A0A0 C15 -0.487686845764794 <> + 16 2 -2.657000 -0.292400 -0.032100 900 L 2 0.15704 0.15704 "MAT " " C10" 6 3 A0A0A0 C16 0.157039766143276 <> + 17 41 1.737600 1.710600 -0.778700 900 L 21 -0.02646 -0.02646 "MAT " " H1 " 1 3 FFFFFF H17 -0.0264587619292393 <> + 18 41 1.126000 1.787700 1.816200 900 L 21 -0.08394 -0.08394 "MAT " " H2 " 1 3 FFFFFF H18 -0.0839374144130638 <> + 19 41 1.712900 0.145800 1.875600 900 L 21 -0.01308 -0.01308 "MAT " " H3 " 1 3 FFFFFF H19 -0.0130810759363484 <> + 20 41 3.482000 -0.586000 0.274700 900 L 21 0.14006 0.14006 "MAT " " H4 " 1 3 FFFFFF H20 0.140055140078799 <> + 21 41 3.658900 0.188200 -1.294600 900 L 21 0.12960 0.12960 "MAT " " H5 " 1 3 FFFFFF H21 0.129599570483456 <> + 22 43 3.752000 1.649200 1.354100 900 L 21 0.31245 0.31245 "MAT " " H6 " 1 3 FFFFFF H22 0.312448752190927 <> + 23 43 2.846900 2.937000 0.927800 900 L 21 0.30268 0.30268 "MAT " " H7 " 1 3 FFFFFF H23 0.302679430921071 <> + 24 41 -0.498600 2.314400 -0.293100 900 L 21 0.17026 0.17026 "MAT " " H8 " 1 3 FFFFFF H24 0.170264916923274 <> + 25 41 -2.273500 -2.124900 1.033100 900 L 21 0.15782 0.15782 "MAT " " H9 " 1 3 FFFFFF H25 0.157816207029052 <> + 26 3 1.169586 -3.222897 -1.217429 900 L 2 0.03175 0.03175 "MAT " " C11" 6 3 A0A0A0 C26 0.0317457284125078 <> + 27 41 1.290862 -4.203553 -0.757315 900 L 21 0.03894 0.03894 "MAT " " H10" 1 3 FFFFFF H27 0.0389394979751902 <> + 28 41 0.143769 -2.881450 -1.078811 900 L 21 0.07509 0.07509 "MAT " " H11" 1 3 FFFFFF H28 0.0750870284974399 <> + 29 41 1.387901 -3.292612 -2.283064 900 L 21 0.01743 0.01743 "MAT " " H12" 1 3 FFFFFF H29 0.0174293008823931 <> + ::: + } + m_bond[29] { + # First column is bond index # + i_m_from + i_m_to + i_m_order + i_m_from_rep + i_m_to_rep + ::: + 1 1 11 1 3 3 + 2 2 14 1 3 3 + 3 3 16 1 3 3 + 4 4 13 1 3 3 + 5 4 26 1 3 3 + 6 5 13 2 3 3 + 7 6 7 1 3 3 + 8 6 22 1 3 3 + 9 6 23 1 3 3 + 10 7 8 1 3 3 + 11 7 9 1 3 3 + 12 7 17 1 3 3 + 13 8 10 1 3 3 + 14 8 18 1 3 3 + 15 8 19 1 3 3 + 16 9 13 1 3 3 + 17 9 20 1 3 3 + 18 9 21 1 3 3 + 19 10 11 1 3 3 + 20 10 12 2 3 3 + 21 11 15 2 3 3 + 22 12 14 1 3 3 + 23 12 24 1 3 3 + 24 14 16 2 3 3 + 25 15 16 1 3 3 + 26 15 25 1 3 3 + 27 26 27 1 3 3 + 28 26 28 1 3 3 + 29 26 29 1 3 3 + ::: + } +} + diff --git a/peleffy/data/tests/MAT.pdb b/peleffy/data/tests/MAT.pdb new file mode 100644 index 00000000..5a01a45e --- /dev/null +++ b/peleffy/data/tests/MAT.pdb @@ -0,0 +1,71 @@ +TITLE MAT +REMARK 4 COMPLIES WITH FORMAT V. 3.0, 1-DEC-2006 +REMARK 888 +REMARK 888 WRITTEN BY MAESTRO (A PRODUCT OF SCHRODINGER, LLC) +HETATM 1 F1 MAT L 900 0.136 -1.607 1.888 1.00 0.00 F +HETATM 2 F2 MAT L 900 -2.898 1.782 -1.149 1.00 0.00 F +HETATM 3 F3 MAT L 900 -3.886 -0.661 -0.418 1.00 0.00 F +HETATM 4 O1 MAT L 900 2.067 -2.296 -0.607 1.00 0.00 O +HETATM 5 O2 MAT L 900 1.185 -0.794 -2.060 1.00 0.00 O +HETATM 6 N1 MAT L 900 3.279 2.088 0.565 1.00 0.00 N +HETATM 7 C1 MAT L 900 2.244 1.187 0.040 1.00 0.00 C +HETATM 8 C2 MAT L 900 1.270 0.888 1.199 1.00 0.00 C +HETATM 9 C3 MAT L 900 2.926 -0.074 -0.522 1.00 0.00 C +HETATM 10 C4 MAT L 900 -0.113 0.470 0.765 1.00 0.00 C +HETATM 11 C5 MAT L 900 -0.602 -0.772 1.144 1.00 0.00 C +HETATM 12 C6 MAT L 900 -0.873 1.337 -0.004 1.00 0.00 C +HETATM 13 C7 MAT L 900 1.956 -1.055 -1.146 1.00 0.00 C +HETATM 14 C8 MAT L 900 -2.153 0.954 -0.406 1.00 0.00 C +HETATM 15 C9 MAT L 900 -1.881 -1.155 0.743 1.00 0.00 C +HETATM 16 C10 MAT L 900 -2.657 -0.292 -0.032 1.00 0.00 C +HETATM 17 C11 MAT L 900 1.170 -3.223 -1.217 1.00 0.00 C +HETATM 18 H1 MAT L 900 1.738 1.711 -0.779 1.00 0.00 H +HETATM 19 H2 MAT L 900 1.126 1.788 1.816 1.00 0.00 H +HETATM 20 H3 MAT L 900 1.713 0.146 1.876 1.00 0.00 H +HETATM 21 H4 MAT L 900 3.482 -0.586 0.275 1.00 0.00 H +HETATM 22 H5 MAT L 900 3.659 0.188 -1.295 1.00 0.00 H +HETATM 23 H6 MAT L 900 3.752 1.649 1.354 1.00 0.00 H +HETATM 24 H7 MAT L 900 2.847 2.937 0.928 1.00 0.00 H +HETATM 25 H8 MAT L 900 -0.499 2.314 -0.293 1.00 0.00 H +HETATM 26 H9 MAT L 900 -2.274 -2.125 1.033 1.00 0.00 H +HETATM 27 H10 MAT L 900 1.291 -4.204 -0.757 1.00 0.00 H +HETATM 28 H11 MAT L 900 0.144 -2.881 -1.079 1.00 0.00 H +HETATM 29 H12 MAT L 900 1.388 -3.293 -2.283 1.00 0.00 H +CONECT 1 11 +CONECT 2 14 +CONECT 3 16 +CONECT 4 13 17 +CONECT 5 13 +CONECT 5 13 +CONECT 6 7 23 24 +CONECT 7 6 8 9 18 +CONECT 8 7 10 19 20 +CONECT 9 7 13 21 22 +CONECT 10 8 11 12 +CONECT 10 12 +CONECT 11 1 10 15 +CONECT 11 15 +CONECT 12 10 14 25 +CONECT 12 10 +CONECT 13 4 5 9 +CONECT 13 5 +CONECT 14 2 12 16 +CONECT 14 16 +CONECT 15 11 16 26 +CONECT 15 11 +CONECT 16 3 14 15 +CONECT 16 14 +CONECT 18 7 +CONECT 19 8 +CONECT 20 8 +CONECT 21 9 +CONECT 22 9 +CONECT 23 6 +CONECT 24 6 +CONECT 25 12 +CONECT 26 15 +CONECT 17 4 27 28 29 +CONECT 27 17 +CONECT 28 17 +CONECT 29 17 +END diff --git a/peleffy/data/tests/MRO_oleic/HEM.pdb b/peleffy/data/tests/MRO_oleic/HEM.pdb new file mode 100644 index 00000000..dbe93c0c --- /dev/null +++ b/peleffy/data/tests/MRO_oleic/HEM.pdb @@ -0,0 +1,179 @@ +TITLE HEC / HEM +REMARK 4 COMPLIES WITH FORMAT V. 3.0, 1-DEC-2006 +REMARK 888 +REMARK 888 WRITTEN BY MAESTRO (A PRODUCT OF SCHRODINGER, LLC) +HETATM 1 CHA HEM A 350 5.771 -9.945 -9.060 1.00 14.59 C +HETATM 2 CHB HEM A 350 5.106 -6.421 -5.752 1.00 13.03 C +HETATM 3 CHC HEM A 350 0.365 -6.278 -6.939 1.00 13.69 C +HETATM 4 CHD HEM A 350 1.026 -9.859 -10.202 1.00 13.46 C +HETATM 5 C1A HEM A 350 6.017 -8.935 -8.100 1.00 14.73 C +HETATM 6 C2A HEM A 350 7.293 -8.629 -7.606 1.00 14.14 C +HETATM 7 C3A HEM A 350 7.111 -7.620 -6.646 1.00 13.63 C +HETATM 8 C4A HEM A 350 5.730 -7.357 -6.615 1.00 13.07 C +HETATM 9 CMA HEM A 350 8.197 -6.955 -5.817 1.00 14.22 C +HETATM 10 CAA HEM A 350 8.606 -9.231 -8.078 1.00 15.46 C +HETATM 11 CBA HEM A 350 8.883 -10.636 -7.507 1.00 15.23 C +HETATM 12 CGA HEM A 350 10.114 -11.296 -8.142 1.00 20.80 C +HETATM 13 O1A HEM A 350 10.581 -12.295 -7.553 1.00 18.52 O +HETATM 14 O2A HEM A 350 10.582 -10.812 -9.197 1.00 15.76 O1- +HETATM 15 C1B HEM A 350 3.719 -6.117 -5.740 1.00 14.48 C +HETATM 16 C2B HEM A 350 3.114 -5.229 -4.837 1.00 14.00 C +HETATM 17 C3B HEM A 350 1.749 -5.187 -5.155 1.00 14.68 C +HETATM 18 C4B HEM A 350 1.590 -6.058 -6.253 1.00 14.54 C +HETATM 19 CMB HEM A 350 3.782 -4.482 -3.696 1.00 11.62 C +HETATM 20 CAB HEM A 350 0.736 -4.451 -4.377 1.00 15.01 C +HETATM 21 CBB HEM A 350 -0.511 -4.870 -4.104 1.00 18.77 C +HETATM 22 C1C HEM A 350 0.153 -7.199 -7.998 1.00 13.73 C +HETATM 23 C2C HEM A 350 -1.081 -7.384 -8.636 1.00 15.79 C +HETATM 24 C3C HEM A 350 -0.917 -8.442 -9.550 1.00 14.55 C +HETATM 25 C4C HEM A 350 0.436 -8.809 -9.451 1.00 12.32 C +HETATM 26 CMC HEM A 350 -2.327 -6.557 -8.399 1.00 15.58 C +HETATM 27 CAC HEM A 350 -1.945 -9.138 -10.343 1.00 18.01 C +HETATM 28 CBC HEM A 350 -3.212 -9.334 -9.951 1.00 19.93 C +HETATM 29 C1D HEM A 350 2.396 -10.220 -10.159 1.00 14.98 C +HETATM 30 C2D HEM A 350 2.955 -11.308 -10.854 1.00 16.29 C +HETATM 31 C3D HEM A 350 4.314 -11.321 -10.525 1.00 13.46 C +HETATM 32 C4D HEM A 350 4.518 -10.249 -9.643 1.00 13.80 C +HETATM 33 CMD HEM A 350 2.260 -12.321 -11.744 1.00 13.70 C +HETATM 34 CAD HEM A 350 5.348 -12.329 -10.993 1.00 12.96 C +HETATM 35 CBD HEM A 350 6.281 -11.744 -12.062 1.00 12.16 C +HETATM 36 CGD HEM A 350 7.577 -12.537 -12.157 1.00 14.79 C +HETATM 37 O1D HEM A 350 7.731 -13.308 -13.127 1.00 14.57 O1- +HETATM 38 O2D HEM A 350 8.416 -12.333 -11.255 1.00 12.72 O1- +HETATM 39 NA HEM A 350 5.120 -8.148 -7.502 1.00 16.75 N1- +HETATM 40 NB HEM A 350 2.775 -6.604 -6.549 1.00 16.27 N +HETATM 41 NC HEM A 350 1.032 -8.049 -8.526 1.00 16.92 N1- +HETATM 42 ND HEM A 350 3.358 -9.613 -9.453 1.00 15.01 N +HETATM 43 HHA HEM A 350 6.582 -10.566 -9.410 1.00 0.00 H +HETATM 44 HHB HEM A 350 5.696 -5.874 -5.031 1.00 0.00 H +HETATM 45 HHC HEM A 350 -0.516 -5.716 -6.665 1.00 0.00 H +HETATM 46 HHD HEM A 350 0.419 -10.453 -10.869 1.00 0.00 H +HETATM 47 HMA1 HEM A 350 7.748 -6.210 -5.160 1.00 0.00 H +HETATM 48 HMA2 HEM A 350 8.709 -7.707 -5.217 1.00 0.00 H +HETATM 49 HMA3 HEM A 350 8.914 -6.470 -6.479 1.00 0.00 H +HETATM 50 HAA1 HEM A 350 9.426 -8.564 -7.812 1.00 0.00 H +HETATM 51 HAA2 HEM A 350 8.613 -9.275 -9.167 1.00 0.00 H +HETATM 52 HBA1 HEM A 350 8.010 -11.270 -7.665 1.00 0.00 H +HETATM 53 HBA2 HEM A 350 9.025 -10.567 -6.428 1.00 0.00 H +HETATM 54 HMB1 HEM A 350 3.042 -3.871 -3.179 1.00 0.00 H +HETATM 55 HMB2 HEM A 350 4.214 -5.197 -2.996 1.00 0.00 H +HETATM 56 HMB3 HEM A 350 4.569 -3.841 -4.092 1.00 0.00 H +HETATM 57 HAB HEM A 350 0.971 -3.480 -3.967 1.00 0.00 H +HETATM 58 HBB1 HEM A 350 -1.174 -4.248 -3.522 1.00 0.00 H +HETATM 59 HBB2 HEM A 350 -0.850 -5.829 -4.467 1.00 0.00 H +HETATM 60 HMC1 HEM A 350 -3.134 -6.926 -9.032 1.00 0.00 H +HETATM 61 HMC2 HEM A 350 -2.622 -6.635 -7.353 1.00 0.00 H +HETATM 62 HMC3 HEM A 350 -2.123 -5.514 -8.642 1.00 0.00 H +HETATM 63 HAC HEM A 350 -1.699 -9.534 -11.317 1.00 0.00 H +HETATM 64 HBC1 HEM A 350 -3.902 -9.856 -10.597 1.00 0.00 H +HETATM 65 HBC2 HEM A 350 -3.542 -8.970 -8.989 1.00 0.00 H +HETATM 66 HMD1 HEM A 350 2.992 -13.033 -12.126 1.00 0.00 H +HETATM 67 HMD2 HEM A 350 1.503 -12.853 -11.168 1.00 0.00 H +HETATM 68 HMD3 HEM A 350 1.785 -11.806 -12.579 1.00 0.00 H +HETATM 69 HAD1 HEM A 350 4.842 -13.207 -11.394 1.00 0.00 H +HETATM 70 HAD2 HEM A 350 5.939 -12.665 -10.141 1.00 0.00 H +HETATM 71 HBD1 HEM A 350 6.508 -10.706 -11.817 1.00 0.00 H +HETATM 72 HBD2 HEM A 350 5.777 -11.755 -13.029 1.00 0.00 H +CONECT 1 5 32 43 +CONECT 1 5 +CONECT 2 8 15 44 +CONECT 2 8 +CONECT 3 18 22 45 +CONECT 3 18 +CONECT 4 25 29 46 +CONECT 4 29 +CONECT 5 1 6 39 +CONECT 5 1 +CONECT 6 5 7 10 +CONECT 6 7 +CONECT 7 6 8 9 +CONECT 7 6 +CONECT 8 2 7 39 +CONECT 8 2 +CONECT 9 7 47 48 49 +CONECT 10 6 11 50 51 +CONECT 11 10 12 52 53 +CONECT 12 11 13 14 +CONECT 12 13 +CONECT 13 12 +CONECT 13 12 +CONECT 14 12 +CONECT 15 2 16 40 +CONECT 15 40 +CONECT 16 15 17 19 +CONECT 16 17 +CONECT 17 16 18 20 +CONECT 17 16 +CONECT 18 3 17 40 +CONECT 18 3 +CONECT 19 16 54 55 56 +CONECT 20 17 21 57 +CONECT 20 21 +CONECT 21 20 58 59 +CONECT 21 20 +CONECT 22 3 23 41 +CONECT 22 23 +CONECT 23 22 24 26 +CONECT 23 22 +CONECT 24 23 25 27 +CONECT 24 25 +CONECT 25 4 24 41 +CONECT 25 24 +CONECT 26 23 60 61 62 +CONECT 27 24 28 63 +CONECT 27 28 +CONECT 28 27 64 65 +CONECT 28 27 +CONECT 29 4 30 42 +CONECT 29 4 +CONECT 30 29 31 33 +CONECT 30 31 +CONECT 31 30 32 34 +CONECT 31 30 +CONECT 32 1 31 42 +CONECT 32 42 +CONECT 33 30 66 67 68 +CONECT 34 31 35 69 70 +CONECT 35 34 36 71 72 +CONECT 36 35 37 38 +CONECT 36 37 +CONECT 37 36 +CONECT 37 36 +CONECT 38 36 +CONECT 39 5 8 +CONECT 40 15 18 +CONECT 40 15 +CONECT 41 22 25 +CONECT 42 29 32 +CONECT 42 32 +CONECT 43 1 +CONECT 44 2 +CONECT 45 3 +CONECT 46 4 +CONECT 47 9 +CONECT 48 9 +CONECT 49 9 +CONECT 50 10 +CONECT 51 10 +CONECT 52 11 +CONECT 53 11 +CONECT 54 19 +CONECT 55 19 +CONECT 56 19 +CONECT 57 20 +CONECT 58 21 +CONECT 59 21 +CONECT 60 26 +CONECT 61 26 +CONECT 62 26 +CONECT 63 27 +CONECT 64 28 +CONECT 65 28 +CONECT 66 33 +CONECT 67 33 +CONECT 68 33 +CONECT 69 34 +CONECT 70 34 +CONECT 71 35 +CONECT 72 35 +END diff --git a/peleffy/data/tests/MRO_oleic/MG.pdb b/peleffy/data/tests/MRO_oleic/MG.pdb new file mode 100644 index 00000000..5b6cd1db --- /dev/null +++ b/peleffy/data/tests/MRO_oleic/MG.pdb @@ -0,0 +1,6 @@ +TITLE MG +REMARK 4 COMPLIES WITH FORMAT V. 3.0, 1-DEC-2006 +REMARK 888 +REMARK 888 WRITTEN BY MAESTRO (A PRODUCT OF SCHRODINGER, LLC) +HETATM 1 MG MG A 353 9.152 -15.019 -13.161 1.00 15.86 Mg2+ +END diff --git a/peleffy/data/tests/MRO_oleic/OLC.pdb b/peleffy/data/tests/MRO_oleic/OLC.pdb new file mode 100644 index 00000000..a7964dea --- /dev/null +++ b/peleffy/data/tests/MRO_oleic/OLC.pdb @@ -0,0 +1,113 @@ +REMARK 888 +REMARK 888 WRITTEN BY MAESTRO (A PRODUCT OF SCHRODINGER, LLC) +HETATM 1 C2 OLC L 1 4.148 7.353 -18.237 1.00 0.00 C +HETATM 2 C1 OLC L 1 2.819 7.913 -18.760 1.00 0.00 C +HETATM 3 C3 OLC L 1 4.336 5.840 -18.529 1.00 0.00 C +HETATM 4 O1 OLC L 1 1.997 8.332 -17.914 1.00 0.00 O +HETATM 5 O2 OLC L 1 2.619 7.886 -19.995 1.00 0.00 O1- +HETATM 6 C4 OLC L 1 3.226 4.913 -17.967 1.00 0.00 C +HETATM 7 C5 OLC L 1 3.428 3.426 -18.324 1.00 0.00 C +HETATM 8 C6 OLC L 1 2.293 2.492 -17.836 1.00 0.00 C +HETATM 9 C7 OLC L 1 2.536 1.015 -18.229 1.00 0.00 C +HETATM 10 C8 OLC L 1 1.783 -0.056 -17.392 1.00 0.00 C +HETATM 11 C9 OLC L 1 2.501 -1.407 -17.407 1.00 0.00 C +HETATM 12 C10 OLC L 1 2.074 -2.659 -17.133 1.00 0.00 C +HETATM 13 C11 OLC L 1 0.708 -3.141 -16.670 1.00 0.00 C +HETATM 14 C12 OLC L 1 -0.251 -3.573 -17.803 1.00 0.00 C +HETATM 15 C13 OLC L 1 -0.435 -2.432 -18.806 1.00 0.00 C +HETATM 16 C14 OLC L 1 -1.522 -2.562 -19.874 1.00 0.00 C +HETATM 17 C15 OLC L 1 -1.587 -1.234 -20.659 1.00 0.00 C +HETATM 18 C16 OLC L 1 -2.964 -0.881 -21.233 1.00 0.00 C +HETATM 19 C17 OLC L 1 -2.994 0.581 -21.715 1.00 0.00 C +HETATM 20 C18 OLC L 1 -4.370 1.021 -22.222 1.00 0.00 C +HETATM 21 H1 OLC L 1 4.953 7.921 -18.708 1.00 0.00 H +HETATM 22 H2 OLC L 1 4.242 7.560 -17.172 1.00 0.00 H +HETATM 23 H3 OLC L 1 4.417 5.705 -19.610 1.00 0.00 H +HETATM 24 H4 OLC L 1 5.305 5.541 -18.122 1.00 0.00 H +HETATM 25 H5 OLC L 1 3.168 5.041 -16.885 1.00 0.00 H +HETATM 26 H6 OLC L 1 2.260 5.241 -18.354 1.00 0.00 H +HETATM 27 H7 OLC L 1 3.528 3.341 -19.407 1.00 0.00 H +HETATM 28 H8 OLC L 1 4.382 3.100 -17.908 1.00 0.00 H +HETATM 29 H9 OLC L 1 2.207 2.594 -16.755 1.00 0.00 H +HETATM 30 H10 OLC L 1 1.338 2.828 -18.243 1.00 0.00 H +HETATM 31 H11 OLC L 1 2.303 0.878 -19.287 1.00 0.00 H +HETATM 32 H12 OLC L 1 3.609 0.837 -18.162 1.00 0.00 H +HETATM 33 H13 OLC L 1 1.694 0.260 -16.354 1.00 0.00 H +HETATM 34 H14 OLC L 1 0.765 -0.137 -17.754 1.00 0.00 H +HETATM 35 H15 OLC L 1 3.532 -1.332 -17.691 1.00 0.00 H +HETATM 36 H16 OLC L 1 2.801 -3.444 -17.245 1.00 0.00 H +HETATM 37 H17 OLC L 1 0.860 -3.979 -15.988 1.00 0.00 H +HETATM 38 H18 OLC L 1 0.249 -2.379 -16.052 1.00 0.00 H +HETATM 39 H19 OLC L 1 0.119 -4.466 -18.306 1.00 0.00 H +HETATM 40 H20 OLC L 1 -0.682 -1.556 -18.213 1.00 0.00 H +HETATM 41 H21 OLC L 1 -1.314 -3.400 -20.542 1.00 0.00 H +HETATM 42 H22 OLC L 1 -2.477 -2.781 -19.397 1.00 0.00 H +HETATM 43 H23 OLC L 1 -1.295 -0.409 -20.004 1.00 0.00 H +HETATM 44 H24 OLC L 1 -0.835 -1.239 -21.451 1.00 0.00 H +HETATM 45 H25 OLC L 1 -3.211 -1.562 -22.049 1.00 0.00 H +HETATM 46 H26 OLC L 1 -3.725 -1.022 -20.464 1.00 0.00 H +HETATM 47 H27 OLC L 1 -2.697 1.242 -20.897 1.00 0.00 H +HETATM 48 H28 OLC L 1 -2.249 0.727 -22.499 1.00 0.00 H +HETATM 49 H29 OLC L 1 -4.348 2.068 -22.528 1.00 0.00 H +HETATM 50 H30 OLC L 1 -4.680 0.430 -23.084 1.00 0.00 H +HETATM 51 H31 OLC L 1 -5.129 0.919 -21.446 1.00 0.00 H +HETATM 52 H32 OLC L 1 -1.213 -3.839 -17.365 1.00 0.00 H +HETATM 53 H33 OLC L 1 0.515 -2.220 -19.298 1.00 0.00 H +CONECT 1 2 3 21 22 +CONECT 2 1 4 5 +CONECT 2 4 +CONECT 3 1 6 23 24 +CONECT 4 2 +CONECT 4 2 +CONECT 5 2 +CONECT 6 3 7 25 26 +CONECT 7 6 8 27 28 +CONECT 8 7 9 29 30 +CONECT 9 8 10 31 32 +CONECT 10 9 11 33 34 +CONECT 11 10 12 35 +CONECT 11 12 +CONECT 12 11 13 36 +CONECT 12 11 +CONECT 13 12 14 37 38 +CONECT 14 13 15 39 52 +CONECT 15 14 16 40 53 +CONECT 16 15 17 41 42 +CONECT 17 16 18 43 44 +CONECT 18 17 19 45 46 +CONECT 19 18 20 47 48 +CONECT 20 19 49 50 51 +CONECT 21 1 +CONECT 22 1 +CONECT 23 3 +CONECT 24 3 +CONECT 25 6 +CONECT 26 6 +CONECT 27 7 +CONECT 28 7 +CONECT 29 8 +CONECT 30 8 +CONECT 31 9 +CONECT 32 9 +CONECT 33 10 +CONECT 34 10 +CONECT 35 11 +CONECT 36 12 +CONECT 37 13 +CONECT 38 13 +CONECT 39 14 +CONECT 40 15 +CONECT 41 16 +CONECT 42 16 +CONECT 43 17 +CONECT 44 17 +CONECT 45 18 +CONECT 46 18 +CONECT 47 19 +CONECT 48 19 +CONECT 49 20 +CONECT 50 20 +CONECT 51 20 +CONECT 52 14 +CONECT 53 15 +END diff --git a/peleffy/data/tests/MRO_oleic/OXO.pdb b/peleffy/data/tests/MRO_oleic/OXO.pdb new file mode 100644 index 00000000..56cfc00c --- /dev/null +++ b/peleffy/data/tests/MRO_oleic/OXO.pdb @@ -0,0 +1,6 @@ +TITLE OXO +REMARK 4 COMPLIES WITH FORMAT V. 3.0, 1-DEC-2006 +REMARK 888 +REMARK 888 WRITTEN BY MAESTRO (A PRODUCT OF SCHRODINGER, LLC) +HETATM 1 O OXO A 351 3.374 -6.744 -9.274 1.00 19.79 O2- +END diff --git a/peleffy/data/tests/OXO_ffld_output.txt b/peleffy/data/tests/OXO_ffld_output.txt new file mode 100644 index 00000000..6fa6b254 --- /dev/null +++ b/peleffy/data/tests/OXO_ffld_output.txt @@ -0,0 +1,32 @@ +FFLD_VERSION 4.1.0 +================================================================================ + ATOMTYPES and PARAMETERS for molecule: + +================================================================================ + + Total charge of the system = -2.0000 +Formal charge of the system = -2.0000 + + +Charges +atom formal fractional formal +1 -2 -2.000 + +BCI's index type type bci assignement info + +OPLSAA FORCE FIELD TYPE ASSIGNED +------------------------------------------------------------------------------- + atom type vdw symbol charge sigma epsilon quality comment +------------------------------------------------------------------------------- + O1 801 O4 O -2.0000 3.0000 0.1700 high O +------------------------------------------------------------------------------ + + + Stretch k r0 quality bt comment + + Bending k theta0 quality at comment + + proper Torsion V1 V2 V3 V4 quality tt comment + + + diff --git a/peleffy/data/tests/ligandParams.txt b/peleffy/data/tests/ligandParams.txt new file mode 100644 index 00000000..25e5c923 --- /dev/null +++ b/peleffy/data/tests/ligandParams.txt @@ -0,0 +1,231 @@ +{ + "SolventParameters": { + "Name": "OBC2", + "General": { + "solvent_dielectric": 78.5, + "solute_dielectric": 1, + "solvent_radius": 1.4, + "surface_area_penalty": 0.0054 + }, + "OXO": { + "_O__": { + "radius": 1.5, + "scale": 0.85 + } + }, + "OLC": { + "_C2_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C1_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C3_": { + "radius": 1.7, + "scale": 0.72 + }, + "_O1_": { + "radius": 1.5, + "scale": 0.85 + }, + "_O2_": { + "radius": 1.5, + "scale": 0.85 + }, + "_C4_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C5_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C6_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C7_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C8_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C9_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C10": { + "radius": 1.7, + "scale": 0.72 + }, + "_C11": { + "radius": 1.7, + "scale": 0.72 + }, + "_C12": { + "radius": 1.7, + "scale": 0.72 + }, + "_C13": { + "radius": 1.7, + "scale": 0.72 + }, + "_C14": { + "radius": 1.7, + "scale": 0.72 + }, + "_C15": { + "radius": 1.7, + "scale": 0.72 + }, + "_C16": { + "radius": 1.7, + "scale": 0.72 + }, + "_C17": { + "radius": 1.7, + "scale": 0.72 + }, + "_C18": { + "radius": 1.7, + "scale": 0.72 + }, + "_H1_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H2_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H3_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H4_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H5_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H6_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H7_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H8_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H9_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H10": { + "radius": 1.2, + "scale": 0.85 + }, + "_H11": { + "radius": 1.2, + "scale": 0.85 + }, + "_H12": { + "radius": 1.2, + "scale": 0.85 + }, + "_H13": { + "radius": 1.2, + "scale": 0.85 + }, + "_H14": { + "radius": 1.2, + "scale": 0.85 + }, + "_H15": { + "radius": 1.2, + "scale": 0.85 + }, + "_H16": { + "radius": 1.2, + "scale": 0.85 + }, + "_H17": { + "radius": 1.2, + "scale": 0.85 + }, + "_H18": { + "radius": 1.2, + "scale": 0.85 + }, + "_H19": { + "radius": 1.2, + "scale": 0.85 + }, + "_H20": { + "radius": 1.2, + "scale": 0.85 + }, + "_H21": { + "radius": 1.2, + "scale": 0.85 + }, + "_H22": { + "radius": 1.2, + "scale": 0.85 + }, + "_H23": { + "radius": 1.2, + "scale": 0.85 + }, + "_H24": { + "radius": 1.2, + "scale": 0.85 + }, + "_H25": { + "radius": 1.2, + "scale": 0.85 + }, + "_H26": { + "radius": 1.2, + "scale": 0.85 + }, + "_H27": { + "radius": 1.2, + "scale": 0.85 + }, + "_H28": { + "radius": 1.2, + "scale": 0.85 + }, + "_H29": { + "radius": 1.2, + "scale": 0.85 + }, + "_H30": { + "radius": 1.2, + "scale": 0.85 + }, + "_H31": { + "radius": 1.2, + "scale": 0.85 + }, + "_H32": { + "radius": 1.2, + "scale": 0.85 + }, + "_H33": { + "radius": 1.2, + "scale": 0.85 + } + } + } +} diff --git a/peleffy/data/tests/ligandParams_MAL.txt b/peleffy/data/tests/ligandParams_MAL.txt new file mode 100644 index 00000000..77333934 --- /dev/null +++ b/peleffy/data/tests/ligandParams_MAL.txt @@ -0,0 +1,53 @@ +{ + "SolventParameters": { + "Name": "OBC2", + "General": { + "solvent_dielectric": 78.5, + "solute_dielectric": 1, + "solvent_radius": 1.4, + "surface_area_penalty": 0.0054 + }, + "MAL": { + "_O1_": { + "radius": 1.5, + "scale": 0.85 + }, + "_C1_": { + "radius": 1.7, + "scale": 0.72 + }, + "_O2_": { + "radius": 1.5, + "scale": 0.85 + }, + "_C2_": { + "radius": 1.7, + "scale": 0.72 + }, + "_C3_": { + "radius": 1.7, + "scale": 0.72 + }, + "_O3_": { + "radius": 1.5, + "scale": 0.85 + }, + "_O4_": { + "radius": 1.5, + "scale": 0.85 + }, + "_H1_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H2_": { + "radius": 1.2, + "scale": 0.85 + }, + "_H3_": { + "radius": 1.2, + "scale": 0.85 + } + } + } +} diff --git a/peleffy/data/tests/unlz b/peleffy/data/tests/unlz new file mode 100644 index 00000000..d4016806 --- /dev/null +++ b/peleffy/data/tests/unlz @@ -0,0 +1,124 @@ +* LIGAND DATABASE FILE (openff_unconstrained-1.2.0.offxml) +* File generated with peleffy-1.1.0+19.gf23f003.dirty +* +UNK 16 16 26 40 0 + 1 0 M OFFT _C1_ 0 1.317292 143.024790 145.493672 + 2 1 M OFFT _C2_ 0 1.378178 121.479848 135.261146 + 3 1 M OFFT _H1_ 0 1.068815 174.514851 27.464242 + 4 2 M OFFT _C3_ 0 1.391622 142.515483 11.454595 + 5 2 M OFFT _O3_ 0 1.400866 154.118935 -168.545855 + 6 4 M OFFT _N1_ 0 1.345016 144.154750 0.000000 + 7 4 M OFFT _H2_ 0 1.077548 148.698892 179.999213 + 8 5 M OFFT _H6_ 0 1.027164 142.850910 -90.000011 + 9 6 M OFFT _N2_ 0 1.317289 142.894092 0.000000 + 10 6 S OFFT _S1_ 0 1.748054 157.283153 179.996726 + 11 10 S OFFT _O1_ 0 1.519784 141.263026 -119.861711 + 12 10 S OFFT _O2_ 0 1.502196 142.008668 -2.549918 + 13 10 S OFFT _C4_ 0 1.751433 145.957349 118.467048 + 14 13 S OFFT _H3_ 0 1.127309 135.682800 133.538266 + 15 13 S OFFT _H4_ 0 1.127287 137.879700 -111.042577 + 16 13 S OFFT _H5_ 0 1.106746 138.714887 11.765025 +NBON + 1 3.3997 0.0860 0.087170 0.0000 1.6998 0.000000000 0.000000000 + 2 3.3997 0.0860 0.118253 0.0000 1.6998 0.000000000 0.000000000 + 3 2.5106 0.0150 0.089028 0.0000 1.2553 0.000000000 0.000000000 + 4 3.3997 0.0860 0.154565 0.0000 1.6998 0.000000000 0.000000000 + 5 3.0665 0.2104 -0.357649 0.0000 1.5332 0.000000000 0.000000000 + 6 3.2500 0.1700 0.072147 0.0000 1.6250 0.000000000 0.000000000 + 7 2.5106 0.0150 0.095515 0.0000 1.2553 0.000000000 0.000000000 + 8 0.5345 0.0001 0.218400 0.0000 0.2673 0.000000000 0.000000000 + 9 3.2500 0.1700 -0.093491 0.0000 1.6250 0.000000000 0.000000000 + 10 3.5636 0.2500 -0.124933 0.0000 1.7818 0.000000000 0.000000000 + 11 2.9599 0.2100 -0.483968 0.0000 1.4800 0.000000000 0.000000000 + 12 2.9599 0.2100 -0.483968 0.0000 1.4800 0.000000000 0.000000000 + 13 3.3997 0.1094 0.225096 0.0000 1.6998 0.000000000 0.000000000 + 14 2.4714 0.0157 0.161278 0.0000 1.2357 0.000000000 0.000000000 + 15 2.4714 0.0157 0.161278 0.0000 1.2357 0.000000000 0.000000000 + 16 2.4714 0.0157 0.161278 0.0000 1.2357 0.000000000 0.000000000 +BOND + 1 2 297.210 1.456 + 1 9 489.963 1.303 + 1 3 404.208 1.086 + 2 4 404.839 1.372 + 2 5 387.876 1.369 + 4 6 378.347 1.390 + 4 7 404.208 1.086 + 6 9 403.077 1.349 + 6 10 237.668 1.757 + 10 11 543.561 1.476 + 10 12 543.561 1.476 + 10 13 257.127 1.825 + 13 14 376.894 1.094 + 13 15 376.894 1.094 + 13 16 376.894 1.094 + 5 8 556.995 0.974 +THET + 1 2 4 78.67881 128.27719 + 1 2 5 34.22767 135.36139 + 1 9 6 85.26519 114.85458 + 2 1 9 78.67881 128.27719 + 2 1 3 34.22767 135.36139 + 2 4 6 78.67881 128.27719 + 2 4 7 34.22767 135.36139 + 2 5 8 63.95595 110.94623 + 4 2 5 34.22767 135.36139 + 4 6 9 70.60133 121.02094 + 4 6 10 70.60133 121.02094 + 6 4 7 34.22767 135.36139 + 6 10 11 100.57011 104.18116 + 6 10 12 100.57011 104.18116 + 6 10 13 76.17122 96.30390 + 9 1 3 34.22767 135.36139 + 9 6 10 70.60133 121.02094 + 10 13 14 50.00416 110.81136 + 10 13 15 50.00416 110.81136 + 10 13 16 50.00416 110.81136 + 11 10 12 100.57011 104.18116 + 11 10 13 100.57011 104.18116 + 12 10 13 100.57011 104.18116 + 14 13 15 33.78876 110.24686 + 14 13 16 33.78876 110.24686 + 15 13 16 33.78876 110.24686 +PHI + 1 2 -4 6 5.37602 -1.0 2.0 + 1 2 4 7 5.37602 -1.0 2.0 + 1 2 5 8 0.87229 -1.0 2.0 + 1 9 -6 4 -0.18476 1.0 3.0 + 1 9 6 10 -0.18476 1.0 3.0 + 2 1 -9 6 6.86725 -1.0 2.0 + 2 4 -6 9 1.13135 -1.0 2.0 + 2 4 6 10 1.13135 -1.0 2.0 + 4 2 -1 9 0.93505 -1.0 2.0 + 4 2 1 3 0.93505 -1.0 2.0 + 4 2 5 8 0.87229 -1.0 2.0 + 4 6 10 11 0.51462 1.0 1.0 + 4 6 10 12 0.51462 1.0 1.0 + 4 6 10 13 -0.50503 1.0 3.0 90.0 + 6 4 2 5 5.37602 -1.0 2.0 + 6 9 1 3 6.86725 -1.0 2.0 + 6 10 13 14 0.10551 1.0 3.0 + 6 10 13 15 0.10551 1.0 3.0 + 6 10 13 16 0.10551 1.0 3.0 + 9 1 2 5 0.93505 -1.0 2.0 + 9 6 4 7 1.13135 -1.0 2.0 + 9 6 10 11 0.08264 1.0 1.0 + 9 6 10 12 0.08264 1.0 1.0 + 9 6 10 13 1.91447 1.0 1.0 + 10 6 4 7 1.13135 -1.0 2.0 + 11 10 13 14 0.10551 1.0 3.0 + 11 10 13 15 0.10551 1.0 3.0 + 11 10 13 16 0.10551 1.0 3.0 + 12 10 13 14 0.10551 1.0 3.0 + 12 10 13 15 0.10551 1.0 3.0 + 12 10 13 16 0.10551 1.0 3.0 + 5 2 1 3 0.93505 -1.0 2.0 + 5 2 4 7 5.37602 -1.0 2.0 + 1 9 -6 4 1.47170 -1.0 2.0 + 1 9 6 10 1.47170 -1.0 2.0 + 4 6 10 13 0.36495 1.0 2.0 +IPHI + 1 2 4 5 1.10000 -1.0 2.0 + 2 1 9 3 1.10000 -1.0 2.0 + 2 4 6 7 1.10000 -1.0 2.0 + 4 6 9 10 10.50000 -1.0 2.0 +END diff --git a/peleffy/forcefield/parameters.py b/peleffy/forcefield/parameters.py index 17c86185..ad1c7265 100644 --- a/peleffy/forcefield/parameters.py +++ b/peleffy/forcefield/parameters.py @@ -10,6 +10,7 @@ from collections import defaultdict +from simtk import unit from peleffy.utils import get_data_file_path from peleffy.utils import Logger @@ -282,11 +283,308 @@ def from_impact_template(molecule, impact_template_path): Returns ------- - parameters : a BaseParameterWrapper object + params : a BaseParameterWrapper object The resulting parameters wrapper + + Examples + -------- + + Obtain a parameter wrapper from an Impact template. + + >>> from peleffy.topology import Molecule + + >>> molecule = Molecule('molecule.pdb') + >>> impact_template_path = 'molz' + + >>> from peleffy.forcefield.parameters import \ + OpenForceFieldParametersWrapper + + >>> wrapper_off = OpenForceFieldParameterWrapper() + >>> parameters = wrapper_off.from_impact_template( + molecule, impact_template_path) + """ - raise NotImplementedError() + def index(atom_idx): + """ + Atom's index. + + Parameters + ---------- + index : int + The Atom's index for a WritableWrapper + + Returns + ------- + index : int + The Atom's index for a BaseParameterWrapper object + """ + return abs(int(atom_idx)) - 1 + + def zero_to_none(values): + """ + It converts a vector of zeros to None. + + Parameters + ---------- + values : list + List of parameters. + + Returns + ------- + values : list + It is set to None if all the parameters are zeros. + """ + n_atoms = len(values) + if type(values[0]) == float: + if all(value == float(0.0) for value in values): + values = [None, ] * n_atoms + if type(values[0]) == unit.quantity.Quantity: + if all(value == unit.Quantity(0, unit.angstroms) for value + in values): + values = values = [None, ] * n_atoms + return values + + def get_phase(info): + """ + It computes the phase of a Dihedral given its prefactor. PELE + prefactors can be equal to 1 or -1. If the phase constant is + different than 0 or 180, an extra column in the Impact template + specifies its value. + + Parameters + ---------- + info : list + List of parameters for this Dihedral + + Returns + ------- + phase : simtk.unit.Quantity + The phase constant of the Dihedral + """ + if len(info) > 7: + return unit.Quantity( + value=float(info[7]), + unit=unit.degree) + else: + prefactor = float(info[5]) + if prefactor == 1: + return unit.Quantity( + value=0.00, + unit=unit.degree) + if prefactor == -1: + return unit.Quantity( + value=180.00, + unit=unit.degree) + + def reindex_atom_idx(list_params, dict_index): + """ + It sorts and reindexes atoms of a parameters list according to a + dictionary. + + Parameters + ---------- + list_params : list + List of parameters to reindex + dict_index : dict + Dictionary that defines the reindexer between old and new index + + Returns + ------- + list_params : list + Updated list of parameters with the correct indexes + """ + for i, atom_info in enumerate(list_params): + for key, value in atom_info.items(): + if '_idx' in key: + list_params[i][key] = dict_index.get(value) + return list_params + + # Parse Impact template file + tag, nbon, bond, thet, phi, iphi = ([] for i in range(6)) + with open(impact_template_path, 'r') as fd: + type_info = 'tag' + for line in fd.readlines(): + if not line.startswith('*'): + if 'NBON' in line: + type_info = 'nbon' + elif 'BOND' in line: + type_info = 'bond' + elif 'THET' in line: + type_info = 'thet' + elif 'PHI' in line and 'IPHI' not in line: + type_info = 'phi' + elif 'IPHI' in line: + type_info = 'iphi' + else: + if type_info == 'tag': + tag.append(line) + if type_info == 'nbon': + nbon.append(line) + if type_info == 'bond': + bond.append(line) + if type_info == 'thet': + thet.append(line) + if type_info == 'phi': + phi.append(line) + if type_info == 'iphi': + iphi.append(line) + + # Atom names and atom types + atom_names_list, atom_types_list = ([] for i in range(2)) + for line in tag[1:]: + info = line.split() + atom_names_list.append(info[4]) + atom_types_list.append(info[3]) + + # Charges, epsilons, sigmas, SGB radius, vdW radius, gammas and alphas + charges_list, epsilons_list, sigmas_list, SGB_list, vdW_list, \ + gammas_list, alphas_list = ([] for i in range(7)) + for line in nbon: + info = line.split() + charges_list.append(unit.Quantity( + value=float(info[3]), + unit=unit.elementary_charge)) + epsilons_list.append(unit.Quantity( + value=float(info[2]), + unit=unit.kilocalorie / unit.mole)) + sigmas_list.append(unit.Quantity( + value=float(info[1]), + unit=unit.angstrom)) + SGB_list.append(unit.Quantity( + value=float(info[4]), + unit=unit.angstrom)) + vdW_list.append(unit.Quantity( + value=float(info[5]), + unit=unit.angstrom)) + gammas_list.append(float(info[6])) + alphas_list.append(float(info[7])) + + # Bonds + bonds_list = [] + for line in bond: + info = line.split() + case = {'atom1_idx': index(info[0]), + 'atom2_idx': index(info[1]), + 'eq_dist': unit.Quantity( + value=float(info[3]), + unit=unit.angstrom), + 'spring_constant': unit.Quantity( + value=float(info[2]), + unit=unit.kilocalorie + / (unit.angstrom ** 2 * unit.mole))} + bonds_list.append(case) + + # Angles + angles_list = [] + for line in thet: + info = line.split() + case = {'atom1_idx': index(info[0]), + 'atom2_idx': index(info[1]), + 'atom3_idx': index(info[2]), + 'eq_angle': unit.Quantity( + value=float(info[4]), + unit=unit.degrees), + 'spring_constant': unit.Quantity( + value=float(info[3]), + unit=unit.kilocalorie + / (unit.radian ** 2 * unit.mole))} + angles_list.append(case) + + # Impropers + impropers_list = [] + for line in iphi[:-1]: + info = line.split() + case = {'atom1_idx': index(info[0]), + 'atom2_idx': index(info[1]), + 'atom3_idx': index(info[2]), + 'atom4_idx': index(info[3]), + 'idivf': abs(float(info[5])), + 'k': unit.Quantity( + value=float(info[4]), + unit=unit.kilocalorie / unit.mole), + 'periodicity': int(float(info[6])), + 'phase': get_phase(info)} + impropers_list.append(case) + + # Propers + propers_list = [] + for line in phi: + info = line.split() + case = {'atom1_idx': index(info[0]), + 'atom2_idx': index(info[1]), + 'atom3_idx': index(info[2]), + 'atom4_idx': index(info[3]), + 'idivf': abs(float(info[5])), + 'k': unit.Quantity( + value=float(info[4]), + unit=unit.kilocalorie / unit.mole), + 'periodicity': int(float(info[6])), + 'phase': get_phase(info)} + propers_list.append(case) + + # Initialize the BaseParameterWrapper object + params = BaseParameterWrapper() + + # PDB atom names from Molecule object + ordered_pdb_atom_names = [pdb_name.replace(' ', '_') for pdb_name in + molecule.get_pdb_atom_names()] + + # Check up that the Molecule representation and the Impact template + # represent the same chemical entity + if not set(ordered_pdb_atom_names) == set(atom_names_list): + raise ValueError( + "The Impact template file {} ".format(impact_template_path) + + "does not represent the same chemical entity as the molecule.") + + # Molecule object and Impact template have the atoms in the same order + if ordered_pdb_atom_names == atom_names_list: + # Assign parameters from Impact template to the BaseParameterWrapper + # object + params['angles'] = angles_list + params['atom_names'] = atom_names_list + params['atom_types'] = atom_types_list + params['bonds'] = bonds_list + params['charges'] = charges_list + params['epsilons'] = epsilons_list + params['impropers'] = impropers_list + params['propers'] = propers_list + params['sigmas'] = sigmas_list + params['vdW_radii'] = vdW_list + params['SGB_radii'] = zero_to_none(SGB_list) + params['gammas'] = zero_to_none(gammas_list) + params['alphas'] = zero_to_none(alphas_list) + + # Molecule object and Impact template have the atoms in different order + if ordered_pdb_atom_names != atom_names_list: + # Reindexer dictionary to sort atoms as Molecule object + index_order = [atom_names_list.index(atom_name) for atom_name in + ordered_pdb_atom_names] + dict_reindex = dict(zip(index_order, range(len(index_order)))) + + # Assign parameters from Impact template to the BaseParameterWrapper + # object reordering atoms according to Molecule object atoms + params['atom_names'] = [atom_names_list[i] for i in index_order] + params['atom_types'] = [atom_types_list[i] for i in index_order] + params['charges'] = [charges_list[i] for i in index_order] + params['epsilons'] = [epsilons_list[i] for i in index_order] + params['sigmas'] = [sigmas_list[i] for i in index_order] + params['vdW_radii'] = [vdW_list[i] for i in index_order] + params['SGB_radii'] = [zero_to_none(SGB_list)[i] for i in + index_order] + params['gammas'] = [zero_to_none(gammas_list)[i] for i in + index_order] + params['alphas'] = [zero_to_none(alphas_list)[i] for i in + index_order] + params['impropers'] = reindex_atom_idx(impropers_list, + dict_reindex) + params['propers'] = reindex_atom_idx(propers_list, + dict_reindex) + params['angles'] = reindex_atom_idx(angles_list, + dict_reindex) + params['bonds'] = reindex_atom_idx(bonds_list, + dict_reindex) + return params @property def forcefield_name(self): @@ -460,7 +758,8 @@ def sigma_from_rmin_half(rmin_half): params['bonds'].append( {'atom1_idx': idx1, 'atom2_idx': idx2, - 'spring_constant': k_by_idx[idxs] / 2.0, # PELE works with half of the OFF's spring + # PELE works with half of the OFF's spring + 'spring_constant': k_by_idx[idxs] / 2.0, 'eq_dist': length_by_idx[idxs] }) @@ -475,7 +774,8 @@ def sigma_from_rmin_half(rmin_half): {'atom1_idx': idx1, 'atom2_idx': idx2, 'atom3_idx': idx3, - 'spring_constant': k_by_idx[idxs] / 2.0, # PELE works with half of the OFF's spring + # PELE works with half of the OFF's spring + 'spring_constant': k_by_idx[idxs] / 2.0, 'eq_angle': angle_by_idx[idxs] }) diff --git a/peleffy/main.py b/peleffy/main.py index 8536456a..909be3a7 100644 --- a/peleffy/main.py +++ b/peleffy/main.py @@ -65,6 +65,9 @@ def parse_args(args): type=str, help="The name of the method to use to " + "compute charges", default=DEFAULT_CHARGE_METHOD, choices=AVAILABLE_CHARGE_METHODS) + parser.add_argument('--charges_from_file', metavar="PATH", + type=str, help="The path to the file with charges", + default=None) parser.add_argument('--include_terminal_rotamers', dest="include_terminal_rotamers", action='store_true', @@ -94,8 +97,10 @@ def run_peleffy(pdb_file, forcefield_name=DEFAULT_OFF_FORCEFIELD, resolution=DEFAULT_RESOLUTION, charge_method=DEFAULT_CHARGE_METHOD, + charges_from_file=None, exclude_terminal_rotamers=True, - output=None, with_solvent=False, as_datalocal=False): + output=None, with_solvent=False, + as_datalocal=False): """ It runs peleffy. @@ -110,6 +115,9 @@ def run_peleffy(pdb_file, charge_method : str The name of the method to use to compute partial charges. Default is 'am1bcc' + charges_from_file : str + The file containing the partial charges to assign to the + molecule. Default is None exclude_terminal_rotamers : bool Whether to exclude terminal rotamers or not output : str @@ -121,6 +129,13 @@ def run_peleffy(pdb_file, Whether to save output files following PELE's DataLocal hierarchy or not """ + if charges_from_file is not None: + charge_method_str = 'file\n' \ + + ' - Charge file: {}'.format(charges_from_file) + charge_method = 'dummy' + else: + charge_method_str = charge_method + log = Logger() log.info('-' * 60) log.info('Open Force Field parameterizer for PELE', peleffy.__version__) @@ -132,7 +147,7 @@ def run_peleffy(pdb_file, log.info(' - DataLocal-like output:', as_datalocal) log.info(' - Parameterization:') log.info(' - Force field:', forcefield_name) - log.info(' - Charge method:', charge_method) + log.info(' - Charge method:', charge_method_str) log.info(' - Rotamer library:') log.info(' - Resolution:', resolution) log.info(' - Exclude terminal rotamers:', exclude_terminal_rotamers) @@ -143,6 +158,7 @@ def run_peleffy(pdb_file, from peleffy.solvent import OBC2 from peleffy.forcefield import ForceFieldSelector from peleffy.topology import Topology + from peleffy.utils import parse_charges_from_mae if not output: output = os.getcwd() @@ -167,6 +183,10 @@ def run_peleffy(pdb_file, parameters = forcefield.parameterize(molecule, charge_method=charge_method) + # Update charge parameters from the MAE file + if charges_from_file is not None: + parameters = parse_charges_from_mae(charges_from_file, parameters) + # Generate the molecular topology topology = Topology(molecule, parameters) log.info(' - Parameters were built successfully:') @@ -235,7 +255,8 @@ def main(args): exclude_terminal_rotamers=exclude_terminal_rotamers, output=args.output, with_solvent=args.with_solvent, - as_datalocal=args.as_datalocal) + as_datalocal=args.as_datalocal, + charges_from_file=args.charges_from_file) if __name__ == '__main__': diff --git a/peleffy/solvent/solvent.py b/peleffy/solvent/solvent.py index fe6c885b..3487d180 100644 --- a/peleffy/solvent/solvent.py +++ b/peleffy/solvent/solvent.py @@ -17,23 +17,39 @@ class _SolventWrapper(object): _name = None _compatibility = None - def __init__(self, topology): + def __init__(self, topologies): """ Initializes a SolventWrapper object. Parameters ---------- - topology : a Topology object + topologies : a Topology object or list[Topology object] The molecular topology representation to write as a Impact template """ - self._topology = topology - self._radii = dict.fromkeys([tuple((idx, )) - for idx in range(0, len(topology.atoms))], - unit.Quantity()) - self._scales = dict.fromkeys([tuple((idx, )) - for idx in range(0, len(topology.atoms))], - unit.Quantity()) + self._topologies = topologies + + self._initialize_dicts() + + def _initialize_dicts(self): + """ + It initializes empty radii and scales dictionaries. It also handles the + possibility of dealing with a single topology or multiple of topologies. + """ + + _multiple_topologies = isinstance(self.topologies, list) + + if not _multiple_topologies: + self._topologies = [self._topologies] + + self._radii = \ + [dict.fromkeys([tuple((idx, )) for idx in + range(0, len(topology.atoms))], unit.Quantity()) + for topology in self._topologies] + self._scales = \ + [dict.fromkeys([tuple((idx, )) for idx in + range(0, len(topology.atoms))], unit.Quantity()) + for topology in self._topologies] @property def name(self): @@ -48,26 +64,26 @@ def name(self): return self._name @property - def topology(self): + def topologies(self): """ The peleffy's Topology. Returns ------- - topology : a peleffy.topology.Topology + topologies : a Topology object or list[Topology object] The molecular topology representation to write as a Impact template """ - return self._topology + return self._topologies @property def radii(self): """ - The dict of radii of the parameterized molecule. + A list of the dicts of radii of the parameterized molecules. Returns ------- - radii : dict[atom indexes: simtk.unit.Quantity] + radii : list[dict[atom indexes: simtk.unit.Quantity]] The radius assigned to each atom of the molecule """ return self._radii @@ -75,11 +91,11 @@ def radii(self): @property def scales(self): """ - The dict of scales of the parameterized molecule. + A list of the dicts of scales of the parameterized molecules. Returns ------- - scales : dict[atom indexes: simtk.unit.Quantity] + scales : list[dict[atom indexes: simtk.unit.Quantity]] The scale assigned to each atom of the molecule """ return self._scales @@ -93,17 +109,17 @@ class _OpenFFCompatibleSolvent(_SolventWrapper): _compatibility = 'openff' - def __init__(self, topology): + def __init__(self, topologies): """ It initializes an OpenFFCompatibleSolvent. Parameters ---------- - topology : a Topology object + topologies : a Topology object or list[Topology object] The molecular topology representation to write as a Impact template """ - super().__init__(topology) + super().__init__(topologies) self._initialize_from_topology() @@ -129,11 +145,12 @@ def _initialize_from_topology(self): from peleffy.forcefield import OpenForceField forcefield = OpenForceField(self._ff_file) - parameters = forcefield.parameterize(self.topology.molecule, - charge_method='dummy') - self._radii = parameters['GBSA_radii'] - self._scales = parameters['GBSA_scales'] + for idx, topology in enumerate(self.topologies): + parameters = forcefield.parameterize(topology.molecule, + charge_method='dummy') + self._radii[idx] = parameters['GBSA_radii'] + self._scales[idx] = parameters['GBSA_scales'] def to_dict(self): """ @@ -157,19 +174,21 @@ def to_dict(self): data['SolventParameters']['General']['surface_area_penalty'] = \ round(self.surface_area_penalty.value_in_unit( unit.kilocalorie / (unit.angstrom**2 * unit.mole)), 8) - data['SolventParameters'][self.topology.molecule.tag] = dict() - atom_names = self.topology.molecule.get_pdb_atom_names() + for topology, radii, scales in zip(self._topologies, + self._radii, self._scales): + data['SolventParameters'][topology.molecule.tag] = dict() - for atom, name in zip(self.topology.molecule.rdkit_molecule.GetAtoms(), - atom_names): - name = name.replace(' ', '_') - index = atom.GetIdx() - data['SolventParameters'][self.topology.molecule.tag][name] = \ - {'radius': round(self.radii[tuple((index, ))].value_in_unit( - unit.angstrom), 5), - 'scale': round(self.scales[tuple((index, ))], 5)} + atom_names = topology.molecule.get_pdb_atom_names() + for atom, name in zip(topology.molecule.rdkit_molecule.GetAtoms(), + atom_names): + name = name.replace(' ', '_') + index = atom.GetIdx() + data['SolventParameters'][topology.molecule.tag][name] = \ + {'radius': round(radii[tuple((index, ))] + .value_in_unit(unit.angstrom), 5), + 'scale': round(scales[tuple((index, ))], 5)} return data def to_file(self, path): @@ -243,31 +262,39 @@ class _OPLS2005CompatibleSolvent(_SolventWrapper): _compatibility = 'opls2005' _PARAMS_PATH = get_data_file_path('parameters/solventParamsHCTOBC.txt') - def __init__(self, topology): + def __init__(self, topologies): """ It initializes an OPLS2005CompatibleSolvent. Parameters ---------- - topology : a Topology object + topologies : a Topology object or list[Topology object] The molecular topology representation to write as a Impact template """ - super().__init__(topology) + super().__init__(topologies) + + self._initialize_from_topology() + def _initialize_from_topology(self): + """ + Initializes a SolventWrapper object using a peleffy's + molecular Topology. + """ from peleffy.forcefield import OPLS2005ForceField from peleffy.forcefield.parameters import OPLS2005ParameterWrapper - # Parameterize with OPLS2005 only is the parameters in topology - # are not obtained with OPLS2005 - if isinstance(topology.parameters, OPLS2005ParameterWrapper): - parameters = topology.parameters - else: - forcefield = OPLS2005ForceField() - parameters = forcefield.parameterize(self.molecule) + for idx, topology in enumerate(self.topologies): + # Parameterize with OPLS2005 only if the parameters in topology + # are not obtained with OPLS2005 + if isinstance(topology.parameters, OPLS2005ParameterWrapper): + parameters = topology.parameters + else: + forcefield = OPLS2005ForceField() + parameters = forcefield.parameterize(topology.molecule) - self._radii = parameters['GBSA_radii'] - self._scales = parameters['GBSA_scales'] + self._radii[idx] = parameters['GBSA_radii'] + self._scales[idx] = parameters['GBSA_scales'] def to_file(self, path): """ @@ -284,22 +311,26 @@ def to_file(self, path): with open(self._PARAMS_PATH) as f: standard_params = f.read() - # Add parameters for non standard residues - atom_names = [param.replace('_', '') - for param in self.topology.parameters['atom_names']] - with open(path, 'w') as f: + # Write parameters for standard residues f.write(standard_params) - for atom_name, atom_type, scale, radii in zip( - atom_names, self.topology.parameters['atom_types'], - self.scales, self.radii): + # Write parameters for non standard residues + for topology, radii, scales in zip(self.topologies, + self.radii, self.scales): + + atom_names = [param.replace('_', '') for param in + topology.parameters['atom_names']] + + for atom_name, atom_type, scale, radi in \ + zip(atom_names, topology.parameters['atom_types'], + scales, radii): - f.write(self.topology.molecule.tag + 'Z'.upper() + ' ' - + atom_name + ' ' - + atom_type + ' ' - + str(scale) + ' ' - + str(radii._value) + '\n') + f.write(topology.molecule.tag + 'Z'.upper() + ' ' + + atom_name + ' ' + + atom_type + ' ' + + str(scale) + ' ' + + str(radi._value) + '\n') class OBC1(_OpenFFCompatibleSolvent): @@ -310,13 +341,13 @@ class OBC1(_OpenFFCompatibleSolvent): _ff_file = get_data_file_path('forcefields/GBSA_OBC1-1.0.offxml') _name = 'OBC1' - def __init__(self, topology): + def __init__(self, topologies): """ Initializes an OBC1 object. Parameters ---------- - topology : a Topology object + topologies : a Topology object or list[Topology object] The molecular topology representation to write as a Impact template """ @@ -324,7 +355,7 @@ def __init__(self, topology): logger = Logger() logger.warning('OBC1 is not implemented in PELE') - super().__init__(topology) + super().__init__(topologies) class OBC2(_OpenFFCompatibleSolvent): @@ -335,13 +366,13 @@ class OBC2(_OpenFFCompatibleSolvent): _ff_file = get_data_file_path('forcefields/GBSA_OBC2-1.0.offxml') _name = 'OBC2' - def __init__(self, topology): + def __init__(self, topologies): """ Initializes an OBC2 object. Parameters ---------- - topology : a Topology object + topologies : a Topology object or list[Topology object] The molecular topology representation to write as a Impact template @@ -369,7 +400,7 @@ def __init__(self, topology): >>> solvent.to_file('OBC_parameters.txt') """ - super().__init__(topology) + super().__init__(topologies) class OPLSOBC(_OPLS2005CompatibleSolvent): @@ -379,13 +410,13 @@ class OPLSOBC(_OPLS2005CompatibleSolvent): """ _name = 'OBC' - def __init__(self, topology): + def __init__(self, topologies): """ Initializes an OPLSOBC object. Parameters ---------- - topology : a Topology object + topologies : a Topology object or list[Topology object] The molecular topology representation to write as a Impact template @@ -413,4 +444,4 @@ def __init__(self, topology): >>> solvent.to_file('OBC_parameters.txt') """ - super().__init__(topology) + super().__init__(topologies) diff --git a/peleffy/tests/test_main.py b/peleffy/tests/test_main.py index e6d8cfa3..b6e2e57f 100644 --- a/peleffy/tests/test_main.py +++ b/peleffy/tests/test_main.py @@ -171,6 +171,33 @@ def test_peleffy_argparse(self): assert parsed_args.with_solvent is False, \ 'Unexpected with_solvent settings were parsed' + # Test charges_from_file argument + parsed_args = parse_args(['BHP.pdb', + '--charges_from_file', 'BHP.mae']) + + assert parsed_args.as_datalocal is False, \ + 'Unexpected as_datalocal settings were parsed' + assert parsed_args.charge_method == 'am1bcc', \ + 'Unexpected charge_method settings were parsed' + assert parsed_args.debug is False, \ + 'Unexpected debug settings were parsed' + assert parsed_args.forcefield == 'openff_unconstrained-1.3.0.offxml', \ + 'Unexpected forcefield settings were parsed' + assert parsed_args.include_terminal_rotamers is False, \ + 'Unexpected include_terminal_rotamers settings were parsed' + assert parsed_args.charges_from_file == 'BHP.mae', \ + 'Unexpected charges_from_file settings were parsed' + assert parsed_args.output is None, \ + 'Unexpected output settings were parsed' + assert parsed_args.pdb_file == 'BHP.pdb', \ + 'Unexpected pdb_file settings were parsed' + assert parsed_args.resolution == 30, \ + 'Unexpected resolution settings were parsed' + assert parsed_args.silent is False, \ + 'Unexpected silent settings were parsed' + assert parsed_args.with_solvent is False, \ + 'Unexpected with_solvent settings were parsed' + # Test include_terminal_rotamers argument parsed_args = parse_args(['methane.pdb', '--include_terminal_rotamers']) diff --git a/peleffy/tests/test_parameters.py b/peleffy/tests/test_parameters.py index 2bc2e2fd..6ff23ba9 100644 --- a/peleffy/tests/test_parameters.py +++ b/peleffy/tests/test_parameters.py @@ -17,6 +17,7 @@ from peleffy.forcefield import OpenForceField, OPLS2005ForceField from peleffy.forcefield.parameters import BaseParameterWrapper from peleffy.topology import Topology +from peleffy.template import Impact from peleffy.utils import get_data_file_path, temporary_cd @@ -144,6 +145,110 @@ def test_to_json(self): 'tests/MET_parameters_to_json.json') compare_files('parameters_to_check.json', ref_json_file) + def test_from_impact_template(self): + """ + It tests the method to generate a parameter wrapper out of an + impact template. + """ + def test_generate_OpenForceFieldParameterWrapper(molecule, + impact_template_path): + """ + It tests the method to return a OpenForceFieldParameterWrapper + object from an Impact file by comparing the reference Impact file + and the generated from the obtained Wrapper. + """ + + from peleffy.forcefield.parameters import \ + OpenForceFieldParameterWrapper + + with tempfile.TemporaryDirectory() as tmpdir: + with temporary_cd(tmpdir): + + # Assign parameters to BaseParametersWrapper object from + # an Impact Template + wrapper_off = OpenForceFieldParameterWrapper() + parameters = wrapper_off.from_impact_template( + molecule, impact_template_path) + + # Generate the new impact template + topology = Topology(molecule, parameters) + impact = Impact(topology) + impact.to_file('unlz_generated') + + # Compare the reference and generated Impact templates + compare_files(impact_template_path, 'unlz_generated') + + def test_generate_OPLS2005ParameterWrapper(molecule, + impact_template_path): + """ + It tests the method to return a OPLS2005FieldParameterWrapper + object from an Impact file by comparing the reference Impact file + and the generated from the obtained Wrapper. + """ + + from peleffy.forcefield.parameters import OPLS2005ParameterWrapper + + with tempfile.TemporaryDirectory() as tmpdir: + with temporary_cd(tmpdir): + + # Assign parameters to BaseParametersWrapper object from + # an Impact Template + wrapper_opls = OPLS2005ParameterWrapper() + parameters = wrapper_opls.from_impact_template( + molecule, impact_template_path) + + # Generate the new impact template + topology = Topology(molecule, parameters) + impact = Impact(topology) + impact.to_file('unlz_generated') + + # Compare the reference and generated Impact templates + compare_files(impact_template_path, 'unlz_generated') + + # Test with OFF parametrization (for ethylene) + pdb_path = get_data_file_path('ligands/ethylene.pdb') + molecule = Molecule(pdb_path, tag='ETL') + impact_template_path = get_data_file_path('tests/etlz') + test_generate_OpenForceFieldParameterWrapper(molecule, + impact_template_path) + + # Test with OFF parametrization (for methane) + pdb_path = get_data_file_path('ligands/methane.pdb') + molecule = Molecule(pdb_path) + impact_template_path = get_data_file_path('tests/metz') + test_generate_OpenForceFieldParameterWrapper(molecule, + impact_template_path) + + # Test with OFF parametrization (for malonate) + pdb_path = get_data_file_path('ligands/malonate.pdb') + molecule = Molecule(pdb_path) + impact_template_path = get_data_file_path('tests/malz') + test_generate_OpenForceFieldParameterWrapper(molecule, + impact_template_path) + + # Test with OPLS parametrization (for ethylene) + pdb_path = get_data_file_path('ligands/ethylene.pdb') + molecule = Molecule(pdb_path, tag='ETL') + impact_template_path = get_data_file_path('tests/OPLS_etlz') + test_generate_OPLS2005ParameterWrapper(molecule, + impact_template_path) + + # Test with molecule with phase different than 0 or 180 + # Load molecule, parameterize and generate Impact template + molecule = Molecule(smiles='c1c(c(n(n1)S(=O)(=O)C))O') + impact_template_path = get_data_file_path('tests/unlz') + test_generate_OpenForceFieldParameterWrapper(molecule, + impact_template_path) + + # The molecule and Impact template do no represent the same chemical + # entity + with pytest.raises(ValueError): + pdb_path = get_data_file_path('ligands/ethylene.pdb') + molecule = Molecule(pdb_path, tag='ETL') + impact_template_path = get_data_file_path('tests/metz') + test_generate_OpenForceFieldParameterWrapper(molecule, + impact_template_path) + class TestBonds(object): """ diff --git a/peleffy/tests/test_solvent.py b/peleffy/tests/test_solvent.py index b2f392c2..2645cd46 100644 --- a/peleffy/tests/test_solvent.py +++ b/peleffy/tests/test_solvent.py @@ -6,8 +6,8 @@ from peleffy.utils import get_data_file_path, temporary_cd from peleffy.topology import Molecule, Topology -from peleffy.forcefield import OPLS2005ForceField -from peleffy.solvent import OPLSOBC +from peleffy.forcefield import OPLS2005ForceField, OpenForceField +from peleffy.solvent import OPLSOBC, OBC2 class TestSolvent(object): @@ -15,6 +15,123 @@ class TestSolvent(object): It contains all the tests that validate the solvent-template generator. """ + def test_single_topology(self): + """ + It tests the class that generates a OpenFFCompatibleSolvent object for + a single topology. + """ + from .utils import compare_dicts + import json + + TEMPLATE_PARAMS_MAL = get_data_file_path('tests/ligandParams_MAL.txt') + + # Loads the molecule + molecule = Molecule(path=get_data_file_path('ligands/malonate.pdb'), + tag='MAL') + + # Sets forcefield and parameterizes it + ff = OpenForceField('openff_unconstrained-1.2.1.offxml') + parameters = ff.parameterize(molecule, charge_method='gasteiger') + + # Initializes topology + topology = Topology(molecule, parameters) + + # Initializes solvent and gets parameters file + solvent = OBC2(topology) + solvent_dict = solvent.to_dict() + + # Loads reference dict from template + with open(TEMPLATE_PARAMS_MAL, 'r') as f: + reference_dict = json.load(f) + + # Compare the output parameters dict with the reference parameters + compare_dicts(reference_dict, solvent_dict) + + def test_multiple_topologies(self): + """ + It tests the class that generates a OpenFFCompatibleSolvent object for + multiple topologies. + """ + from .utils import compare_dicts, merge_dicts + + # Path to multiple non standard residues + pdb_path_MAL = get_data_file_path('ligands/malonate.pdb') + pdb_path_MET = get_data_file_path('ligands/methane.pdb') + + # Force Field to parameterize the molecules + ff = OpenForceField('openff_unconstrained-1.2.1.offxml') + + # Topology of malonate + mol_MAL = Molecule(path=pdb_path_MAL, tag='MAL') + parameters_MAL = ff.parameterize(mol_MAL, charge_method='gasteiger') + topology_MAL = Topology(mol_MAL, parameters_MAL) + + # Topology of methane + mol_MET = Molecule(path=pdb_path_MET, tag='MET') + parameters_MET = ff.parameterize(mol_MET, charge_method='gasteiger') + topology_MET = Topology(mol_MET, parameters_MET) + + # List containing both topologies + topologies = [topology_MAL, topology_MET] + + # Generate the Solvent parameters dictionaries + solvent_MAL_dict = OBC2(topology_MAL).to_dict() + solvent_MET_dict = OBC2(topology_MET).to_dict() + solvent_dict = OBC2(topologies).to_dict() + + # Check that merging both single topology dicitionaries we obtain the + # same dictionary that using multiple topologies + compare_dicts(merge_dicts(solvent_MAL_dict['SolventParameters'], + solvent_MET_dict['SolventParameters']), + solvent_dict['SolventParameters']) + + def test_multiple_topologies_writer(self): + """ + It tests the class that generates a OpenFFCompatibleSolvent object for multiple topologies. It compares the outcome of the Solvent writer with + a reference file. + """ + from .utils import compare_dicts, parameterize_opls2005 + import json + + TEMPLATE_PARAMS = get_data_file_path('tests/ligandParams.txt') + + with tempfile.TemporaryDirectory() as tmpdir: + with temporary_cd(tmpdir): + path_OXO = get_data_file_path('tests/MRO_oleic/OXO.pdb') + path_OLC = get_data_file_path('tests/MRO_oleic/OLC.pdb') + + ff = OpenForceField('openff_unconstrained-1.2.1.offxml') + opls2005 = OPLS2005ForceField() + + # Group OXO + m_OXO = Molecule(path_OXO) + ffld_file = get_data_file_path('tests/OXO_ffld_output.txt') + parameters_OXO = parameterize_opls2005(opls2005, m_OXO, + ffld_file) + topology_OXO = Topology(m_OXO, parameters_OXO) + + # Acid oleic + m_OLC = Molecule(path_OLC) + parameters_OLC = ff.parameterize(m_OLC, + charge_method='gasteiger') + topology_OLC = Topology(m_OLC, parameters_OLC) + + # Multiple topologies + topologies = [topology_OXO, topology_OLC] + solvent = OBC2(topologies) + solvent.to_file('OBC_parameters.txt') + + # Loads reference dict from template + with open(TEMPLATE_PARAMS, 'r') as f: + reference_dict = json.load(f) + + # Loads the generated template into a dict + with open('OBC_parameters.txt', 'r') as f: + solvent_dict = json.load(f) + + # Compare the output parameters dict with the reference parameters + compare_dicts(reference_dict, solvent_dict) + def test_OBCOPLS_writer(self): """ It test the function that writes a OPLS2005CompatibleSolvent object to @@ -61,7 +178,7 @@ def test_OBCOPLS_writer_ligand(pdbfile, tag_name, ffld_name, # Initializes topology topology = Topology(molecule, parameters) - # Initializes solvent and getsparameters file + # Initializes solvent and gets parameters file solvent = OPLSOBC(topology) solvent.to_file('OBC_parameters.txt') diff --git a/peleffy/tests/test_utils.py b/peleffy/tests/test_utils.py index b4571f99..d0705a59 100644 --- a/peleffy/tests/test_utils.py +++ b/peleffy/tests/test_utils.py @@ -489,3 +489,134 @@ def test_folder_creation(self): path_dir = os.path.dirname(path) assert os.path.isdir(path_dir) is True, \ 'This directory should exist' + +class TestMAEParser(object): + """ + It contains all the tests to validate functions that parse MAE files. + """ + def test_parse_charges_from_mae(self): + """ + It tests the MAE parser for assigning partial charges from an external + file. + """ + from peleffy.utils import get_data_file_path, parse_charges_from_mae + from peleffy.topology import Molecule + from peleffy.forcefield import OpenForceField + + FORCEFIELD = 'openff_unconstrained-1.2.0.offxml' + + PATH_MAE_MAT = get_data_file_path('tests/MAT.mae') + PATH_PDB_MAT= get_data_file_path('tests/MAT.pdb') + PATH_MAE_BHP = get_data_file_path('ligands/BHP.mae') + PATH_PDB_BHP = get_data_file_path('ligands/BHP.pdb') + PATH_MAE_ETL = get_data_file_path('ligands/ethylene.mae') + PATH_PDB_ETL = get_data_file_path('ligands/ethylene.pdb') + PATH_PDB_MAL = get_data_file_path('ligands/malonate.pdb') + + CHARGES_REFERENCE_BHP = [[-0.35703, 'O1'], + [-0.59535, 'O2'], + [-0.50292, 'O3'], + [-0.25243, 'C1'], + [0.30438 , 'C2'], + [0.22092 , 'C3'], + [0.54336 , 'C4'], + [-0.20569, 'C5'], + [-0.20192 , 'C6'], + [0.16631 , 'C7'], + [0.02422 , 'C8'], + [-0.09115, 'C9'], + [-0.09904, 'C10'], + [-0.15673, 'C11'], + [-0.13245, 'C12'], + [-0.17806 , 'C13'], + [-0.12489, 'C14'], + [-0.09307 , 'C15'], + [-0.08973, 'C16'], + [0.05397 , 'H1'], + [0.07338 , 'H2'], + [0.04514 , 'H3'], + [0.12979 , 'H4'], + [0.11025 , 'H5'], + [0.04054 , 'H6'], + [0.04581 , 'H7'], + [0.11444 , 'H8'], + [0.11761 , 'H9'], + [0.37274 , 'H10'], + [0.11825 , 'H11'], + [0.12584 , 'H12'], + [0.1381 , 'H13'], + [0.11696 , 'H14'], + [0.11148 , 'H15'], + [0.10697 , 'H16']] + + CHARGES_REFERENCE_MAT = [[-0.18938 , 'F1' ], + [-0.21715 , 'F2'], + [-0.21234 , 'F3'], + [-0.39736 , 'O1'], + [-0.58890 , 'O2'], + [-1.00825 , 'N1'], + [0.72066 , 'C1'], + [-0.06281 , 'C2'], + [-0.67474 , 'C3'], + [0.10391 , 'C4'], + [0.16293 , 'C5'], + [-0.61076 , 'C6'], + [0.78183 , 'C7'], + [0.27041 , 'C8'], + [-0.48769 , 'C9'], + [0.15704 , 'C10'], + [-0.02646 , 'H1'], + [-0.08394 , 'H2'], + [-0.01308 , 'H3'], + [0.14006 , 'H4'], + [0.12960 , 'H5'], + [0.31245 , 'H6'], + [0.30268 , 'H7'], + [0.17026 , 'H8'], + [0.15782 , 'H9'], + [0.03175 , 'C11'], + [0.03894 , 'H10'], + [0.07509 , 'H11'], + [0.01743 , 'H12']] + + # Check up correct charges for malonate + m = Molecule(PATH_PDB_MAT) + openff = OpenForceField(FORCEFIELD) + parameters = openff.parameterize(m, charge_method='dummy') + parameters = parse_charges_from_mae(PATH_MAE_MAT, parameters) + + for charge, atom_name in zip(parameters['charges'], + parameters['atom_names']): + assert [charge._value, atom_name.replace('_', '')] in \ + CHARGES_REFERENCE_MAT, \ + 'Incorrect charge value for {}.'.format(atom_name) + + # Check up correct charges for BHP + m = Molecule (PATH_PDB_BHP) + openff = OpenForceField(FORCEFIELD) + parameters = openff.parameterize(m, charge_method='dummy') + parameters = parse_charges_from_mae(PATH_MAE_BHP, parameters) + + for charge, atom_name in zip(parameters['charges'], + parameters['atom_names']): + assert [charge._value, atom_name.replace('_', '')] in \ + CHARGES_REFERENCE_BHP, \ + 'Incorrect charge value for {}.'.format(atom_name) + + # Error: MAE file without charges information + m = Molecule(PATH_PDB_ETL) + openff = OpenForceField(FORCEFIELD) + parameters = openff.parameterize(m, charge_method='dummy') + with pytest.raises(ValueError): + _ = parse_charges_from_mae(PATH_MAE_ETL, parameters) + + # Error: Inconsistency between Moelcule atom names and MAE atom names + m = Molecule(PATH_PDB_MAL) + openff = OpenForceField(FORCEFIELD) + parameters = openff.parameterize(m, charge_method='dummy') + with pytest.raises(ValueError): + _ = parse_charges_from_mae(PATH_PDB_BHP, parameters) + + + + diff --git a/peleffy/tests/utils.py b/peleffy/tests/utils.py index 7bfe8266..f57eba88 100644 --- a/peleffy/tests/utils.py +++ b/peleffy/tests/utils.py @@ -115,6 +115,27 @@ def compare_dicts(dict1, dict2): + 'dictionary1: {}, dictionary2: {}'.format(value, dict2[key]) +def merge_dicts(*dict_args): + """ + Given any number of dictionaries, shallow copy and merge into a new dict, + precedence goes to key-value pairs in latter dictionaries. + + Parameters + ---------- + **dict_args : dict + Dictionary to merge + + Returns + ------- + merged_dict : str + Merged dictionary + """ + merged_dict = {} + for dictionary in dict_args: + merged_dict.update(dictionary) + return merged_dict + + def check_parameters(topology, expected_nonbonding=None, expected_bonds=None, expected_angles=None, expected_propers=None, expected_impropers=None): diff --git a/peleffy/topology/molecule.py b/peleffy/topology/molecule.py index 06831574..4290493d 100644 --- a/peleffy/topology/molecule.py +++ b/peleffy/topology/molecule.py @@ -176,9 +176,9 @@ def _pdb_checkup(self, path): with open(path) as pdb_file: for line in pdb_file: if line.startswith('ATOM') or line.startswith('HETATM'): - atom_id.append(line[13:16]) - res_name.append(line[18:20]) - res_id.append(line[23:26]) + atom_id.append(line[12:16]) + res_name.append(line[17:20]) + res_id.append(line[22:26]) if line.startswith('CONECT'): connectivity = True diff --git a/peleffy/utils/utils.py b/peleffy/utils/utils.py index de68bcd2..603a3f95 100644 --- a/peleffy/utils/utils.py +++ b/peleffy/utils/utils.py @@ -11,6 +11,7 @@ "unit_to_string", "quantity_to_string", "convert_all_quantities_to_string", + "parse_charges_from_mae", "Logger" ] @@ -224,6 +225,77 @@ def convert_all_quantities_to_string(data_structure): return obj_to_return +def parse_charges_from_mae(path, parameters): + """ + It reads an external file containing the partial charges to assign to the + Molecule representation and updates the BaseParameterWrapper object + containing the molecule's parameters. + + Parameters + ---------- + path : str + Path to the MAE file with the charges information. + params : a BaseParameterWrapper object + The BaseParameterWrapper object to update the charges + + Returns + ------- + parameters : a BaseParameterWrapper object + The BaseParameterWrapper object with the updated charges. + """ + import re + + # Read external file containing the partial charges information + params_info, params_list = ([] for i in range(2)) + copy = False + with open(path, 'r') as file: + for line in file.readlines(): + if bool(re.match(r' m_atom\[(.*?)\] {', line)): + copy = True + type_data = 'info' + if ':::' in line: + type_data = 'params' + if '}' in line: + copy = False + if copy is True and type_data == 'info': + params_info.append(line) + if copy is True and type_data == 'params': + params_list.append(line) + params_info = [p.replace('\n', '').strip() for p in params_info[1:]] + params_list = [l.replace('"', '').split() for l in params_list[1:-1]] + + # Get the index of the atom name and charge from the parameter's list + idx_charges, idx_atom_name = (None for i in range(2)) + for idx, line in enumerate(params_info): + if 's_m_pdb_atom_name' in line: + idx_atom_name = idx + if 'r_m_charge1' in line: + idx_charges = idx + if idx_charges is None or idx_atom_name is None: + raise ValueError( + " {} does not contain charges information. ".format(path)) + + # Creates a charges by atom name dictionary + d = {} + for line in params_list: + d[line[idx_atom_name]] = line[idx_charges] + + # Update the charges in BaseParameterWrapper object + new_charges_parameters = [] + for atom_name in parameters['atom_names']: + atom_name = atom_name.replace('_', '') + if atom_name in d: + new_charges_parameters.append(unit.Quantity( + value=float(d.get(atom_name)), + unit=unit.elementary_charge)) + else: + raise ValueError( + "Molecule atom name {} does not match with ".format(atom_name) + + "any external file atom name's.") + parameters['charges'] = new_charges_parameters + return parameters + + class Logger(object): """ It contains all the required methods to handle logging messages.