Skip to content

Commit

Permalink
Merge branch 'marrink-lab:master' into PTMA-AA-ff
Browse files Browse the repository at this point in the history
  • Loading branch information
ricalessandri authored Aug 21, 2023
2 parents 6301581 + 1ecd4d5 commit b253dfe
Show file tree
Hide file tree
Showing 64 changed files with 3,234 additions and 1,745 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ coverage:
patch:
default:
target: 90
ignore:
- polyply/tests
comment: off
16 changes: 10 additions & 6 deletions .github/workflows/pypi_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9"]
py_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -28,11 +28,15 @@ jobs:
pip install -r requirements-tests.txt
- name: Run pytest with codecoverage
run: |
coverage run --source=polyply $(which pytest) -vv polyply
coverage report --omit='*/bin/pytest'
codecov
run: pytest --cov polyply --cov-report=xml
- name: Upload coverage codecov
uses: codecov/codecov-action@v3
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
verbose: true

deploy:
needs: test
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
py_version: ["3.6", "3.7", "3.8", "3.9"]
py_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -31,11 +31,15 @@ jobs:
pip install -r requirements-tests.txt
- name: Run pytest with codecoverage
run: |
coverage run --source=polyply $(which pytest) -vv polyply
coverage report --omit='*/bin/pytest'
codecov
run: pytest --cov polyply --cov-report=xml
- name: Upload coverage codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
verbose: true

lint:
runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ est.pdb
**.pyc
**.bak

*.idea

**.lprof
polyply.egg-info

Expand Down
28 changes: 28 additions & 0 deletions LIBRARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

