I am currently looking for an efficient way to detect common functional groups - that is, characterize whether a molecule is an alcohol, an aromatic compound, etc. - in a larger database consisting of xyz geometry files. Is there an existing tool out there that could do this task?
I am aware that the task is not well-defined, since connectivity between different atoms is always up to some empiricism in an xyz file. Moreover, the definition of functional groups is also not super obvious. However, I am aware of tools that would categorize a structure based on a connectivity matrix (such as checkmol), and converting an xyz file to a connectivity matrix should also be a solved issue (for example all visualization softwares seem to do it). It might also be very well possible that such operation is contained in OpenBabel or a similar bundle, I am just not completely familiar with these tools, and I would rather not invest days, or weeks, writing scripts that might already be out there.
Has someone worked on a problem like this, or do you know how to automatically detect functional groups from Cartesian geometry?
EDIT:
Based on the excellent answer below, I've compiled a rudimentary Bash script that sort of does what I wanted it to do. I am sharing it now, as it might be helpful for others
XYZ_DIR=/directory_to_xyz
MOLDIR=/output_of_mols
GROUPDIR=/output_of_groups
for file in $XYZ_DIR/*xyz; do
obabel $file -omol -O ${file%.xyz}.mol 2> >(grep -v "onvert")
./checkmol ${file%.xyz}.mol > ${file%.xyz}.groups
mv ${file%.xyz}.mol $MOLDIR/
mv ${file%.xyz}.groups $GROUPDIR
done
Note that the OpenBabel output has been supressed when the conversion is succesfull so as not to clutter the screen.