Thanks for pointing out parsmart.cpp!
Sorry, let me rephrase my question (or separate my many related questions):
I have a very basic atomic structure (not part of OpenBabel) that I am
implementing and I would like to assign GAFF atom types to it. All I know
are the element names and the types of bond orders (single, double).
I don't understand OpenBabel's molecule object model very well, but from
looking at parsmart.cpp and gaff.prm seems to indicate that there is a
rather complex ruleset for assigning atom types to molecules. If all I know
are the bond orders and element names, I would have to iterate through all
of the atoms, search around each atom for the atoms joined to it, and
classify each atom based on the types of atoms around it and the
description in gaff.prm:
"other hydrogen e.g. on aromatic C"
"hydrogen on aliphatic C"
"hydrogen on oxygen"
"inner sp2 C of conjugated chain systems"
However, this won't do because it requires the atoms around it to be
classified in the first place, so the algorithm is kind of like a
chicken-egg problem.
Then I noticed that there are SMARTS strings corresponding to atom types,
e.g:
[#6X3;R](=*)-*=*
[#6X3;R](=*)-*#*
[#6X3;R](#*)-*#*
all correspond to atom type 'cc'.
*1. Is the assignment of atom types somehow based on the SMARTS string of a
molecule? *It would make sense that each atom has some SMARTS string
property that is compared to the gaff.prm file.
*2. How complex of a task is atom assignment to gaff.prm? *I ask this
because I am not particularly adept at debugging c++, worser still at the
c++ language itself, and a 3000+ lines of smarts parsing is a bit
depressing to see... :P
actually the question I really care about is:
*3. How do I assign the GAFF atom types given what I know?*
sorry for my inexperience... just trying to learn here.
Thank you!
- Eric
On Mon, Dec 19, 2011 at 4:10 PM, Geoff Hutchison
<ge...@geoffhutchison.net>wrote:
> > So I guess the question becomes: how do I obtain the SMARTS string for
> each atom in GAFF? Again, all I know is which atoms are connected to each
> other and the bond type (single, double).
>
> I'm not sure I understand your question. SMARTS is a pattern matching
> system. So the Open Babel code runs the SMARTS pattern and finds all
> matching atoms, e.g.:
>
> atom [#6X3](N)(N)N cz "guanidine carbon"
>
> So if I run this on benzene, nothing matches. If I run it on guanidine, I
> obviously get some matches. The OB code handles interpreting the SMARTS
> (e.g., in this case, atom #6 with 3 total connections, bonded to 3
> nitrogens.
>
> The code for SMARTS is in the src/parsmart.cpp file.
>
> Hope that helps,
> -Geoff
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss