Skip to content

Commit

Permalink
Merge #3252 #3256 #3257
Browse files Browse the repository at this point in the history
3252: Factor out ParticleList r=jngrad a=fweik

Follow up on #3251.

Description of changes:
 - Pulling `ParticleList` out of `particle_data.hpp` to get better
   header disentanglement.


3256: Remove tutorial 10 and unused LaTeX files r=fweik a=jngrad

Closes #3211

Description of changes:
- removed tutorial 10
- removed unused LaTeX preambles

3257: Remove PDB parser feature r=fweik a=jngrad

The consensus offline at the ICP and online in #1441 is to drop support of the PDB parser feature in favor of the dedicated python package MDAnalysis.

Co-authored-by: Florian Weik <fweik@icp.uni-stuttgart.de>
Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
  • Loading branch information
3 people authored Oct 17, 2019
4 parents 34c6bd7 + f28097b + eabc23d + f2fbd3e commit a0e4dcd
Show file tree
Hide file tree
Showing 63 changed files with 190 additions and 1,753 deletions.
124 changes: 0 additions & 124 deletions doc/misc/common.tex

This file was deleted.

1 change: 0 additions & 1 deletion doc/sphinx/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ Currently, the following tutorials are available:
* :file:`06-active_matter`: Modelling of self-propelling particles.
* :file:`07-electrokinetics`: Modelling electrokinetics together with hydrodynamic interactions.
* :file:`08-visualization`: Using the online visualizers of |es|.
* :file:`10-reaction_ensemble`: Modelling chemical reactions by means of the reaction ensemble.
* :file:`11-ferrofluid`: Modelling a colloidal suspension of magnetic particles.
* :file:`12-constant_pH`: Modelling an acid dissociation curve using the constant pH method

Expand Down
39 changes: 34 additions & 5 deletions doc/sphinx/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Writing various formats using MDAnalysis
If the MDAnalysis package (https://mdanalysis.org) is installed, it
is possible to use it to convert frames to any of the supported
configuration/trajectory formats, including PDB, GROMACS, GROMOS,
CHARMM/NAMD, AMBER, LAMMPS, ...)
CHARMM/NAMD, AMBER, LAMMPS, ...

To use MDAnalysis to write in any of these formats, one has first to prepare a stream from
the |es| particle data using the class :class:`espressomd.MDA_ESP`, and then read from it
Expand Down Expand Up @@ -398,9 +398,38 @@ using MDAnalysis. A simple example is the following:
For other examples, see :file:`/samples/MDAnalysisIntegration.py`

.. _Parsing PDB Files:
.. _Reading various formats using MDAnalysis:

Parsing PDB Files
-----------------
Reading various formats using MDAnalysis
----------------------------------------

The feature allows the user to parse simple PDB files, a file format introduced by the protein database to encode molecular structures. Together with a topology file (here ) the structure gets interpolated to the grid. For the input you will need to prepare a PDB file with a force field to generate the topology file. Normally the PDB file extension is :file:`.pdb`, the topology file extension is :file:`.itp`. Obviously the PDB file is placed instead of and the topology file instead of .
MDAnalysis can read various formats, including MD topologies and trajectories.
To read a PDB file containing a single frame::

import MDAnalysis
import numpy as np
import espressomd
from espressomd.interactions import HarmonicBond

# parse protein structure
universe = MDAnalysis.Universe("protein.pdb")
# extract only the C-alpha atoms of chain A
chainA = universe.select_atoms("name CA and segid A")
# use the unit cell as box
box_l = np.ceil(universe.dimensions[0:3])
# setup system
system = espressomd.System(box_l=box_l)
system.time_step = 0.001
system.cell_system.skin = 0.4
# configure sphere size sigma and create a harmonic bond
system.non_bonded_inter[0, 0].lennard_jones.set_params(
epsilon=1, sigma=1.5, cutoff=2, shift="auto")
system.bonded_inter[0] = HarmonicBond(k=0.5, r_0=1.5)
# create particles and add bonds between them
system.part.add(pos=np.array(chainA.positions, dtype=float))
for i in range(0, len(chainA) - 1):
system.part[i].add_bond((system.bonded_inter[0], system.part[i + 1].id))
# visualize protein in 3D
from espressomd import visualization
visualizer = visualization.openGLLive(system, bond_type_radius=[0.2])
visualizer.run(0)
3 changes: 1 addition & 2 deletions doc/tutorials/06-active_matter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ get_filename_component(BASENAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
add_custom_command(
OUTPUT ${BASENAME}.pdf
COMMAND sh ../../latexit.sh
${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_SOURCE_DIR}/../common
${CMAKE_CURRENT_SOURCE_DIR}
${BASENAME}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${BASENAME}.tex
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../common
)

add_custom_target(tutorials_06 DEPENDS ${BASENAME}.pdf)
Loading

0 comments on commit a0e4dcd

Please sign in to comment.