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

Random placement linkers #15

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions pycomplexes/pycomplexes/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,12 @@ def __init__(self, node, name, randomize=False, box=None):

# guess connections for gaussian domains
guessed_connections = []
flag_linkers_plus_random_placement=False
for dom in self.domains:
n = dom.node
if dom.type == "gaussian":
if randomize:
flag_linkers_plus_random_placement=True
start_atom = u.select_atoms(n["start_connection"][1])
if start_atom.n_atoms != 1:
raise RuntimeError(
Expand All @@ -287,7 +290,11 @@ def __init__(self, node, name, randomize=False, box=None):
}
guessed_connections.append(con3)
dom._metadata['connection_id'] = len(guessed_connections) - 1

if flag_linkers_plus_random_placement:
print("WARNING: You used the randomized starting position in combination with Gaussian linker domains!")
print("The random placement does not respect the distance restraints, " +
"which are implied by the Gaussian linker domains")
print("We strongly recommend not to combine random initial placement with Gaussian Linker domains!")

# update connections
connections = node.get("connections", dict())
Expand Down Expand Up @@ -477,7 +484,7 @@ def parser(p):
p.add_argument("--debye_length", type=float, default=10)
p.add_argument("--dielectric_constant", type=float, default=80)
p.add_argument(
"--random", type=bool, help="random placement of the topologies in the box"
"--random", action="store_true", help="random placement of the topologies in the box"
)
p.add_argument(
"--list_forcefields",
Expand Down
13 changes: 2 additions & 11 deletions tutorials/Linker/chmp3_simulations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"outputs": [],
"source": [
"%%writefile chmp3.top\n",
"box: [100, 100, 100]\n",
"box: [200, 200, 200]\n",
"topology:\n",
" CHMP3:\n",
" coordinate-file: chmp3.pdb\n",
Expand Down Expand Up @@ -59,7 +59,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pycomplexes convert chmp3.top chmp3.cplx --random=True"
"!pycomplexes convert chmp3.top chmp3.cplx"
]
},
{
Expand Down Expand Up @@ -126,15 +126,6 @@
"!pycomplexes visualize -cc config.yaml"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pwd"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down