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

fix issue 285 #331

Merged
merged 13 commits into from
Apr 22, 2024
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
262 changes: 228 additions & 34 deletions polyply/data/martini3/aminoacids.ff

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions polyply/data/martini3/citations.bib
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ @article{M3_PDMS
year={2022},
publisher={Royal Society of Chemistry}
}

@article{M3_GO,
title={GōMartini 3: From large conformational changes in proteins to environmental bias corrections},
author={Souza, Paulo C. T. and Araujo, Luis P. Borges and Brasnett, Chris and Moreira, Rodrigo A. and Grunewald, Fabian and Park, Peter and Wang, Liguo and Razmazma, Hafez and Borges-Araujo, Ana C. and Cofas-Vargas, Luis F. and Monticelli, Luca and Mera-Adasme, Raul and Melo, Manuel N. and Wu, Sangwook and Marrink, Siewert J. and Poma, Adolfo B. and Thallmair, Sebastian},
url={https://www.biorxiv.org/content/10.1101/2024.04.15.589479v1},
doi={10.1101/2024.04.15.589479},
year={2024},
}
12 changes: 8 additions & 4 deletions polyply/src/generate_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,23 @@ def compute_volume(block, coords, nonbond_params, treshold=1e-18):
res_center_of_geometry = center_of_geometry(points)
geom_vects = np.zeros((n_atoms, 3))
idx = 0

radii = []
for node, coord in coords.items():
atom_key = block.nodes[node]["atype"]
rad = float(nonbond_params[frozenset([atom_key, atom_key])]["nb1"])
diff = coord - res_center_of_geometry
if np.linalg.norm(diff) > treshold:
geom_vects[idx, :] = diff + u_vect(diff) * rad
idx += 1

if geom_vects.shape[0] > 1:
else:
radii.append(rad)
# make sure geom_vects is not just an array of zeros
# this can happen when multiple beads are stacked for
# example
if np.any(geom_vects):
radgyr = radius_of_gyration(geom_vects)
else:
radgyr = rad
radgyr = max(radii)

return radgyr

Expand Down
5 changes: 3 additions & 2 deletions polyply/src/minimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def optimize_geometry(block, coords, inter_types=[], tolerance={"angles": 5,
"""
n_atoms = len(coords)
atom_to_idx = OrderedDict(zip(list(coords.keys()), range(0, n_atoms)))
positions = np.array(list(coords.values()))
positions = np.ravel(np.array(list(coords.values())))

def target_function(positions):
energy = 0
Expand All @@ -183,7 +183,8 @@ def target_function(positions):
energy += new
return energy

opt_results = scipy.optimize.minimize(target_function, positions, method='L-BFGS-B',
opt_results = scipy.optimize.minimize(target_function, positions,
method='L-BFGS-B',
options={'ftol': 0.001, 'maxiter': 100})

# evaluate if optimization was successful
Expand Down
2 changes: 2 additions & 0 deletions polyply/tests/test_data/library_tests/martini3/PROT/PNt.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> PNt PROTEIN
DWNNQSIVKTGERQHGIHIQGSDPGGVRTASGTTIKVSGRQAQGILLENPAAELQFRNGSVTSSGQLSDDGIRRFLGTVTVKAGKLVADHATLANVGDTWDDDGIALYVAGEQAQASIADSTLQGAGGVQIERGANVTVQRSAIVDGGLHIGALQSLQPEDLPPSRVVLRDTNVTAVPASGAPAAVSVLGASELTLDGGHITGGRAAGVAAMQGAVVHLQRATIRRGDALAGGAVPGGAVPGGAVPGGFGPGGFGPVLDGWYGVDVSGSSVELAQSIVEAPELGAAIRVGRGARVTVPGGSLSAPHGNVIETGGARRFAPQAAPLSITLQAGAH
Loading
Loading