Electrostatics / apbs

Software for biomolecular electrostatics and solvation calculations
http://www.poissonboltzmann.org/
Other
91 stars 24 forks source link

write atompot does not function correctly if the molecule is not the first molecule listed in the input file #288

Open jbardhan opened 9 months ago

jbardhan commented 9 months ago

Describe the bug After the APBS documentation, I thought that writing out electrostatic potentials at the atom locations should be OK no matter which molecule index (in the READ section) it happens to be. However, it seems that the electrostatic potentials do not get written unless the molecule with charges is the first one listed.

I am trying to calculate protein pKas, and I want my calculations on the model compounds to be performed on exactly the same grid as the calculations that will be performed on the protein.

I therefore used the following

read
    mol pqr protein.pqr
    mol pqr capped_group.pqr
end

elec name solv
    mg-auto
    dime 33 33 33 
    cglen 40 40 40
    fglen 20 20 20
    cgcent mol 1
    fgcent mol 1
    mol 2
        <etc etc>

This leads to the atom pot output files being written out as the four commented lines at the header

# Data from APBS 3.4.1
# 
# ATOM POTENTIALS
# 

but nothing else.

After tracking how atompot gets parsed and used, I decided to try the following alternative

read
    mol pqr capped_group.pqr
    mol pqr protein.pqr
end

elec name solv
    mg-auto
    dime 33 33 33 
    cglen 40 40 40
    fglen 20 20 20
    cgcent mol 2
    fgcent mol 2
    mol 1

And this worked just fine.

We may want to update the documentation rather than changing the code at this point.

Desktop (please complete the following information):

sobolevnrm commented 9 months ago

I believe this is where the molecule is chosen for the coordinates: https://github.com/Electrostatics/apbs/blob/c2e5af22c9044b2bb8f9c1114710add58ec5b007/src/mg/vpmg.c#L958