Collections:
"babel -s ..." Command - Substructure Search
How to use "babel -s ..." command to do substructure search?
✍: FYIcenter.com
You can do substructure search using the "-s ..." option of the "babel" command with the following syntax:
babel input_section output_section -s smarts_string
The smarts_string specifies a SMARTS string that represents a molecule pattern. "babel" command will apply this pattern to each molecule in the input data source. If the the pattern matches a substructure of the molecule, it will be written to the output. Otherwise, it will be skipped.
Substructure search is also called substructure filtering or substructure matching.
Here are some examples of substructure matching with a single atom as the molecule pattern:
fyicenter$ # methane molecule contains an aliphatic carbon fyicenter$ obabel -:C -o smiles -s C C 1 molecule converted fyicenter$ # methane molecule contains no aromatic carbon fyicenter$ obabel -:C -o smiles -s c 0 molecules converted fyicenter$ # benzene molecule contains an aromatic carbon fyicenter$ obabel -:c1ccccc1 -o smiles -s c c1ccccc1 1 molecule converted fyicenter$ # benzene molecule contains no aliphatic carbon fyicenter$ obabel -:c1ccccc1 -o smiles -s C 0 molecules converted
Here is another group of examples of substructure matching with a single bond as the molecule pattern:
fyicenter$ # tyrosine molecule contains a two-aromatic-carbon bond fyicenter$ obabel "-:c1cc(ccc1CC(C(=O)O)N)O" -o smiles -s cc c1cc(ccc1CC(C(=O)O)N)O 1 molecule converted fyicenter$ # tyrosine molecule contains an aromatic-carbon-aliphatic-carbon bond fyicenter$ obabel "-:c1cc(ccc1CC(C(=O)O)N)O" -o smiles -s cC c1cc(ccc1CC(C(=O)O)N)O 1 molecule converted fyicenter$ # tyrosine molecule contains no aromatic-carbon-nitrogen bond fyicenter$ obabel "-:c1cc(ccc1CC(C(=O)O)N)O" -o smiles -s cN 0 molecules converted fyicenter$ # tyrosine molecule contains an aliphatic-carbon-nitrogen bond fyicenter$ obabel "-:c1cc(ccc1CC(C(=O)O)N)O" -o smiles -s CN c1cc(ccc1CC(C(=O)O)N)O 1 molecule converted
You can validate the above matching result by looking at the tyrosine molecule structure below:
⇒ Substructure Search with Wildcard Atom "*"
⇐ Substructure Search with Open Babel
2020-06-08, 931🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1004903 Names: InChIKey: XUCIJNAGGSZNQT-UHFFFAOYS A-NSMILES: N#CC(OC2OC(CO...
How to create a molecule structure with custom wedge/hash bonds? I don't like the default presentati...
Molecule Summary: ID: FYI-1001331 SMILES: CC(C)(O[C@@H]1C[C@@H]([C @H](C[C@@H](C([C@]2(C)C= C3)=CC3=O)...
Molecule Summary: ID: FYI-1006450 Names: InChIKey: SGFFHEILEQJVBO-AXTYYQCES A-MSMILES: Cl[Ru]4o[n+](...
Molecule Summary: ID: FYI-1004647 Names: InChIKey: NGTFVDVHOJMAJY-UHFFFAOYS A-NSMILES: CC1(O)CCCC2(C...