@PublicAPI public class AtomIdentifier extends java.lang.Object implements java.lang.Comparable<AtomIdentifier>
AtomIdentifier
defines an atom by the:
getMoleculeIndex()
. The value must be non-negative for
non-orphan atoms.getAtomIndex()
. The value must be non-negative for
non-orphan atoms, but can be negative for implicit hydrogens that are
explicitized during the reaction. This can be checked using the method
isExplicitizedHydrogen()
. In this case the value of
the index is the negative value of the index of the atom that is attached to
this hydrogen. If the index of the attached atom is 0, the atom index of the
identifier is Integer.MIN_VALUE
MolAtom
representation of the atom can be acquired using the
method getAtom(Molecule[])
providing the output
molecule array of the reaction. isOrphanAtom()
. If this is
true, the AtomIdentifier
exists only to provide the mapping for the
reaction schema, and the result of getAtom(Molecule[])
will always be null. isVirginAtom(Molecule[])
. In this case the output
molecule array of the reaction must be provided. AtomIdentifier
can store the mapping of the atom for the reaction
schema. This can be acquired by using the method
getReactionSchemaMap()
. Constructor and Description |
---|
AtomIdentifier(int moleculeIndex,
int atomIndex)
Initializes an atom identifier based on the input molecules of the
reaction.
|
AtomIdentifier(int moleculeIndex,
int atomIndex,
int reactionSchemaMap)
Initializes an atom identifier based on the input molecules of the
reaction.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AtomIdentifier other) |
boolean |
equals(java.lang.Object obj) |
MolAtom |
getAtom(Molecule[] outputMolecules)
Gets the
MolAtom representation of the identified atom based on
the provided output molecules of the reaction |
int |
getAtomIndex()
Gets the index of the atom in the molecule
|
int |
getMoleculeIndex()
Gets the index of the molecule - in the input molecules of the reaction -
containing the atom
|
int |
getReactionSchemaMap()
Gets the mapping of the target atom in the reaction schema
|
int |
hashCode() |
boolean |
isExplicitizedHydrogen()
Gets whether the identifier represents an explicit H atom, that was
implicit H atom in the input molecule, and was explicitized during the
reaction, because it matched an explicit H atom in the reaction schema.
|
boolean |
isOrphanAtom()
Gets whether the identifier represents an orphan atom.
|
boolean |
isVirginAtom(Molecule[] outputMolecules)
Gets whether the identifier represents a virgin atom.
|
void |
setReactionSchemaMap(int mapIndex)
Sets the map of the identified atom (the mapping in the reaction schema)
|
java.lang.String |
toString() |
public AtomIdentifier(int moleculeIndex, int atomIndex)
moleculeIndex
- the index of the molecule containing the atom in the input
molecules of the reaction. The value must be non-negative for
non-orphan atoms.atomIndex
- the index of the atom in the molecule. The value must be
non-negative for non-orphan atoms, but can be negative for
implicit hydrogens that are explicitized during the reaction.
In this case The value of the index must be the negative index
atom that is attached to this hydrogen. If the index of the
attached atom is 0, the atom index of the identifier must be
Integer.MIN_VALUE
public AtomIdentifier(int moleculeIndex, int atomIndex, int reactionSchemaMap)
moleculeIndex
- the index of the molecule containing the atom in the input
molecules of the reaction. The value must be non-negative for
non-orphan atoms.atomIndex
- the index of the atom in the molecule. The value must be
non-negative for non-orphan atoms, but can be negative for
implicit hydrogens that are explicitized during the reaction.
In this case The value of the index must be the negative index
atom that is attached to this hydrogen. If the index of the
attached atom is 0, the atom index of the identifier must be
Integer.MIN_VALUE
reactionSchemaMap
- the mapping in the reaction schemapublic void setReactionSchemaMap(int mapIndex)
mapIndex
- the mapping in the reaction schemapublic int getMoleculeIndex()
public int getAtomIndex()
public int getReactionSchemaMap()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public MolAtom getAtom(Molecule[] outputMolecules)
MolAtom
representation of the identified atom based on
the provided output molecules of the reactionoutputMolecules
- the output molecules of the reactionMolAtom
representation of the targetpublic int compareTo(AtomIdentifier other)
compareTo
in interface java.lang.Comparable<AtomIdentifier>
public boolean isOrphanAtom()
public boolean isVirginAtom(Molecule[] outputMolecules)
outputMolecules
- the output molecules of the reactionpublic boolean isExplicitizedHydrogen()