Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smiles reader #28

Merged
merged 25 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d1ff9c
Fix solvent parameters file name
martimunicoy Aug 6, 2020
2f3605d
Merge branch 'devel' into bug_fixing
martimunicoy Aug 6, 2020
01a1d9a
Add TODO regarding the extension of the core
martimunicoy Aug 6, 2020
ceeb681
Set core to hold one rotatable bond
martimunicoy Aug 6, 2020
7dbdbd7
Improvements in rotamers tests
martimunicoy Aug 6, 2020
a404194
Fix type of terminal rotamers to ignore parameter
martimunicoy Aug 7, 2020
3628443
Reformat rotamer classes
martimunicoy Aug 7, 2020
a01cdba
Fix minor typo
martimunicoy Aug 7, 2020
4c64a83
Fix bugs in main
martimunicoy Aug 7, 2020
139cb76
Remove code to include a rotatable bond to core
martimunicoy Aug 7, 2020
5d92948
Enhance rotatable bonds detector
martimunicoy Aug 10, 2020
11664e9
Fix bugs
martimunicoy Aug 10, 2020
dbcd143
Fix typos
martimunicoy Aug 10, 2020
59b9df1
Fix bug in the rotatable bond detector
martimunicoy Aug 10, 2020
28f8181
Fix bug in the rotamer graph computer
martimunicoy Aug 10, 2020
d27acde
Add specific conditions to rotatable bond detector
martimunicoy Aug 10, 2020
1978cd2
Improve rotamer handlers and parameters
martimunicoy Aug 24, 2020
a8f6c43
Add function to construct RDKit molecule from SMILES
martimunicoy Aug 24, 2020
3ae90b4
Atom names for SMILES and fix other bugs
martimunicoy Aug 24, 2020
637640a
Add Molecule example
martimunicoy Aug 24, 2020
b2d86f0
Update Parameterize.ipynb
martimunicoy Aug 24, 2020
ad898af
Add asserts to validate the method
martimunicoy Aug 24, 2020
b972901
Assign atom names when loading an SMILES molecule
martimunicoy Aug 24, 2020
975f4f0
Update rotamers test
martimunicoy Aug 24, 2020
bc129cd
Clean rotamer class
martimunicoy Aug 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions offpele/data/ligands/ammonium.pdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
HETATM 1 N1 UNL 1 0.002 0.023 -0.006 1.00 0.00 N1+
HETATM 2 H1 UNL 1 0.536 -0.051 0.886 1.00 0.00 H
HETATM 3 H2 UNL 1 -0.644 0.846 -0.038 1.00 0.00 H
HETATM 4 H3 UNL 1 0.705 0.017 -0.775 1.00 0.00 H
HETATM 5 H4 UNL 1 -0.598 -0.835 -0.068 1.00 0.00 H
CONECT 1 2 3 4 5
END
16 changes: 16 additions & 0 deletions offpele/data/ligands/malonate.pdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
HETATM 1 O1 UNL 1 -1.598 -1.076 1.038 1.00 0.00 O
HETATM 2 C1 UNL 1 -1.509 -0.220 0.134 1.00 0.00 C
HETATM 3 O2 UNL 1 -2.594 0.553 -0.220 1.00 0.00 O1-
HETATM 4 C2 UNL 1 -0.228 -0.031 -0.564 1.00 0.00 C
HETATM 5 C3 UNL 1 0.811 0.299 0.424 1.00 0.00 C
HETATM 6 O3 UNL 1 2.138 0.539 0.046 1.00 0.00 O
HETATM 7 O4 UNL 1 0.529 0.371 1.629 1.00 0.00 O
HETATM 8 H1 UNL 1 0.047 -0.941 -1.147 1.00 0.00 H
HETATM 9 H2 UNL 1 -0.338 0.776 -1.310 1.00 0.00 H
HETATM 10 H3 UNL 1 2.740 -0.269 -0.031 1.00 0.00 H
CONECT 1 2 2
CONECT 2 3 4
CONECT 4 5 8 9
CONECT 5 6 7 7
CONECT 6 10
END
26 changes: 26 additions & 0 deletions offpele/data/ligands/trimethylglycine.pdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
HETATM 1 C1 UNL 1 -0.071 -1.459 -0.304 1.00 0.00 C
HETATM 2 N1 UNL 1 -0.237 -0.057 -0.095 1.00 0.00 N1+
HETATM 3 C2 UNL 1 -1.150 0.412 -1.153 1.00 0.00 C
HETATM 4 C3 UNL 1 -0.923 0.191 1.157 1.00 0.00 C
HETATM 5 C4 UNL 1 0.942 0.732 -0.249 1.00 0.00 C
HETATM 6 C5 UNL 1 2.046 0.408 0.633 1.00 0.00 C
HETATM 7 O1 UNL 1 3.116 1.052 0.564 1.00 0.00 O
HETATM 8 O2 UNL 1 1.991 -0.597 1.577 1.00 0.00 O1-
HETATM 9 H1 UNL 1 -0.318 -1.760 -1.343 1.00 0.00 H
HETATM 10 H2 UNL 1 -0.821 -1.989 0.347 1.00 0.00 H
HETATM 11 H3 UNL 1 0.903 -1.865 -0.059 1.00 0.00 H
HETATM 12 H4 UNL 1 -0.567 0.400 -2.104 1.00 0.00 H
HETATM 13 H5 UNL 1 -2.067 -0.176 -1.186 1.00 0.00 H
HETATM 14 H6 UNL 1 -1.369 1.481 -0.953 1.00 0.00 H
HETATM 15 H7 UNL 1 -1.903 0.672 1.034 1.00 0.00 H
HETATM 16 H8 UNL 1 -1.108 -0.781 1.667 1.00 0.00 H
HETATM 17 H9 UNL 1 -0.323 0.825 1.846 1.00 0.00 H
HETATM 18 H10 UNL 1 1.237 0.709 -1.316 1.00 0.00 H
HETATM 19 H11 UNL 1 0.622 1.801 -0.063 1.00 0.00 H
CONECT 1 2 9 10 11
CONECT 2 3 4 5
CONECT 3 12 13 14
CONECT 4 15 16 17
CONECT 5 6 18 19
CONECT 6 7 7 8
END
275 changes: 275 additions & 0 deletions offpele/examples/Molecule.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Molecule definitions\n",
"This notebook shows the two available methods that can be used to define a molecule object in `offpele`. It can accept either a PDB file or a SMILES tag."
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"from offpele.topology import Molecule\n",
"from offpele.utils import get_data_file_path\n",
"from simtk import unit"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"# Get paths to PDB files\n",
"AMMONIUM_PDB = get_data_file_path('ligands/ammonium.pdb')\n",
"MALONATE_PDB = get_data_file_path('ligands/malonate.pdb')\n",
"TRIMETHYLGLYCINE_PDB = get_data_file_path('ligands/trimethylglycine.pdb')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ammonium"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" - Loading molecule from RDKit\n",
" - Generating rotamer library\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6ef432604fce46449cb01163a0d80937",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = Molecule(AMMONIUM_PDB)\n",
"m.off_molecule"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" - Constructing molecule from a SMILES tag with RDKit\n",
" - Generating rotamer library\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9ef8a6bcb4604a36841e2cba619021f4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = Molecule(smiles='[NH4+]')\n",
"m.off_molecule"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Malonate"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" - Loading molecule from RDKit\n",
" - Generating rotamer library\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d9d06088dca545eba8264513d0a5d583",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = Molecule(MALONATE_PDB)\n",
"m.off_molecule"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" - Constructing molecule from a SMILES tag with RDKit\n",
" - Generating rotamer library\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8e39907d119c4d8ca34aeb94cceb5b4d",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = Molecule(smiles='O=C([O-])CC(O)=O')\n",
"m.off_molecule"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Trimethylglycine"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" - Loading molecule from RDKit\n",
" - Generating rotamer library\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "61d2fc78a8884bb0911e2b081ead9bcc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = Molecule(TRIMETHYLGLYCINE_PDB)\n",
"m.off_molecule"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" - Constructing molecule from a SMILES tag with RDKit\n",
" - Generating rotamer library\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a252655daacb45188dae2ab895febc58",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = Molecule(smiles='C[N+](C)(C)CC(=O)[O-]')\n",
"m.off_molecule"
]
}
],
"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
}
Loading