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

Remove PDB parser feature #3257

Merged
merged 3 commits into from
Oct 17, 2019
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
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)
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ add_subdirectory(config)
add_subdirectory(utils)

add_subdirectory(profiler)
add_subdirectory(pdbparser)

if(SCAFACOS)
add_subdirectory(scafacos)
Expand Down
1 change: 0 additions & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ endif()
target_link_libraries(EspressoCore PUBLIC EspressoConfig utils)
target_link_libraries(EspressoCore PUBLIC Boost::serialization Boost::mpi MPI::MPI_CXX Random123)
target_link_libraries(EspressoCore PRIVATE Profiler)
target_link_libraries(EspressoCore PRIVATE pdbparser)

if(FFTW3_FOUND)
target_include_directories(EspressoCore PRIVATE SYSTEM ${FFTW3_INCLUDE_DIR})
Expand Down
1 change: 0 additions & 1 deletion src/core/io/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
add_subdirectory(writer)
add_subdirectory(reader)
add_subdirectory(mpiio)
4 changes: 0 additions & 4 deletions src/core/io/reader/CMakeLists.txt

This file was deleted.

193 changes: 0 additions & 193 deletions src/core/io/reader/readpdb.cpp

This file was deleted.

55 changes: 0 additions & 55 deletions src/core/io/reader/readpdb.hpp

This file was deleted.

6 changes: 0 additions & 6 deletions src/pdbparser/CMakeLists.txt

This file was deleted.

Loading