ramanathanlab / molecular_dynamics_neural_operator

Collection of machine learning models for learning molecular dynamics operators.
3 stars 0 forks source link

Generate electrostatic potentials from pdb files #3

Closed maxzvyagin closed 3 years ago

maxzvyagin commented 3 years ago

Install requirements: conda install -c conda-forge apbs conda install -c conda-forge pdb2pqr pip install gridDataFormats

Command line steps:

For each pdb file, run the following: pdb2pqr30 {pdb_file} temp.pqr

Then, once we have the pqr, run the following: apbs convert.in, which will generate a temp.dx file. The contents of convert.in are below.

Then, in python, run the following:

from gridData import Grid
g = Grid('temp.dx')
array = g.grid
# now you have a numpy array which can be saved/concatenated to another 

The convert.in file:

read
    mol pqr temp.pqr
end
elec
    mg-auto
    mol 1

    fgcent mol 1 # fine grid center
    cgcent mol 1    # coarse grid center
    fglen 52.958000 44.009000 38.329999
    cglen 72.958000 72.958000 72.958000
    dime 97 65 65
    lpbe          # l=linear, n=non-linear Poisson-Boltzmann equation
    bcfl sdh      # "Single Debye-Hueckel" boundary condition
    pdie 2.0      # protein dielectric
    sdie 78.0     # solvent dielectric
    chgm spl2     # Cubic B-spline discretization of point charges on grid
    srfm smol     # smoothed surface for dielectric and ion-accessibility coefficients
    swin 0.3
    temp 310.0    # temperature
    sdens 10.0
    calcenergy no
    calcforce no
    srad 1.40000   # solvent radius

    ion charge +1 conc 0.15 radius 2.0
    ion charge -1 conc 0.15 radius 1.8

    write pot dx temp.dx
end
quit
braceal commented 3 years ago

I think all the pieces are done, just testing this function now: https://github.com/ramanathanlab/molecular_dynamics_neural_operator/blob/main/preprocess.py

braceal commented 3 years ago

Preprocessing is running, but it takes a long time for the 1.1M frames of BBA training data.

braceal commented 3 years ago

Preprocessing done.