schrodinger.structutils.createfragments module

This script will break up a set of input molecules into fragments based on some simple rules, similar to those described in the original RECAP paper. Run with -h to see the basic rules.

If -murcko option is specified, then Murco Assembly scaffolds are generated instead of fragments. This is done by removing terminal from each “branch” until reacing a ring.

If -recap option is specified, then rules are as follows:

  1. Only break the bonds matching the RECAP SMARTS patterns.
    1. Amide

    2. Ester

    3. Amine

    4. Urea

    5. Ether

    6. Olefin

    7. Quarternary nitrogen

    8. Aromatic nitrogen - aliphatic carbon

    9. Lactam nitrogen - aliphatic carbon

    10. Aromatic carbon - aromatic carbon

    11. Sulphonamide

  2. Do not break ring bonds

  3. Do not break bonds that would yield one of the following fragments: hydrogen, methane, ethane, prone, butane.

NOTE: -recap_use can be used to specify which RECAP rules to use. The value must be a list of comma-separated numbers (no spaces).

Example usage:

from schrodinger.structutils import createfragments
frag_creator = createfragments.FragmentCreator(atoms=options.atoms,
                        bonds=options.bonds, smarts=options.smarts,
                        carbon_hetero=options.carbon_hetero,
                        maxatoms=options.maxatoms,
                        removedup=options.removedup, murcko=options.murcko,
                        recap=options.recap, recap_use=recap_list,
                        complete=options.complete,
                        add_h=options.add_h, verbose=True)
for struct in my_structures:
    # fragments is a list of Structure objects
    fragments = frag_creator.fragmentStructure(struct)

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.structutils.createfragments.are_sts_the_same(st1, st2)

Checks coordinates of each atom in the specified structures and returns true if they are the same

Parameters
  • st1 (structure.Structure) – The first structure for comparison

  • st2 (structure.Structure) – The second structure for comparison

Return type

bool

Returns

True if the structures have the same coordinates, False if not

schrodinger.structutils.createfragments.find_recap_bonds(st, options)

Find all bonds that match the RECAP rules described in J. Chem. Inf. Comput. Sci. 1998, 38, 511-522

Will return a list of [(atom1, atom2, rule_num)].

Parameters
Return type

set of tuples

Returns

Each tuple is (atom1, atom2, rule_num) where atom1 and atom2 are the atoms involved in the bond and rule_num is the recap rule that the bond matches. atom1 and atom2 are sorted.

class schrodinger.structutils.createfragments.FragmentCreator(**kwargs)

Bases: object

This class will break up input structures into fragments based on some simple rules. The basic rules are:

  1. Cut one of these 2 types of bonds
    1. Bonds to rings
      1. Do not cut bonds to hydrogens

      2. Do not cut any in-ring bonds

      3. Do not cut bonds between ring-carbon and a non-carbon atoms (allowed with -c option)

    2. Carbon-carbon bonds a. Do not cut any bonds if either atom is in any ring

  2. Refuse a fragment if any part of it matches a line in the SMARTS file specified by -smarts.

  3. Refuse a fragment if the number of broken bonds exceeds -bonds.

  4. Refuse a fragment if the number of atoms is less than -atoms.

  5. Do not attempt to fragment molecules with more than -maxatoms atoms.

For -recap option, here are the rules that are used:

  1. [#6][C;X3](=O)!@[N;X3] Amide

  2. [!#1][O;X2]!@[C;X3](=O)[C;X4;H2,H3] Ester

  3. [#7;X3](!@[C,N&X3,#1])([C,N&X3,#1])[C,N&X3,#1] Amine

  4. [#7;X3]!@[C;X3](=O)[#7;X3] Urea

  5. [#6]!@[O;X2][#6] Ether

  6. [#6]=!@[#6] Olefin

  7. [#7;X4]!@[#6] Quarternary nitrogen

  8. [n]!@[C] Aromatic nitrogen - aliphatic carbon

  9. C!@N@C=O Lactam nitrogen - aliphatic carbon

  10. c!@c Aromatic carbon - aromatic carbon

  11. [#7][S;X4](=O)(=O) Sulphonamide

__init__(**kwargs)

Create a FragmentCreator object.

Parameters
  • atoms (int) – Minimum number of non-hydrogen atoms in a fragment (default=2)

  • bonds (int) – Maximum number of broken bonds allowed in creating a fragment (default=100)

  • smarts (str) – Path to a file of SMARTS patterns (one per line) to identify and eliminate fragments containing undesired features.

  • carbon_hetero (bool) – Allows cutting of bonds between ring-carbon and hetero atoms (default=False)

  • maxatoms (int) – Maximum number of atoms allowed in molecule to be fragmented (default=200).

  • removedup (bool) – Keep only one copy of identical fragment but with different coordinates. (default=False)

  • murcko (bool) – Generate Murco Assembly scaffold instead of regular fragments. (default=False)

  • recap (bool) – Use RECAP rules to find bonds to break.

  • recap_use (list of int) – Specify which RECAP rules to use (default is to use all). Value must be a list of integers (example: [1, 2, 10, 11]).

  • complete (bool) – Retain the complete list of fragments created, including intermediates. Only works with RECAP rules. (Default: False)

  • complete – Add hydrogens to complete lewis structures. I some calses, you do not want to do this (Default: True)

  • verbose (bool) – True if progress should be logged, False if not

getPatternString()

Get a string that describes the RECAP patterns

Return type

str

Returns

A string describing the RECAP patterns.

checkArgs()

Check the input arguments for appropriate usage

fragmentStructure(struct)

Break the input structure into fragments.

Parameters

struct (schrodinger.structure.Structure) – The structure to break into fragments

Return type

list

Returns

list of schrodinger.structure.Structure objects for the fragments.

fragmentStructureForEA(struct)

Break the input structure into fragments. Used for Event Analyis (EA)

Returns

list of schrodinger.structure.Structure objects for the fragments