public class Attachment extends Object implements Serializable
An attachment atom is a MolAtom
in a Molecule
which denotes rgroup attachment. In case of scaffold
definitions it is denoted as Rn
, having special atom type: MolAtom.getAtno()
is
MolAtom.RGROUP
and n
is returned by MolAtom.getRgroup()
. Fragment definitions represent
such pseudo atom with atom having alias string Zx
returned by MolAtom.getAliasstr()
.
Constructor and Description |
---|
Attachment(int attachmentAtomIndex,
int attachedAtomIndex,
int attachmentIndex,
int bondOrder) |
Modifier and Type | Method and Description |
---|---|
static Attachment |
addZAttachment(Molecule mol,
int attachedAtomIndex,
int attachmentIndex,
int bondOrder) |
void |
ensureValidRepresentation(Molecule mol,
String prefix)
Ensure that structure mapping is consistent.
|
static Attachment |
forFragmentZ(Molecule mol,
int attachmentAtomIndex)
Create attachment description for a fragment Z atom.
|
static Attachment |
forScaffoldR(Molecule mol,
int attachmentAtomIndex)
Create attachment description for scaffold's R atom.
|
int |
getAttachedAtomIndex()
Attached atom index.
|
int |
getAttachmentAtomIndex()
Attachment atom index.
|
int |
getAttachmentIndex()
Attachemnt index.
|
int |
getBondOrder()
Represented bond order.
|
static boolean |
isRAtom(Molecule mol,
int atomindex)
Check if a given atom is an R atom.
|
static boolean |
isZAtom(Molecule mol,
int atomindex)
Check if a given atom has an alias string.
|
static Attachment |
replaceAtomWithR(Molecule mol,
int attachmentAtomIndex) |
static Attachment |
replaceAtomWithR(Molecule mol,
int attachmentAtomIndex,
int rno)
Replace an atom with an Rn atom and return the appropriate attachment descriptor.
|
String |
toString() |
Attachment |
transform(com.chemaxon.calculations.sc.util.IntListSet atomSelection)
Transform attachment for molecule subset selection.
|
public Attachment(int attachmentAtomIndex, int attachedAtomIndex, int attachmentIndex, int bondOrder)
public static boolean isRAtom(Molecule mol, int atomindex)
mol
- Input moleculeatomindex
- R atom candidate indexpublic static boolean isZAtom(Molecule mol, int atomindex)
mol
- Input moleculeatomindex
- Z atom candidate indexpublic void ensureValidRepresentation(Molecule mol, String prefix)
mol
- Mapped structureprefix
- Pseudo atom label prefixIllegalArgumentException
- in case of bond type, label or connectivity mismatchpublic static Attachment forScaffoldR(Molecule mol, int attachmentAtomIndex)
mol
- Scaffold moleculeattachmentAtomIndex
- index of the Rn atom to be representedIllegalArgumentException
- in case of consistency error or when the given atom is not an R atompublic static Attachment forFragmentZ(Molecule mol, int attachmentAtomIndex)
mol
- Fragment moleculeattachmentAtomIndex
- index of the Zn atom to be representedIllegalArgumentException
- in case of consistency error or when the given atom is not an R atompublic static Attachment addZAttachment(Molecule mol, int attachedAtomIndex, int attachmentIndex, int bondOrder)
public static Attachment replaceAtomWithR(Molecule mol, int attachmentAtomIndex, int rno)
mol
- Target molecule to modifyattachmentAtomIndex
- Index of attachment atom to replacerno
- R numberIllegalArgumentException
- in case of consistency errorpublic static Attachment replaceAtomWithR(Molecule mol, int attachmentAtomIndex)
public int getAttachmentIndex()
public int getAttachedAtomIndex()
public int getAttachmentAtomIndex()
public int getBondOrder()
public Attachment transform(com.chemaxon.calculations.sc.util.IntListSet atomSelection)
atomSelection
- Selection to be executed. Formally, in the selected molecule, atom with index i
is originated from the original molecule's atom with index atomSelection[i]
(using array notation)IllegalArgumentException
- when the represented attachment or the attached atom is not part of the selection