Comments (7)
It looks like FESetup uses OpenBabel (along with other things) to compute the formal charge. If this isn't something that we want to support in BioSimSpace at present, then the PDB files for all of the ligands in the D3R2018 challenge set will need to be updated with the correct charge.
For reference, here's some adapted code from FESetup that shows how to use OpenBabel to calculate the formal charge. This gives a value of +2 |e| for all ligands in the D3R2018 data set.
# formal_charge.py
import openbabel as ob
import sys
# Get the name of the PDB file.
file = sys.argv[1]
# Read the ligand PDB into an OpenBabel molecule.
# The PDB file has no formal charge information.
conv = ob.OBConversion()
mol = ob.OBMol()
conv.ReadFile(mol, file)
# Define some variables from FESetup's "const.py" file.
_phospho = '[#15D4](~[OD1])(~[OD1])(~[OD2])~[OD2]'
_sulfonyl = '[#16](~[OD1])(~[OD1])'
# Again, below is taken from "const.py"
# FIXME: this compensates for missing charge determination by Openbabel, so
# will fail to detect charges in cases not covered here'; relies on
# explicit hydrogens!
CHARGE_SMARTS = (
('[#16;$([#16D4](~[OD1])(~[OD1])~[OD1])]', -1), # sulfates, Sac
('[#16;$([#16D3](~[OD1])~[OD1])]', -1), # sulfonates, Sac
('[#15;$([#15D4](~[OD1])(~[OD1])~[OD1])]', -2), # phosphates, Pac
('[#15;$([#15D3](~[OD1])~[OD1])]', -2), # phosphonates, Pac
('[#15;$(%s)]' % _phospho, -1), # polyphosphates or phosphate diesters
('[CD3](~[NH2])(~[NH2])~[NH]', +1), # guanidinium
('O=C~[CD3,ND2]~C=O', -1), # beta-dicarbonyls, imides
('%s~[ND2]~C(=O)~[NH]' % _sulfonyl, -1), # sulfonylureas
('%s~[ND2]~C(=O)~[#6]' % _sulfonyl, -1), # (sulfon)imides
('%s~[ND2]~c' % _sulfonyl, -1), # N-aryl sulfonamides
('{0}~[ND2]~{0}'.format(_sulfonyl), -1), # sulfonimides 2
('[#6][ND3]([#6])~[#6H]~[ND3]([#6])[#6]', +1), # formamidiniums
('C(~[OD1])~[OD1]', -1), # carbonates, Cac in atomtyp.txt
('[#6][#16D1]', -1), # thiolates
('[#6][#8D1]', -1), # alkoxides (alcoholates)
('[#7D4]', +1), # atomtyp.txt checks for [#7X4]
('{0}~[ND3](~{0})~[CD3](~{0})~{0}'.format('[#6,#1]'), +1), # imines
)
# Zero the total formal charge.
formal_charge = 0
# Initialise the smarts pattern object.
sm = ob.OBSmartsPattern()
# Loop over all smarts strings / formal charge pairs.
for smarts, fchg in CHARGE_SMARTS:
sm.Init(smarts)
# Does the molecule match this string.
# If so, update the formal charge.
if sm.Match(mol):
m = list(sm.GetUMapList() )
formal_charge += fchg * len(m)
# Print the total formal charge.
print(file, formal_charge)
And run from the command-line, sitting in the top-level of the D3R2018 repositiory:
for i in $(ls CatS/BSS/ligands_aligned/*pdb); do
python formal_charge.py $i
done
Output:
CatS/BSS/ligands_aligned/CatS_122.pdb 2
CatS/BSS/ligands_aligned/CatS_127.pdb 2
CatS/BSS/ligands_aligned/CatS_130.pdb 2
CatS/BSS/ligands_aligned/CatS_131.pdb 2
CatS/BSS/ligands_aligned/CatS_132.pdb 2
CatS/BSS/ligands_aligned/CatS_139.pdb 2
CatS/BSS/ligands_aligned/CatS_141.pdb 2
CatS/BSS/ligands_aligned/CatS_142.pdb 2
CatS/BSS/ligands_aligned/CatS_144.pdb 2
CatS/BSS/ligands_aligned/CatS_153.pdb 2
CatS/BSS/ligands_aligned/CatS_155.pdb 2
CatS/BSS/ligands_aligned/CatS_157.pdb 2
CatS/BSS/ligands_aligned/CatS_160.pdb 2
CatS/BSS/ligands_aligned/CatS_162.pdb 2
CatS/BSS/ligands_aligned/CatS_165.pdb 2
CatS/BSS/ligands_aligned/CatS_167.pdb 2
CatS/BSS/ligands_aligned/CatS_172.pdb 2
CatS/BSS/ligands_aligned/CatS_174.pdb 2
CatS/BSS/ligands_aligned/CatS_176.pdb 2
CatS/BSS/ligands_aligned/CatS_177.pdb 2
CatS/BSS/ligands_aligned/CatS_178.pdb 2
CatS/BSS/ligands_aligned/CatS_180.pdb 2
CatS/BSS/ligands_aligned/CatS_181.pdb 2
CatS/BSS/ligands_aligned/CatS_184.pdb 2
CatS/BSS/ligands_aligned/CatS_185.pdb 2
CatS/BSS/ligands_aligned/CatS_186.pdb 2
CatS/BSS/ligands_aligned/CatS_191.pdb 2
CatS/BSS/ligands_aligned/CatS_195.pdb 2
CatS/BSS/ligands_aligned/CatS_252.pdb 2
CatS/BSS/ligands_aligned/CatS_253.pdb 2
CatS/BSS/ligands_aligned/CatS_255.pdb 2
CatS/BSS/ligands_aligned/CatS_29.pdb 2
CatS/BSS/ligands_aligned/CatS_30.pdb 2
CatS/BSS/ligands_aligned/CatS_4.pdb 2
CatS/BSS/ligands_aligned/CatS_52.pdb 2
CatS/BSS/ligands_aligned/CatS_76.pdb 2
CatS/BSS/ligands_aligned/CatS_79.pdb 2
CatS/BSS/ligands_aligned/CatS_84.pdb 2
CatS/BSS/ligands_aligned/CatS_9.pdb 2
from biosimspace.
All of the ligands in this directory have the correct formal charge listed in the PDB file, i.e. there are two N1+ atoms, giving an overall formal charge of +2|e|. BioSimSpace can correctly read/write this information.
It looks like the formal charge must have been lost along the way during the preparation stage, perhaps when using FKCOMBU to align them. I'll see if it's easy to re-add the missing information in the prepared input files.
from biosimspace.
I've managed to edit all of the ligand PDB files by hand. I'll now re-parameterise them all with GAFF2 to correct the charges. It would be good to have write access to the D3R2018 repo so I can update the files once I'm done.
from biosimspace.
I assume you realised you already had write access?
from biosimspace.
Strange, when I tried pushing it said "access denied". Will try again tomorrow.
from biosimspace.
Worked this time, how bizarre. Perhaps there was a network issue when I last tried.
from biosimspace.
Glad it did!
from biosimspace.
Related Issues (20)
- Storage quota exceeded on the Anaconda cloud HOT 1
- HILLS file not updating during restarting simulation HOT 4
- Is it possible to add ions to an already solvated system, without adding any more water molecules? HOT 4
- Problem when converting Gro/Top to Rst7 HOT 12
- Making HMR work with dummies HOT 11
- Make _removeDummies() recognise dummy bonds HOT 10
- Would it be possible to include HiMap as an alternative to LoMap in the generateNetwork method? HOT 2
- Unable to import BioSimSpace after mamba installation HOT 12
- BioSimSpace.Align.viewMapping: py3Dmol.view not rendering in Jupyter Notebook HOT 11
- `_toRegularMolecule` failing with `convert_amber_dummies=True` HOT 15
- Absolute Binding Free Energy Calculations with GROMACS HOT 7
- Pickling a parametrised molecule from an SDF file with GAFF2 HOT 4
- Are atomtypes meant to be updated when using repartitionHydrogenMass? HOT 16
- [BUG] OSError "It looks like you failed to include a topology file." when reading SDF which doesn't contain redundant bond order information HOT 10
- [BUG] Cannot import BioSimSpace after installation of biosimspace 2023.1.2 using mamba HOT 3
- AnalysisError: SOMD free-energy analysis failed! HOT 5
- [BUG] HOT 10
- Reporting a vulnerability
- [BUG] Water molecule coordinates are setting to (0,0,0) HOT 4
- Issue in reproducing the funnel methadynamics tutorial HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biosimspace.