Skip to content

Commit

Permalink
first draft of martinize2 command tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
csbrasnett committed Oct 9, 2024
2 parents 38fa6e2 + 5fb0154 commit 5ba58d8
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 77 deletions.
70 changes: 33 additions & 37 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@ env:

jobs:
build:

runs-on: ubuntu-20.04

strategy:
matrix:
py_version: ["3.8", "3.9", "3.10", "3.11"]
py_version: ["3.9", "3.10", "3.11", "3.12"]
include:
- py_version: "3.8"
WITH_CODECOV: true
- py_version: "3.9"
WITH_CODECOV: true
- py_version: "3.10"
WITH_CODECOV: true
- py_version: "3.11"
WITH_CODECOV: true
- py_version: "3.12"
WITH_CODECOV: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
cache: pip
Expand All @@ -54,6 +53,7 @@ jobs:
run: |
coverage run $(which pytest) -vv --hypothesis-show-statistics
coverage report --omit='*/bin/pytest'
coverage xml
- if: ${{ matrix.WITH_CODECOV }}
name: Upload coverage codecov
Expand All @@ -68,11 +68,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -93,11 +93,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -118,37 +118,33 @@ jobs:
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/vermouth
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
pip install pbr
run: |
python3 -m pip install build pbr --user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish package to PyPI
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
63 changes: 49 additions & 14 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,25 @@ env:

jobs:
build:

runs-on: ubuntu-20.04

strategy:
matrix:
py_version: ["3.8", "3.9", "3.10", "3.11"]
py_version: ["3.9", "3.10", "3.11", "3.12"]
include:
- py_version: "3.8"
WITH_CODECOV: true
- py_version: "3.9"
WITH_CODECOV: true
- py_version: "3.10"
WITH_CODECOV: true
- py_version: "3.11"
WITH_CODECOV: true
- py_version: "3.12"
WITH_CODECOV: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_version }}
cache: pip
Expand Down Expand Up @@ -71,11 +70,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -96,11 +95,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.x'
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand All @@ -116,3 +115,39 @@ jobs:
run: |
mkdir -p doc/source/_static
sphinx-build -EnW -b html doc/source/ doc/build/html
deploy:
needs: [build, lint, docs]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/vermouth
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
**/setup.cfg
**/requirements-*.txt
**/pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade setuptools pip
pip install --upgrade .
- name: Install pypa/build
run: |
python3 -m pip install build pbr --user
- name: Build a binary wheel and a source tarball
run: python3 -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
4 changes: 2 additions & 2 deletions doc/source/martinize2_tutorials/basic_usage.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==========
===========
Basic usage
==========
===========

Overly basic usage
==================
Expand Down
4 changes: 3 additions & 1 deletion doc/source/martinize2_tutorials/elastic_networks.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Elastic Networks
================
Elastic Networks
================

The first method applied to maintain the secondary and tertiary structure
of Martini proteins was `Elastic Networks <https://doi.org/10.1021/ct9002114>`_.
Expand Down
4 changes: 2 additions & 2 deletions doc/source/martinize2_tutorials/go_models.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=======
=========
Go models
=======
=========

GoMartini is a popular method for retaining the secondary and tertiary structures of proteins originating from the lab
of `Adolfo Poma <https://pubs.acs.org/doi/full/10.1021/acs.jctc.6b00986>`_. In contrast to an elastic network, the Go
Expand Down
4 changes: 3 additions & 1 deletion doc/source/martinize2_tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ repository: https://github.com/marrink-lab/martinize-examples
.. toctree::
basic_usage
7_adding_modifications/index
elastic_networks
go_models
mutmod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
======
===========================
Mutations and modifications
======
===========================

Martinize2 facilitates a powerful syntax for defining mutations and modifications to your input protein structure.
Here we'll look at some of the options for how your protein can be changed during the coarse graining process. While
Expand Down
4 changes: 2 additions & 2 deletions doc/source/martinize2_tutorials/water_biasing.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========
=============
Water biasing
=========
=============

One feature associated with the latest version of the
`Go model <https://www.biorxiv.org/content/10.1101/2024.04.15.589479v1>`_ is the ability to
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ requires = [
"setuptools >= 30.3.0",
"pbr",
]
build-backend = "pbr.build"

[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
keywords = martini MD martinize
Expand Down
30 changes: 30 additions & 0 deletions vermouth/data/mappings/his.charmm.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[ block ]
[ from ]
charmm
[ to ]
martini22

[ from blocks ]
HIS

[ to blocks ]
HSE

[ mapping ]
N BB
HN BB
CA BB
HA BB
CB SC1
HB1 SC1
HB2 SC1
CD2 SC2
HD2 SC2
CG SC1
NE2 SC2
HE2 SC2
ND1 SC3
CE1 SC3
HE1 SC3
C BB
O BB
27 changes: 27 additions & 0 deletions vermouth/data/mappings/his.gromos.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[ block ]
[ from ]
gromos
[ to ]
martini22

[ from blocks ]
HIS

[ to blocks ]
HSE

[ mapping ]
N BB
H BB
CA BB
CB SC1
CG SC1
ND1 SC3
HD1 SC3
CD2 SC2
HD2 SC2
CE1 SC3
HE1 SC3
NE2 SC2
C BB
O BB
3 changes: 1 addition & 2 deletions vermouth/processors/annotate_mut_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,9 @@ def annotate_modifications(molecule, modifications, mutations, resspec_counts):
# Get the name of the chain in the molecule that we're looking at
residue = {key: residue_graph.nodes[0].get(key)
for key in 'chain resid resname insertion_code'.split()}
chain = residue['chain']
extra = False
for mutmod, key, library in associations:
for resspec, mod in mutmod:
extra = False
mod_found = _resiter(mod, residue_graph, resspec, library, key, molecule)
if not mod_found:
#if no mod found, return that there's a problem
Expand Down
Loading

0 comments on commit 5ba58d8

Please sign in to comment.