"obfit" - Superimpose Two Molecules


What Is "obfit" command? How to use it to Superimpose Two Molecules?

✍: FYIcenter.com


"obfit" command is a command line tool provided in the Open Babel package that allows you to Superimpose Two Molecules.

Here is the user manual of the "obfit" command.

     obfit -- superimpose two molecules based on a pattern

     obfit SMARTS-pattern fixed-file outfile

     Superimpose two molecules using a quaternion fit. The atoms used to fit 
     the two molecules are defined by the SMARTS pattern given by the user. It 
     is useful to align congeneric series of molecules on a common structural
     scaffold for 3D-QSAR studies. It can also be useful for displaying the 
     results of conformational generation.

     Any molecules matching the supplied SMARTS pattern will be rotated and 
     translated to provide the smallest possible RMSD between the matching regions. 
     If a molecule does not match the SMARTS pattern, it will be output with no

     Align all the molecules in 'testmv.sdf' on a single molecule of 'testref.sdf' 
     by superimposing them on its N-methylpiperidyl portion (and outputting a 
     new SD file to the standard output):

           obfit '[nh]1c2c(=O)n(C)c(=O)n(C)c2cc1' testref.sdf testmv.sdf

Here is an example of superimposing, or aligning, molecule structures against a reference molecule structures using the "obift" command:

1. Create a toluene molecule structure as the reference molecule with a molecule editor so that you can keep the extra carbon on top of the benzene ring. Save the the tolune molecule structure in toluene.sdf.

2. Convert toluene.sdf to toluene.svg to see the toluene molecule structure.

Upward Toluene Molecule
Upward Toluene Molecule

3. Create 4 more molecule structures similar to the tolune molecule structure, by rotating the ring and replacing C with N, O, and F. Save them in a single file, fit-input.sdf.

4. Convert fit-input.sdf to fit-input.svg to see those similar molecule structures.

Similar Molecule Structures before Alignment
Similar Molecule Structures before Alignment

5. Now fit those those similar molecule structures against the toluene molecule structure with the help of SMARTS pattern "c1cc(*)ccc1".

fyicenter$ obfit 'c1cc(*)ccc1' toluene.sdf fit-input.sdf > fit-output.sdf 
RMSD: 0.000032
RMSD: 0.000032
RMSD: 0.000032
RMSD: 0.000000

6. Convert fit-output.sdf to fit-output.svg to see that all similar molecule structures are superimposed (aligned) to the toluene molecule structure.

fyicenter$ babel fit-output.sdf fit-output.svg 
4 molecules converted
110 audit log messages 
Similar Molecule Structures after Alignment
Similar Molecule Structures after Alignment

As you can see, "obfit" did a good job to superimpose or align structures of all similar molecules to the given reference molecule structure.


"obgen" - Generate Molecule 3D Structures

"obenergy" - Calculate Molecule Energy

Other Open Babel Commands

⇑⇑ Open Babel Tutorials

2020-11-11, 171👍, 0💬