| Polymer name | Abbreviation | All-atom model(s) | Coarse-grained model(s) |
|-------------------------------|-------------------------|-----------------------------------------------------------------------|------------------------------------------------------|
|Polyethylene oxide |PEO |[gromos2016H66](polyply/data/2016H66/polyether_blocks.ff) |[martini2](polyply/data/martini2/PEO.martini.2.itp) |
| | |[oplsaaLigParGen](polyply/data/oplsaaLigParGen/PEO.oplsaa.LigParGen.ff)|[martini3](polyply/data/martini3/PEO.martini3.ff) |
|Polystyrene |PS |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini2](polyply/data/martini2/PS.martini.2.itp) |
| | | |[martini3](polyply/data/martini3/PS.martini3.ff) |
|Polystyrene-b-poly(ethylene oxide)|PS-PEO | |[martini3](polyply/data/martini3/PS_PEO_link.ff) |
|Polymethyl acrylate |PMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMA.martini3.ff) |
|Polymethyl methacrylate |PMMA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PMMA.martini3.ff) |
|Polyethylene |PE |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PE.martini3.ff) |
| | | |[martini2](polyply/data/martini2/PE.martini.2.itp) |
|Polypropylene |PP |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini2](polyply/data/martini2/PP.martini.2.itp) |
|Poly(3-hexylthiophene) |P3HT |[gromos53A6](polyply/data/gromos53A6/P3HT.gromos.53A6.ff) |[martini2](polyply/data/martini2/P3HT.martini.2.itp) |
| | | |[martini3](polyply/data/martini3/P3HT.martini3.ff) |
|Polyvinyl alcohol |PVA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) |[martini3](polyply/data/martini3/PVA.martini3.ff) |
|Poly(2-hydroxyethyl acrylate) |HEA |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | |
|Polyacrylamide |PAM |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | |
|Poly(methacrylamide) |PMAM |[gromos2016H66](polyply/data/2016H66/polyvinyl_blocks.ff) | |
|Poly(diallyldimethylammonium) |PDADMA | |[martini2](polyply/data/martini2/PDADMA.martini.2.itp)|
|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 | |[martini3](polyply/data/martini3/PTMA.martini3.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) |
|Polydimethylsiloxane |PDMS | |[martini3](polyply/data/martini3/PDMS.martini3.ff)
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build Status](https://github.com/marrink-lab/polyply_1.0/actions/workflows/python-app.yml/badge.svg)](https://github.com/marrink-lab/polyply_1.0/actions)
[![PyPI version](https://badge.fury.io/py/polyply.svg)](https://badge.fury.io/py/polyply)
![license](https://img.shields.io/github/license/marrink-lab/polyply_1.0)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/marrink-lab/polyply_1.0/Upload%20Python%20Package)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/marrink-lab/polyply_1.0/pypi_deploy.yml)
[![arXiv](https://img.shields.io/badge/arXiv-2105.05890-b31b1b.svg)](https://arxiv.org/abs/2105.05890)
[![DOI:10.1038/s41467-021-27627-4](https://zenodo.org/badge/DOI/10.1038/s41467-021-27627-4.svg)](https://doi.org/10.1038/s41467-021-27627-4)

Expand All @@ -29,14 +29,16 @@ force-field, molecule parameters and this program.
## Quick references
[Installation Guide](https://github.com/marrink-lab/polyply_1.0/wiki/Installation)\
[FAQs](https://github.com/marrink-lab/polyply_1.0/wiki/FAQs)\
[Current Polyply Polymer Library](./LIBRARY.md)\
[Submissions to Martini Polymer Library](https://github.com/marrink-lab/polyply_1.0/wiki/Submit-polymer-parameters)\
[Tutorial: Martini Polymers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-martini-polymer-melts)\
[Tutorial: GROMOS Polymers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-GROMOS-polymer-melts)\
[Tutorial: PEGylated lipid bilayers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-PEGylated-lipid-bilayers)

[Tutorial: PEGylated lipid bilayers](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-PEGylated-lipid-bilayers)\
[Tutorial: Single-stranded DNA](https://github.com/marrink-lab/polyply_1.0/wiki/Tutorial:-Single-stranded-circular-DNA)
## News
- (Feb 8) **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) **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).
- (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.

## Contributions & Support
We are happy to accept submissions of polymer parameters to the polyply library. To submit parameters simply
Expand Down
26 changes: 14 additions & 12 deletions bin/polyply
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from pathlib import Path
import numpy as np
import polyply
from polyply import (gen_itp, gen_coords, gen_seq, DATA_PATH)
from polyply.src.load_library import load_library
from polyply.src.load_library import load_ff_library
from polyply.src.logging import LOGGER, LOGLEVELS

VERSION = 'polyply version {}'.format(polyply.__version__) # pylint: disable=consider-using-f-string
Expand Down Expand Up @@ -56,19 +56,19 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
# Input Arguments for the itp generation tool
# =============================================================================

parser_gen_itp.add_argument('-name', required=True, type=str, dest="name",
help="name of the final molecule")
parser_gen_itp.add_argument('-name', required=False, type=str, dest="name",
help="name of the final molecule", default='polymer')
parser_gen_itp.add_argument('-v', dest='verbosity', action='count',
help='Enable debug logging output. Can be given '
'multiple times.', default=0)

file_group = parser_gen_itp.add_argument_group('Input and output options')
file_group.add_argument('-lib', dest='lib', required=False, type=str,
file_group.add_argument('-lib', dest='lib', required=False, type=Path, default=[],
help='force-fields to include from library', nargs='*')
file_group.add_argument('-f', dest='inpath', required=False, type=Path,
help='Input file (ITP|FF)', nargs="*")
file_group.add_argument('-f', dest='inpath', type=Path, required=False, default=[],
help='Input file (ITP|FF)', nargs='*')
file_group.add_argument('-o', dest='outpath', type=Path,
help='Output ITP (ITP)')
help='Output ITP (ITP)', default=Path('polymer.itp'))
seq_group = file_group.add_mutually_exclusive_group(required=True)
seq_group.add_argument('-seq', dest='seq', type=str, nargs='+',
help='A linear sequence of residue names.')
Expand All @@ -81,7 +81,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
# Input Arguments for the coordinate generation tool
# ============================================================================

parser_gen_coords.add_argument('-name', required=True, type=str, dest="name",
parser_gen_coords.add_argument('-name', required=False, type=str, dest="name", default='molname',
help="name of the final molecule")

parser_gen_coords.add_argument('-v', dest='verbosity', action='count',
Expand All @@ -91,14 +91,16 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
file_group = parser_gen_coords.add_argument_group('Input and output files')
file_group.add_argument('-p', dest='toppath', required=False, type=Path,
help='topology file (.top)')
file_group.add_argument('-o', dest='outpath', type=Path,
file_group.add_argument('-o', dest='outpath', type=Path, default='coords.gro',
help='output GRO (.gro)')
file_group.add_argument('-c', dest='coordpath', type=Path,
help='input file molecules (.gro)', default=None)
file_group.add_argument('-mc', dest='coordpath_meta', type=Path,
help='input file meta-molecule (.gro)', default=None)
file_group.add_argument('-b', dest='build', type=Path, default=None,
file_group.add_argument('-b', dest='build', type=Path, required=False, default=[], nargs='*',
help=('input file; specify molecule specific building options'))
file_group.add_argument('-lib', dest='lib', required=False, type=Path, default=None,
help='molecule templates can be loaded from force field library')

topology_group = parser_gen_coords.add_argument_group('Change or modify topology')
topology_group.add_argument('-res', dest='build_res', type=str,
Expand Down Expand Up @@ -195,7 +197,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
"is <tag:molecule name>.")

seq_group = parser_gen_seq.add_argument_group('Definition of sequence')
seq_group.add_argument('-seq', dest='seq', nargs='+', type=str,
seq_group.add_argument('-seq', dest='seq', nargs='+', type=str, required=True,
help="Define the sequence order in which to combine macros."
"The format is <macro_tag, macro_tag, ...>. For example, "
"to combine three blocks called A, B, which are defined by the "
Expand Down Expand Up @@ -238,7 +240,7 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
parser.exit()

if args.list_blocks:
force_field = load_library("libs", args.list_blocks, [])
force_field = load_ff_library("libs", args.list_blocks, [])
msg = 'The following Blocks are present in the following libraries: {}:'
print(msg.format(args.list_blocks))
for block in force_field.blocks:
Expand Down
10 changes: 10 additions & 0 deletions polyply/data/gromos53A6/links.ff
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@ CT2 {"replace": {"charge": -0.394}}
CT3 CT2 +H1 2 126.0 575.0 {"comment":"H-CT2-link", "group": "termini"}
[ dihedrals ]
+H1 ST1 CT3 CT2 2 0.0 167.42309 {"comment":"H-CT2-link", "group": "termini"}


[ link ]
[ atoms ]
CT2 {"resname": "P3HT"}
[ warning ]
You should patch P3HT with a H-terminal residues. Use -seq Hter:1 P3HT:4 Hter:1
[ non-edges ]
CT2 +H1
CT2 +CT5
87 changes: 87 additions & 0 deletions polyply/data/martini3/PDMS.martini3.ff
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[ citations ]
Martini3
polyply
M3_PDMS
;
[ moleculetype ]
; molname nrexcl
PDMS 1
;
[ atoms ]
; id type resnr residue atom cgnr charge mass
1 DMS 1 PDMS PDMS 1 0.00000 72.00
;
[ link ]
resname "PDMS"
[ bonds ]
; i j funct length force.c.
PDMS +PDMS 1 0.448 11500 ; 2
;
[ link ]
resname "PDMS"
[ angles ]
; i j k funct angle force.c.
PDMS +PDMS ++PDMS 1 86 45.89 ; 2
;
[ link ]
resname "PDMS"
[ dihedrals ]
; i j k l funct dihedral force.c. mult.
PDMS +PDMS ++PDMS +++PDMS 1 1.18 1.4 1 ; 2
;
[ moleculetype ]
PDMSter 1
[ atoms ]
1 DMS 1 PDMSter END 1 0.00000 72.00
[ info ]
Parameters for this model are custom and available for download at: https://github.com/marrink-lab/martini-forcefields/blob/main/martini_forcefields/regular/v3.0.0/gmx_files_contributed/DMS_martini3_v1.itp

[ link ]
resname "PDMSter|PDMS"
[ bonds ]
END +PDMS 1 0.446 11000 {"group": "END-PDMS"}

[ link ]
resname "PDMS|PDMSter"
[ bonds ]
PDMS +END 1 0.446 11000 {"group": "PDMS-END"}


[ link ]
resname "PDMSter|PDMS"
[ angles ]
END +PDMS ++PDMS 1 87 78 {"group": "END-PDMS"}

[ link ]
resname "PDMS|PDMSter"
[ angles ]
PDMS +PDMS ++END 1 87 78 {"group": "PDMS-END"}


[ link ]
resname "PDMSter|PDMS"
[ dihedrals ]
END +PDMS ++PDMS +++PDMS 1 1.85 1.2 1 {"group": "END-PDMS"}

[ link ]
resname "PDMS|PDMSter"
[ dihedrals ]
PDMS +PDMS ++PDMS +++END 1 1.85 1.2 1 {"group": "PDMS-END"}

[ link ]
[ atoms ]
PDMS {"resname": "PDMS"}
[ warning ]
You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PDMS:4 PDMSter:1
[ non-edges ]
PDMS +PDMS
PDMS +END

[ link ]
[ atoms ]
PDMS {"resname": "PDMS"}
[ warning ]
You should patch PDMS with a terminal residue. Use -seq PDMSter:1 PDMS:4 PDMSter:1
[ non-edges ]
PDMS -PDMS
PDMS -END
Loading

0 comments on commit b253dfe

Please sign in to comment.