You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nodes/playground/prepareFEP.ipynb
+3-67Lines changed: 3 additions & 67 deletions
Original file line number
Diff line number
Diff line change
@@ -118,49 +118,7 @@
118
118
"execution_count": null,
119
119
"metadata": {},
120
120
"outputs": [],
121
-
"source": [
122
-
"node.addInput(\"input1\", BSS.Gateway.FileSet(help=\"A topology and coordinates file\"))\n",
123
-
"node.addInput(\"input2\", BSS.Gateway.FileSet(help=\"A topology and coordinates file\"))\n",
124
-
"node.addInput(\n",
125
-
"\"prematch\",\n",
126
-
" BSS.Gateway.String(\n",
127
-
" help=\"list of atom indices that are matched between input2 and input1. Syntax is of the format 1-3,4-8,9-11... Ignored if a mapping is provided\",\n",
128
-
" default=\"\",\n",
129
-
" ),\n",
130
-
")\n",
131
-
"node.addInput(\n",
132
-
"\"mapping\",\n",
133
-
" BSS.Gateway.File(\n",
134
-
" help=\"csv file that contains atom indices in input1 mapped ot atom indices in input2\",\n",
135
-
" optional=True,\n",
136
-
" ),\n",
137
-
")\n",
138
-
"node.addInput(\n",
139
-
"\"timeout\",\n",
140
-
" BSS.Gateway.Time(\n",
141
-
" help=\"The timeout for the maximum common substructure search\",\n",
142
-
" default=10 * BSS.Units.Time.second,\n",
143
-
" ),\n",
144
-
")\n",
145
-
"node.addInput(\n",
146
-
"\"allow_ring_breaking\",\n",
147
-
" BSS.Gateway.Boolean(\n",
148
-
" help=\"Whether to allow opening/closing of rings during merge\", default=False\n",
149
-
" ),\n",
150
-
")\n",
151
-
"node.addInput(\n",
152
-
"\"allow_ring_size_change\",\n",
153
-
" BSS.Gateway.Boolean(\n",
154
-
" help=\"Whether to allow ring size changes during merge\", default=False\n",
155
-
" ),\n",
156
-
")\n",
157
-
"node.addInput(\n",
158
-
"\"output\",\n",
159
-
" BSS.Gateway.String(\n",
160
-
" help=\"The root name for the files describing the perturbation input1->input2.\"\n",
161
-
" ),\n",
162
-
")"
163
-
]
121
+
"source": "node.addInput(\"input1\", BSS.Gateway.FileSet(help=\"A topology and coordinates file\"))\nnode.addInput(\"input2\", BSS.Gateway.FileSet(help=\"A topology and coordinates file\"))\nnode.addInput(\n \"prematch\",\n BSS.Gateway.String(\n help=\"list of atom indices that are matched between input2 and input1. Syntax is of the format 1-3,4-8,9-11... Ignored if a mapping is provided\",\n default=\"\",\n ),\n)\nnode.addInput(\n \"mapping\",\n BSS.Gateway.File(\n help=\"csv file that contains atom indices in input1 mapped ot atom indices in input2\",\n optional=True,\n ),\n)\nnode.addInput(\n \"timeout\",\n BSS.Gateway.Time(\n help=\"The timeout for the maximum common substructure search\",\n default=10 * BSS.Units.Time.second,\n ),\n)\nnode.addInput(\n \"allow_ring_breaking\",\n BSS.Gateway.Boolean(\n help=\"Whether to allow opening/closing of rings during merge\", default=False\n ),\n)\nnode.addInput(\n \"allow_ring_size_change\",\n BSS.Gateway.Boolean(\n help=\"Whether to allow ring size changes during merge\", default=False\n ),\n)\nnode.addInput(\n \"max_path\",\n BSS.Gateway.Integer(\n help=\"Maximum path length used when searching for rings. Increase for very large macrocycles.\",\n default=50,\n minimum=1,\n ),\n)\nnode.addInput(\n \"max_ring_size\",\n BSS.Gateway.Integer(\n help=\"Maximum ring size considered when checking for ring size changes.\",\n default=24,\n minimum=1,\n ),\n)\nnode.addInput(\n \"output\",\n BSS.Gateway.String(\n help=\"The root name for the files describing the perturbation input1->input2.\"\n ),\n)"
164
122
},
165
123
{
166
124
"cell_type": "code",
@@ -279,29 +237,7 @@
279
237
"execution_count": null,
280
238
"metadata": {},
281
239
"outputs": [],
282
-
"source": [
283
-
"# Align lig2 to lig1 based on the best mapping (inverted). The molecule is aligned based\n",
284
-
"# on a root mean squared displacement fit to find the optimal translation vector\n",
285
-
"# (as opposed to merely taking the difference of centroids).\n",
"# Make sure the box vectors are in reduced form.\n",
302
-
"system1.reduceBoxVectors()\n",
303
-
"system1.rotateBoxVectors()"
304
-
]
240
+
"source": "# Align lig2 to lig1 based on the best mapping (inverted). The molecule is aligned based\n# on a root mean squared displacement fit to find the optimal translation vector\n# (as opposed to merely taking the difference of centroids).\nlig2 = BSS.Align.rmsdAlign(lig2, lig1, inverted_mapping)\n\n# Merge the two ligands based on the mapping.\nmerged = BSS.Align.merge(\n lig1,\n lig2,\n mapping,\n allow_ring_breaking=node.getInput(\"allow_ring_breaking\"),\n allow_ring_size_change=node.getInput(\"allow_ring_size_change\"),\n max_path=node.getInput(\"max_path\"),\n max_ring_size=node.getInput(\"max_ring_size\"),\n)\n\n# Create a composite system\nsystem1.removeMolecules(lig1)\nsystem1.addMolecules(merged)\n\n# Make sure the box vectors are in reduced form.\nsystem1.reduceBoxVectors()\nsystem1.rotateBoxVectors()"
0 commit comments