Knowledge Base

Article ID: 956 - Last Modified:

I would like to filter a collection of molecules and keep those that match a functional group or a SMARTS pattern. How do I do this?

There are several methods that you can use to perform this task. For most methods, you will need to define your functional group as a SMARTS pattern.

To copy a SMARTS pattern for your functional group onto the clipboard for future use, using Maestro, simply select the atoms of the functional group in the Workspace and press CTRL+C (Edit → Copy).

To filter your molecules, you can use one of the following methods.

  • Use the Canvas GUI. There are two functions to perform substructure searches:

    • Structure → Structure Filter
    • Query → Substructure Query
  • Use the powerful canvasSearch utility from the command line.

    First, generate a query file containing one or more SMARTS strings. Then submit a command similar to the following to produce a structure file of compounds that match all queries in the query file:

    $SCHRODINGER/utilities/canvasSearch -imae structures.mae -qsmi query-file -omae structures-out.mae

    To add a count of the substructures in the query file to a structure file, use

    $SCHRODINGER/utilities/canvasSearch -imae input.mae -qsmi query-file -omae output.mae -require 0 -matchCount

    You can then filter based on substructure counts using the -filter option. See the Canvas User Manual for a description of the options for canvasSearch.

  • Use the Ligand Filtering panel in Maestro.

    1. Choose Tools → Ligand Filtering in the main window.
      The Ligand Filtering panel opens.
    2. Choose the source of structures from the Use structures from option menu, and specify the file if you chose File.
    3. In the Functional Group Counts tab, select the desired functional group from the Select a functional group list.
      If the functional group you are interested in isn't listed in the Functional Group Counts tab, you can create a new one as follows:
      1. Click New.
        The Add Definition dialog box opens.
      2. Enter a functional group name in the Name of new functional group text box.
      3. Paste or type the SMARTS pattern into the SMARTS expression or selected functional group text box, and click Include.
        The SMARTS pattern appears in the lower text area preceded by a + sign, to indicate that atoms that match this pattern are included in the definition of the functional group. You can build up the functional group by including and excluding other patterns.
      4. Click Add.
        The dialog box closes, and the functional group is added to the list in the Ligand Filtering panel.
    4. Set the filtering criteria. For example, to include molecules that contain the desired functional group, use > 0.
    5. Click Add. The criterion is added to the Filtering definitions and criteria list.
    6. Click Start to set the job parameters and start the filtering job.
  • Run $SCHRODINGER/utilities/ligfilter.

    This is the utility that is run from Maestro from the Ligand Filtering panel. This utility takes an input file that defines the filter. You can set up the filter in Maestro using the procedure above, and click Write instead of Start to obtain the input file.

  • Use the script "Project Select by Smarts", which is available from the Script Center.

    This script selects the entries in the Project Table that match a supplied Smarts pattern. When you have downloaded and installed the script, open it from the Scripts menu, insert the SMARTS pattern into the text box, and click Select. The structures are selected in the Project Table.

Keywords: Maestro

Back to Search Results

Was this information helpful?

What can we do to improve this information?

To ask a question or get help, please submit a support ticket or email us at
Knowledge Base Search

Type the words or phrases on which you would like to search, or click here to view a list of all
Knowledge Base articles