Author Topic: molecular surface mesh  (Read 56 times)

matteoeghirotta

  • Newbie
  • *
  • Posts: 1
molecular surface mesh
« on: July 13, 2019, 10:39:16 AM »
Hi everybody, is there a way to construct a surface mesh around a molecule using a rolling sphere on the molecular surface instead of using the set of atomic centres?

popperoga

  • Newbie
  • *
  • Posts: 2
Re: molecular surface mesh
« Reply #1 on: July 15, 2019, 12:41:32 PM »
I am working on this problem with Matteo, who started this thread. Let me add few more details.

The surface mesh is currently generated using a rolling sphere algorithm using the atomic centres as reference. This is an acceptable approximation for metallic an inorganic solids. For molecular systems, and in particular for organic molecules, this leads to an incorrect calculation of the molecular volume, which is badly underestimated. The desired modification is to compute the surface mesh using the position + vdW radius for each atom, as explained in this article (reference taken from the 3V manual):
https://doi.org/10.1107/S0021889883010985 
Connolly ML. Analytical molecular surface calculation. J. App. Crystallogr. 1983;16:548

We tried with an Ovito modifier where the radii were specified for every atom in the system, but the resulting solid volume does not change.
Code: [Select]
from ovito.io import import_file, export_file                                                                                                                                                                                                                                 
from ovito.data import SurfaceMesh, SimulationCell
from ovito.modifiers import ConstructSurfaceModifier
import sys
import re

# Load a particle structure and reconstruct its geometric surface:
pipeline = import_file("/tmp/anpd/s02_03_*.pdb")
pipeline.modifiers.append(ConstructSurfaceModifier(radius = 1.6))

# Use external radii
C = re.compile('^C')
N = re.compile('^N')
H = re.compile('^H')

C_r = 1.7
N_r = 1.6
H_r = 1.1

for frame in range(pipeline.source.num_frames):
    print(frame)
    try:
        input = pipeline.source.compute(frame)
       
        # Use external radii (IT DOES NOT CHANGE THE CALCULATION OF THE SOLID VOLUME)
        atom_types = pipeline.source.data.particles_['Particle Type_'].types
        for atom_type in atom_types:
            if C.match(atom_type.name):
                atom_type.radius = C_r
            if N.match(atom_type.name):
                atom_type.radius = N_r
            if H.match(atom_type.name):
                atom_type.radius = H_r

        data = pipeline.compute(frame)
       
        # Query computed surface properties:
        print("Surface area: %f" % data.attributes['ConstructSurfaceMesh.surface_area'])
        print("Solid volume: %f" % data.attributes['ConstructSurfaceMesh.solid_volume'])
        fraction = data.attributes['ConstructSurfaceMesh.solid_volume'] / data.cell.volume
        print("Solid volume fraction: %f" % fraction)

        pipeline.add_to_scene()

    except:
        print("NO")

    sys.stdout.flush()

The question is: how can we add the atomic radii to the calculation of the surface mesh?
« Last Edit: July 15, 2019, 12:54:10 PM by popperoga »

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 620
Re: molecular surface mesh
« Reply #2 on: July 16, 2019, 10:59:14 AM »
Hi Matteo and Popperoga,

Yes, the surface construction method currently implemented in Ovito differs from the usual approaches you find elsewhere. It treats the atoms always as point-like and their radius property is ignored. The only input aside from the atomic positions is the size of the rolling probe sphere. So this approach is not really suitable for measuring molecular surface areas, I agree.

We currently don't have other surface measurement tools in Ovito, but that is something we could work on in the future. Thanks for sending the reference to the 1983 paper. I will take a look and see how much effort it would be to integrate something like this in Ovito.

My understanding is that there are two general classes of surface analysis algorithms: The first type of algorithm just measures the accessible surface area of an atomic structure, e.g. using a stochastic Monte Carlo sampling technique, but doesn't actually construct a geometric representation of the surface. The second class of algorithm generates a visual model of the surface in the form of a triangulated surface mesh, which can be used to measure its area but also to visualize the surface. Which of these capabilities are relevant in your particular case?

-Alex

popperoga

  • Newbie
  • *
  • Posts: 2
Re: molecular surface mesh
« Reply #3 on: July 16, 2019, 11:45:44 AM »
Hello Alex,
we are interested in computing the Solvent-Accessible and Connolly surfaces, in order to compute the solid volume which is measured by e.g. gas pycnometry. These surfaces are computed in Jmol, but without periodic boundaries. My understanding is that, at least for the solvent-accessible surface (SAS), we need to replace r_{probe} with r_{probe}+r_i, where r_i is the vdW radius of atom i, to determine the position of the sphere on the SAS. Can you point out the relevant file to modify?
Thank you! Otello