1obgrep(1)                   User's Reference Manual                  obgrep(1)
2

NAME

4     obgrep — an advanced molecular search program using SMARTS
5

SYNOPSIS

7     obgrep [OPTIONS] 'SMARTS-pattern' filename
8

DESCRIPTION

10     The obgrep tool can be used to search for molecules inside multi-molecule
11     database files (e.g., SMILES, SDF, etc.) or across multiple files.
12

OPTIONS

14     If only a filename is given, obgrep will attempt to guess the file type
15     from the filename extension.
16
17     -c    Print the number of matches
18
19     -f    Full match, print matching-molecules only when the number of heavy
20           atoms is also equal to the number of atoms in the SMARTS pattern
21
22     -i format
23           Specifies input and output format, see obabel(1) for available for‐
24           mats
25
26     -n    Only print the name of the molecules
27
28     -t #  Print a molecule only if the pattern occurs # times inside the mol‐
29           ecule
30
31     -v    Invert the matching, print non-matching molecules
32

EXAMPLES

34     Note that in all examples, the SMARTS pattern is enclosed in single
35     quotes '...' to ensure it is not changed by the shell.
36
37     Print all the molecules with a methylamine group:
38           obgrep 'CN' database.smi
39
40     Print all the molecules without a methylamine group:
41           obgrep -v 'CN' database.smi
42
43     Print the number of molecules without a methylamine group:
44           obgrep -v -c 'CN' database.smi
45
46     Print methylamine (if it exists in the file):
47           obgrep -f 'CN' database.smi
48
49     Print methylamine and/or methanol (if they exist):
50           obgrep -f 'C[N,O]' database.smi
51     Print all molecules with aromatic carbon in all SMILES files in the di‐
52     rectory (i.e., *.smi)
53           obgrep 'c' *.smi
54

SEE ALSO

56     obabel(1), obfit(1), obrotate(1).
57
58     The web pages for Open Babel can be found at: <http://openbabel.org/>
59
60     A guide for constructing SMARTS patterns can be found at:
61     <http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html>
62

AUTHORS

64     The obgrep program was contributed by Fabien Fontaine
65
66     Open Babel is developed by a cast of many, including currrent maintainers
67     Geoff Hutchison, Chris Morley, Michael Banck, and innumerable others who
68     have contributed fixes and additions.  For more contributors to Open Ba‐
69     bel, see <http://openbabel.org/wiki/THANKS>
70
72     Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
73     Some portions Copyright (C) 2001-2007 by Geoffrey R. Hutchison and other
74     contributors.
75
76     This program is free software; you can redistribute it and/or modify it
77     under the terms of the GNU General Public License as published by the
78     Free Software Foundation version 2 of the License.
79
80     This program is distributed in the hope that it will be useful, but WITH‐
81     OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
82     FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
83     more details.
84
85Open Babel 3.1                   Oct 10, 2019                   Open Babel 3.1
Impressum