Hi David,
in principle I agree with your analysis, but to me the place where the function
breaks is when you perform the same operation in two steps instead of one and
you obtain a different result.
The pH transformation rule works just fine if you perform the hybridization
perception before applying it (2-steps mode) so I would argue that's not the
problem, since the input is the same.
I have seen this kind issue before, when the file conversion operation triggers
a bunch of perception steps that do not happen otherwise.
Knowing what those operations are and make sure they happen all the time (or
mad that easily accessible to the user) can definitely help, here.
S
On 6/4/21 2:25 PM, David Koes wrote:
I think the problem here is in the ph model since the problem doesn't happen if
you omit the ph specification. Passing a pH causes AddHydrogens to be called
with correctForPH set to true, which is not the default. That is, it's not
that there is a default pH that is used, but the default is to not try to
account for pH at all.
The line in phmodel.txt that is applying the charge to the nitrogen is this one:
TRANSFORM [N^3;!$(N~[!#6;!#1]):1] >> [N+:1] 10.0 # pKa from
conjugated acid (BH+)
The ^3 is requiring the N have hybridization 3. Probably this rule is overly
broad, but I lack the expertise to correct it.
David Koes
Associate Professor
Computational & Systems Biology
University of Pittsburgh
On 5/14/21 5:44 PM, Stefano Forli wrote:
Hi all,
I agree about the impractical task of fixing the task in more than a handful of
files.
Besides, there's an intrinsic problem with fully supported file formats that do
not have such information.
@David Koes: A week ago I posted about this issue: if you try reading a
perfectly valid XYZ file (which has no charges) of ammonium with this command,
you end up with a nitrogen with 5 bonds:
obabel ammonium.xyz -ph 7 -O ammonium_xyz.mol2
@David van der Spoel: one thing I've noticed is that charged systems get
properly recognized if you perform an intermediate conversion before
manipulating the molecule. For the above issue, for example, it generates the
proper protonated nitrogen:
obabel ammonium.xyz -O ammonium_xyz_step1.mol2
obabel ammonium_xyz_step1.mol2 -ph 7 -O ammonium_xyz_step2.mol2
I've tried to figure out where the formal charge perception happens, but
without success. Possibly doing so before the bond perception might help fixing
your problem without having to extend the bondtyp.txt file? (but definitely not
if the SMARTS pattern is missing).
S
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel
--
Stefano Forli, PhD
Associate Professor
Dept. of Integrative Structural
and Computational Biology, MB-112A
Scripps Research
10550 North Torrey Pines Road
La Jolla, CA 92037-1000, USA.
tel: +1 (858)784-2055
email: fo...@scripps.edu
https://forlilab.org
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel