Skip to content

Commit

Permalink
Merge branch 'master' into bending
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrunewald authored Nov 10, 2023
2 parents f7c1f54 + 663d17d commit b226f8f
Show file tree
Hide file tree
Showing 48 changed files with 7,148 additions and 973 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pypi_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
verbose: true

deploy:
needs: test
Expand Down
4 changes: 3 additions & 1 deletion LIBRARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
|Polystyrene sulfonate |PSS | |[martini2](polyply/data/martini2/PSS.martini.2.itp) |
| | | |[martini3](polyply/data/martini3/PSS.martini3.ff) |
|Poly(para-phenylene ethynylene)|PPE | |[martini3](polyply/data/martini3/PPE.martini3.ff) |
|Poly(TEMPO methacrylate) |PTMA |[oplsaaLigParGen](polyply/data/oplsaaLigParGen/PTMA.oplsaa.LigParGen.ff)]|[martini3](polyply/data/martini3/PTMA.martini3.ff) |
|Poly(TEMPO methacrylate) |PTMA |[oplsaaLigParGen](polyply/data/oplsaaLigParGen/PTMA.oplsaa.LigParGen.ff)|[martini3](polyply/data/martini3/PTMA.martini3.ff) |
| | | |[ibi_cgm3](polyply/data/ibi_cmg3/PTMA.cgm3.ibi.ff) |
| | | |[ibi_gbcg](polyply/data/ibi_gbcg/PTMA.gbno2.ibi.ff) |
|Dextran |DEX | |[martini3](polyply/data/martini3/dextran.martini3.ff) |
|DNA nucleobases |Dx, Tx5, Dx3 w/ x=T,G,A,C|[parmbsc1](polyply/data/parmbsc1/dna_final.ff) |[martini2](polyply/data/martini2/DNA_M2.ff) |
|Aminoacids |3 letter code | |[martini3](polyply/data/martini3/aminoacids.ff) |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ force-field, molecule parameters and this program.
- (Feb 8, 22') **Featured Research Article in Nature Communcations.** Our article on the polyply software suite is now featured on the [Editors' Highlights](https://www.nature.com/collections/hhfigaahch) for Structural biology, biochemistry and biophysics in Nature Communications. The Editors’ Highlights pages aims to showcase the 50 best papers recently published in an area. The development team is beyond happy to receive this honor.
- (May 23, 22') **Fighting Cancer with polyply.** Dane et al. used polyply to setup simulations of vesicles and lipid nanodiscs (LNDs) containing PEGylated lipids, which are used as nanocarriers for cancer therapeutics. They find that LNDs are more effective in delivery likely due to their higher flexibility. Check it out in [Nature Materials](https://www.nature.com/articles/s41563-022-01251-z).
- (Jan 18, 23') **Towards whole cell simulations with polyply.** In [a perspective on whole-cell simulations](https://www.frontiersin.org/articles/10.3389/fchem.2023.1106495/full) using the Martini force field, Stevens *et al.* utilize polyply to construct the full 0.5 Mio bp chromosome of the Syn3A minimal cell. This impressive task is a good example of the power of the upcoming DNA implementation into polyply and the role of polyply in the Martini Ecosystem.
- (May 11, 23') **Electronic coarse-grained models in polyply.** Curious about simulating non-conjugated radical-containing polymers for all-organic batteries? The models developed [in this work](https://doi.org/10.1021/acs.macromol.3c00141) for PTMA, or poly(TEMPO acrylamide), are avaiable in polyply. There is an all-atom model and different coarse-grained model (Martini 3, iterative Boltzmann inversion), all of which can be flexibly handled by polyply.

## Contributions & Support
We are happy to accept submissions of polymer parameters to the polyply library. To submit parameters simply
Expand Down
3 changes: 3 additions & 0 deletions bin/polyply
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
help='A linear sequence of residue names.')
seq_group.add_argument('-seqf', dest='seq_file', type=Path,
help='A graph input file (JSON|TXT|FASTA|IG)')
dna_group = parser_gen_itp.add_argument_group('DNA specifc options')
dna_group.add_argument('-dsdna', dest='dsdna', action='store_true',
help='complement single sequence to dsDNA sequence')

parser_gen_itp.set_defaults(func=gen_itp)

Expand Down
23 changes: 15 additions & 8 deletions polyply/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@

# Find the data directory once.
try:
import pkg_resources
from importlib.resources import files, as_file
import atexit
from contextlib import ExitStack
except ImportError:
import os
DATA_PATH = os.path.join(os.path.dirname(__file__), 'data')
TEST_DATA = os.path.join(os.path.dirname(__file__), 'tests/test_data')
del os
from pathlib import Path
DATA_PATH = Path(__file__).parent / 'data'
TEST_DATA = Path(__file__).parent / 'tests/test_data'
del Path
else:
DATA_PATH = pkg_resources.resource_filename('polyply', 'data')
TEST_DATA = pkg_resources.resource_filename('polyply', 'tests/test_data')
del pkg_resources
ref_data = files('polyply') / 'data'
ref_test = files('polyply') / 'tests'/ 'test_data'
file_manager = ExitStack()
atexit.register(file_manager.close)
DATA_PATH = file_manager.enter_context(as_file(ref_data))
TEST_DATA = file_manager.enter_context(as_file(ref_test))

del files, as_file, atexit, ExitStack

del pbr

Expand Down
68 changes: 68 additions & 0 deletions polyply/data/ibi_cgm3/PTMA.cgm3.ibi.ff
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[ moleculetype ]
; name nexcl.
PTMA 2

[ info ]
Nonbonded interaction potentials (and example run) can be found at: https://doi.org/10.5281/zenodo.8287521

[ atoms ]
; id type resnr residu atom cgnr charge mass
1 VNL 1 PTMA VNL 1 0.0 54
2 EST 1 PTMA EST 2 0.0 54
3 C1 1 PTMA C1 3 0.0 54
4 C2 1 PTMA C2 4 0.0 54
5 C2 1 PTMA C3 5 0.0 54
6 N4 1 PTMA N4 6 0.0 36

[ bonds ]
; i j funct length
1 2 1 0.262 15000 { "comment": "M3 PMMA model [10.1038/s41467-021-27627-4] shortened"}
2 3 1 0.253 15000 { "comment": "PMMA-TEMPO connection"}
3 4 1 0.326 25000 { "comment": "cog (TEMPO)"}
3 5 1 0.326 25000 { "comment": "cog (TEMPO)"}
3 6 1 0.310 100000 {"ifdef": "FLEXIBLE", "comment": "cog (TEMPO)"}
4 6 1 0.238 100000 {"ifdef": "FLEXIBLE", "comment": "cog (TEMPO)"}
5 6 1 0.238 100000 {"ifdef": "FLEXIBLE", "comment": "cog (TEMPO)"}

[constraints]
; i j funct length
3 6 1 0.310 {"ifndef": "FLEXIBLE", "comment": "cog (TEMPO)"}
4 6 1 0.238 {"ifndef": "FLEXIBLE", "comment": "cog (TEMPO)"}
5 6 1 0.238 {"ifndef": "FLEXIBLE", "comment": "cog (TEMPO)"}

[ angles ]
; i j k funct length force k
1 2 3 2 132.9 70 { "comment": "PMMA-TEMPO connection"}
2 3 4 2 129.0 60 { "comment": "PMMA-TEMPO connection"}
2 3 5 2 121.9 95 { "comment": "PMMA-TEMPO connection"}

[dihedrals]
; i j k l funct ref.angle force_k
3 4 5 6 2 140.00 20 { "comment": "cog (TEMPO)"}
2 4 5 6 2 150.00 80 { "comment": "PMMA-TEMPO connection"}

[exclusions]
1 2 3 4 5 6
2 3 4 5 6
3 4 5 6
4 5 6
5 6

[ link ]
resname "PTMA"
[ bonds ]
VNL +VNL 1 0.315 4000 {"group": "vinyl backbone"}

[ link ]
resname "PTMA"
[ angles ]
VNL +VNL ++VNL 2 115 35 {"group": "vinyl backbone"}

[ link ]
resname "PTMA"
[ angles ]
EST VNL +VNL 2 70 20

[ citation ]
2023RAlessandri-Macromolecules
polyply
22 changes: 22 additions & 0 deletions polyply/data/ibi_cgm3/citations.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

@article{2023RAlessandri-Macromolecules,
title={Prediction of Electronic Properties of Radical-Containing Polymers at Coarse-Grained Resolutions},
author={Alessandri, Riccardo and de Pablo, Juan J},
journal={Macromolecules},
volume={56},
number={10},
pages={3574-3584},
doi={10.1021/acs.macromol.3c00141},
year={2023}
}


@article{polyply,
title={Polyply; a python suite for facilitating simulations of (bio-) macromolecules and nanomaterials},
author={Grunewald, Fabian and Alessandri, Riccardo and Kroon, Peter C and Monticelli, Luca and Souza, Paulo CT and Marrink, Siewert J},
journal={Nature Communications},
doi={10.1038/s41467-021-27627-4},
year={2022},
volume={13},
pages={68}
}
75 changes: 75 additions & 0 deletions polyply/data/ibi_gbcg/PTMA.gbno2.ibi.ff
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[ moleculetype ]
; name nexcl.
PTMA 2

[ info ]
Nonbonded interaction potentials (and example run) can be found at: https://doi.org/10.5281/zenodo.8287521

[ atoms ]
; id type resnr residu atom cgnr charge mass
1 VNL 1 PTMA VNL 1 0 71.099
2 EST 1 PTMA EST 2 0 29.018
3 C1 1 PTMA C1 3 0 56.108
4 U 1 PTMA NN 4 0 0.000
5 U 1 PTMA OO 5 0 0.000
6 C1 1 PTMA C2 6 0 56.108
7 NO 1 PTMA NO 7 0 30.006

[ bonds ]
; i j funct length
1 2 1 0.35337 12500
2 3 1 0.32325 32000
2 6 1 0.32369 32000
3 6 1 0.38838 32000
3 7 1 0.23794 1000000 {"ifdef": "FLEXIBLE"}
6 7 1 0.23793 1000000 {"ifdef": "FLEXIBLE"}

[constraints]
; i j funct length
3 7 1 0.23794 {"ifndef": "FLEXIBLE"}
6 7 1 0.23793 {"ifndef": "FLEXIBLE"}

[ angles ]
; i j k funct length force k
1 2 3 2 130.000 90
1 2 6 2 130.000 75

[dihedrals]
; i j k l funct ref.angle force_k
1 3 6 7 2 165.98 50
2 3 6 7 2 179.20 80
3 7 5 6 2 170.723 50

[virtual_sites3]
; 3fd sites
; site positioned as a linear combination of 3 atoms; the site is in the same plane
; site from funct a b
4 3 2 7 2 0.834 0.210
5 3 2 7 2 1.180 0.276

[exclusions]
1 2 3 4 5 6 7
2 3 4 5 6 7
3 4 5 6 7
4 5 6 7
5 6 7
6 7

[ link ]
resname "PTMA"
[ bonds ]
VNL +VNL 1 0.305 12000 {"group": "vinyl backbone"}

[ link ]
resname "PTMA"
[ angles ]
VNL +VNL ++VNL 2 126 40 {"group": "vinyl backbone"}

[ link ]
resname "PTMA"
[ angles ]
EST VNL +VNL 2 90 20

[ citation ]
2023RAlessandri-Macromolecules
polyply
22 changes: 22 additions & 0 deletions polyply/data/ibi_gbcg/citations.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

@article{2023RAlessandri-Macromolecules,
title={Prediction of Electronic Properties of Radical-Containing Polymers at Coarse-Grained Resolutions},
author={Alessandri, Riccardo and de Pablo, Juan J},
journal={Macromolecules},
volume={56},
number={10},
pages={3574-3584},
doi={10.1021/acs.macromol.3c00141},
year={2023}
}


@article{polyply,
title={Polyply; a python suite for facilitating simulations of (bio-) macromolecules and nanomaterials},
author={Grunewald, Fabian and Alessandri, Riccardo and Kroon, Peter C and Monticelli, Luca and Souza, Paulo CT and Marrink, Siewert J},
journal={Nature Communications},
doi={10.1038/s41467-021-27627-4},
year={2022},
volume={13},
pages={68}
}
25 changes: 25 additions & 0 deletions polyply/data/martini2/DNA_M2.ff
Original file line number Diff line number Diff line change
Expand Up @@ -566,3 +566,28 @@ BB3 +BB2
BB2 BB3 +BB1 +BB2 1 180.00000 2 3 {"group": "link"}
BB3 +BB1 +BB2 +BB3 9 85.00000 2 2 {"group": "link", "version": "1"}
BB3 +BB1 +BB2 +BB3 9 160.00000 2 3 {"group": "link", "version": "2"}

;
; CIRCULAR MARTINI DNA
;

[ link ]
resname "DT|DG|DA|DC"
[ atoms ]
BB3 { }
>BB1 { }
[ bonds ]
BB3 >BB1 1 0.35300 10000 {"group": "link-circle", "edge": false}
[ angles ]
BB2 BB3 >BB1 2 102.00000 150 {"group": "backbone-circle", "edge": false}
BB3 >BB1 >BB2 2 106.00000 75 {"group": "backbone-circle", "edge": false}
[ exclusions ]
#meta {"edge": false}
BB2 >BB1
BB3 >BB2
[ dihedrals ]
BB2 BB3 >BB1 >BB2 1 180.00000 2 3 {"group": "link-circle", "edge": false}
BB3 >BB1 >BB2 >BB3 9 85.00000 2 2 {"group": "link-circle", "version": "1", "edge": false}
BB3 >BB1 >BB2 >BB3 9 160.00000 2 3 {"group": "link-circle", "version": "2", "edge": false}
[ edges ]
BB3 >BB1 {"linktype": "circle"}
2 changes: 1 addition & 1 deletion polyply/data/martini3/PTMA.martini3.ff
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ resname "PTMA"
EST VNL +VNL 2 70 20

[ citation ]
2022RAlessandri-arXiv
2023RAlessandri-Macromolecules
Martini3
polyply
18 changes: 10 additions & 8 deletions polyply/data/martini3/citations.bib
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ @article{PPEs
publisher={The Royal Society of Chemistry},
url={http://dx.doi.org/10.1039/D1CP04237H},
}
@article{2022RAlessandri-arXiv,
title={Predicting Electronic Properties of Radical-Containing Polymers at Coarse-Grained Resolutions},
author={Alessandri, Riccardo and de Pablo, Juan J.},
journal={arXiv},
year={2022},
eprint={2209.02072},
primaryClass={cond-mat.soft},
doi={https://doi.org/10.48550/arXiv.2209.02072}}
@article{2023RAlessandri-Macromolecules,
title={Prediction of Electronic Properties of Radical-Containing Polymers at Coarse-Grained Resolutions},
author={Alessandri, Riccardo and de Pablo, Juan J},
journal={Macromolecules},
volume={56},
number={10},
pages={3574-3584},
doi={10.1021/acs.macromol.3c00141},
year={2023}
}
@article{M3_sugars,
title={Martini 3 Coarse-Grained Force Field for Carbohydrates},
author={Fabian, Grünewald and Mats H., Punt and Elizabeth E., Jefferys and Petteri A., Vainikka and Melanie, König and Valtteri, Virtanen and Travis A., Meyer and Weria, Pezeshkian and Adam J., Gormley and Maarit, Karonen and Mark S. P., Sansom and Paulo C. T, Souza and Siewert J., Marrink},
Expand Down
7 changes: 6 additions & 1 deletion polyply/src/apply_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,12 @@ def run_molecule(self, meta_molecule):

# take care to remove nodes if there are any scheduled for removal
# we do this here becuase that's more efficent
molecule.remove_nodes_from(self.nodes_to_remove)
if self.nodes_to_remove:
molecule.remove_nodes_from(self.nodes_to_remove)
# make sure the residue graph is updated; this takes care that
# nodes are also removed from the fragment graphs in the
# meta_molecule.nodes['graph'] attribute
meta_molecule.relabel_and_redo_res_graph(mapping={})
# now we add all interactions but not the ones that contain the removed
# nodes
for inter_type in self.applied_links:
Expand Down
17 changes: 17 additions & 0 deletions polyply/src/gen_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,23 @@ def gen_coords(toppath,
LOGGER.info("loading grid", type="step")
grid = np.loadtxt(grid)

# where to get the box size from
if box is not None and topology.box is not None\
and not np.array_equal(topology.box, box):
msg = ("A box is provided via the -box command line "
"and the starting coordinates. We consider the "
"the box of starting coordinates as correct. ")
LOGGER.warning(msg, type="warning")
box = topology.box
elif topology.box is not None:
box = topology.box
if density is not None:
msg = ("A density is provided via the command line, "
"but the starting coordinates define a box."
"Will try to pack all molecules in the box "
"provided with starting coordinates.")
LOGGER.warning(msg, type="warning")

# do a sanity check
LOGGER.info("checking residue integrity", type="step")
check_residue_equivalence(topology)
Expand Down
Loading

0 comments on commit b226f8f

Please sign in to comment.