Package com.actelion.research.chem
Class RingCollection
- java.lang.Object
-
- com.actelion.research.chem.RingCollection
-
public class RingCollection extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_SMALL_RING_SIZE
static int
MODE_INCLUDE_TAUTOMERIC_BONDS
static int
MODE_SMALL_AND_LARGE_RINGS
static int
MODE_SMALL_AND_LARGE_RINGS_AND_AROMATICITY
static int
MODE_SMALL_RINGS_AND_AROMATICITY
static int
MODE_SMALL_RINGS_ONLY
-
Constructor Summary
Constructors Constructor Description RingCollection(ExtendedMolecule mol, int mode)
Generates the complete set of small rings, which don't contain metal atoms and have up to 7 members.
If mode includes LARGE_RINGS, then it determines for every atom and bond the size of the smallest ring, which they are a member of.
If mode includes AROMATICITY then every small ring is checked, whether it is aromatic.RingCollection(ExtendedMolecule mol, int mode, int maxSmallRingSize)
Generates the complete set of small rings, which don't contain metal atoms and have up to 7 members.
If mode includes LARGE_RINGS, then it determines for every atom and bond the size of the smallest ring, which they are a member of.
If mode includes AROMATICITY then every small ring is checked, whether it is aromatic.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
determineAromaticity(boolean[] isAromatic, boolean[] isDelocalized, int[] heteroPosition, boolean includeTautomericBonds)
int
getAtomIndex(int ringNo, int atom)
int
getAtomRingSize(int atom)
An atom's ring size is the size of the smallest ring the atom is a member of.int
getBondIndex(int ringNo, int bond)
int
getBondRingSize(int bond)
A bond's ring size is the size of the smallest ring the bond is a member of.int
getHeteroPosition(int ringNo)
Returns the position of the electron pair providing hetero atom or carbenium atom in case of 5-membered, respective 7-membered aromatic ring.int[]
getRingAtoms(int ringNo)
int[]
getRingBonds(int ringNo)
int
getRingSize(int ringNo)
int
getSharedRing(int bond1, int bond2)
brute force method to check, whether and which ring is shared by two bondsint
getSize()
boolean
isAromatic(int ringNo)
Return whether the ring is considered aromatic.boolean
isAtomMember(int ringNo, int atom)
boolean
isBondMember(int ringNo, int bond)
boolean
isDelocalized(int ringNo)
Return whether the ring is considered delocalized, which are 6-membered aromatic rings with no preference concerning where the double bonds are located.boolean
qualifiesAsAmideTypeBond(int bond)
Checks, whether this bond may contribute pi-electrons from an amide-resonance to an aromatic ring.static boolean
qualifiesAsAromatic(int atomicNo)
int
validateMemberIndex(int ringNo, int index)
Adds or subtracts the ring size from index to move it into the valid range from 0 to ringSize-1.
-
-
-
Field Detail
-
MAX_SMALL_RING_SIZE
public static final int MAX_SMALL_RING_SIZE
- See Also:
- Constant Field Values
-
MODE_SMALL_RINGS_ONLY
public static final int MODE_SMALL_RINGS_ONLY
- See Also:
- Constant Field Values
-
MODE_SMALL_AND_LARGE_RINGS
public static final int MODE_SMALL_AND_LARGE_RINGS
- See Also:
- Constant Field Values
-
MODE_SMALL_RINGS_AND_AROMATICITY
public static final int MODE_SMALL_RINGS_AND_AROMATICITY
- See Also:
- Constant Field Values
-
MODE_SMALL_AND_LARGE_RINGS_AND_AROMATICITY
public static final int MODE_SMALL_AND_LARGE_RINGS_AND_AROMATICITY
- See Also:
- Constant Field Values
-
MODE_INCLUDE_TAUTOMERIC_BONDS
public static final int MODE_INCLUDE_TAUTOMERIC_BONDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RingCollection
public RingCollection(ExtendedMolecule mol, int mode)
Generates the complete set of small rings, which don't contain metal atoms and have up to 7 members.
If mode includes LARGE_RINGS, then it determines for every atom and bond the size of the smallest ring, which they are a member of.
If mode includes AROMATICITY then every small ring is checked, whether it is aromatic.- Parameters:
mol
-mode
- one of the public MODE_ options
-
RingCollection
public RingCollection(ExtendedMolecule mol, int mode, int maxSmallRingSize)
Generates the complete set of small rings, which don't contain metal atoms and have up to 7 members.
If mode includes LARGE_RINGS, then it determines for every atom and bond the size of the smallest ring, which they are a member of.
If mode includes AROMATICITY then every small ring is checked, whether it is aromatic.- Parameters:
mol
-mode
- one of the public MODE_ optionsmaxSmallRingSize
- largest ring size considered a small ring
-
-
Method Detail
-
getAtomRingSize
public int getAtomRingSize(int atom)
An atom's ring size is the size of the smallest ring the atom is a member of. If the atom doesn't belong to any ring the ring size is 0. If an atom is member of rings larger than 7 members only and if the mode parameter of the constructor didn't include LARGE_RINGS, then the returned ring size is also 0.- Parameters:
atom
-- Returns:
- ring size or 0
-
getBondRingSize
public int getBondRingSize(int bond)
A bond's ring size is the size of the smallest ring the bond is a member of. If the bond doesn't belong to any ring the ring size is 0. If a bond is member of rings larger than 7 members only and if the mode parameter of the constructor didn't include LARGE_RINGS, then the returned ring size is also 0.- Parameters:
bond
-- Returns:
- ring size or 0
-
getSize
public int getSize()
-
getRingAtoms
public int[] getRingAtoms(int ringNo)
-
getRingBonds
public int[] getRingBonds(int ringNo)
-
getRingSize
public int getRingSize(int ringNo)
-
isAromatic
public boolean isAromatic(int ringNo)
Return whether the ring is considered aromatic. If the mode parameter passed to the constructor didn't include AROMATICITY, then a NullPointerException is raised.- Parameters:
ringNo
-- Returns:
-
isDelocalized
public boolean isDelocalized(int ringNo)
Return whether the ring is considered delocalized, which are 6-membered aromatic rings with no preference concerning where the double bonds are located. Pyrrole bonds are not considered delocalized. If the mode parameter passed to the constructor didn't include AROMATICITY, then a NullPointerException is raised.- Parameters:
ringNo
-- Returns:
-
getAtomIndex
public int getAtomIndex(int ringNo, int atom)
-
getBondIndex
public int getBondIndex(int ringNo, int bond)
-
validateMemberIndex
public int validateMemberIndex(int ringNo, int index)
Adds or subtracts the ring size from index to move it into the valid range from 0 to ringSize-1.- Parameters:
ringNo
-index
-- Returns:
-
getHeteroPosition
public int getHeteroPosition(int ringNo)
Returns the position of the electron pair providing hetero atom or carbenium atom in case of 5-membered, respective 7-membered aromatic ring.- Parameters:
ringNo
-- Returns:
- position index referring to ringAtom array
-
isAtomMember
public boolean isAtomMember(int ringNo, int atom)
-
isBondMember
public boolean isBondMember(int ringNo, int bond)
-
getSharedRing
public int getSharedRing(int bond1, int bond2)
brute force method to check, whether and which ring is shared by two bonds- Parameters:
bond1
-bond2
-- Returns:
- -1 if bond1 and bond2 don't share a common ring
-
determineAromaticity
public void determineAromaticity(boolean[] isAromatic, boolean[] isDelocalized, int[] heteroPosition, boolean includeTautomericBonds)
- Parameters:
isAromatic
- empty array sizes as getSize()isDelocalized
-heteroPosition
-includeTautomericBonds
- whether to treat non-methylated amide/thio-amide bonds as pi-bonds
-
qualifiesAsAmideTypeBond
public boolean qualifiesAsAmideTypeBond(int bond)
Checks, whether this bond may contribute pi-electrons from an amide-resonance to an aromatic ring. According to M J Cook, A R Katritzky, P Linda, R D Tack J. Chem. Soc., Perkin Trans. 2, 1972, 1295-1301 2-pyridone and 2-pyridinethione retain most of the aromatic resonance energy of pyridine unless the nitrogen atom is methylated.- Parameters:
bond
-- Returns:
-
qualifiesAsAromatic
public static boolean qualifiesAsAromatic(int atomicNo)
-
-