chemaxon.struc
Class MolAtom

java.lang.Object
  extended bychemaxon.struc.CNode
      extended bychemaxon.struc.MolAtom
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, StereoConstants
Direct Known Subclasses:
SgroupAtom

public class MolAtom
extends CNode
implements StereoConstants

Atom object and the properties of the elements. Atom objects are identified by their reference valees.

Version:
3.3, 11/29/2003
Author:
Peter Csizmadia, Ferenc Csizmadia, Gabor Bartha, Tamas Vertse
See Also:
Serialized Form

Field Summary
static int AAMAP_MASK
          Atom map mask in flags.
static int AAMAP_MAX
          Maximum atom-atom mapping number.
static int AAMAP_OFF
          Atom map offset in flags.
static int ALIPHATIC
          Aliphatic query atom.
static int ANY
          "Atomic number" of the any atom A.
static int AROMATIC
          Aromatic query atom.
static int AROMATIC_OR_ALIPHATIC
          Aromatic or aliphatic query atom.
static int ATOM_TYPE_COUNT
          Number of atom types int the elements array
static int ATTACH_BOTH
          Attachment point on first and second site.
static int ATTACH1
          Attachment point on first site.
static int ATTACH2
          Attachment point on second site.
static int CHARGED_H
          Include charged Hydrogen atom(s).
static int ELEMENT_COUNT
          Number of elements in the periodic system
static int EMPTY
          Empty atom type.
static int FIX_CHARGE
          The charge is fix if this flag is set.
static int HETERO
          "Atomic number" of the hetero any atom Q.
static int HS_S
          S hybridization state.
static int HS_SP
          SP hybridization state.
static int HS_SP2
          SP2 hybridization state.
static int HS_SP3
          SP3 hybridization state.
static int HS_UNKNOWN
          Unknown hybridization state.
static int ISOTOPE_H
          Include Hydrogen isotope(s).
static int LIST
          "Atomic number" of the inclusive atom list.
static int LONELY_H
          Include lonely Hydrogen atom(s).
static int LP
          "Atomic number" of the lonely pair.
static int MAPPED_H
          Mapped Hydrogen atom(s).
static int NOTLIST
          "Atomic number" of the exclusive atom list.
static int RAD_COUNT_MASK
          Radical's free electron count bits in flags.
static int RAD_MASK
          Radical value bits in flags.
static int RAD_OFF
          Radical value offset in flags.
static int RAD1
          Monovalent radical center.
static int RAD2
          Divalent radical center.
static int RAD2_SINGLET
          Divalent radical center with singlet electronic configuration.
static int RAD2_TRIPLET
          Divalent radical center with triplet electronic configuration.
static int RAD3
          Trivalent radical center.
static int RADICAL_H
          Include radical Hydrogen atom(s).
static int RESSEQ_MAX
          Maximum residue sequence number is currently 8191.
static int RESTYPE_MAX
          Maximum residue type is currently 63.
static int RGROUP
          "Atomic number" of the Rgroup query "atom".
static int RGROUP_MAX
          Maximum R-group index.
static int RXNSTEREO_INVERSION
          The stereo configuration of the atom is inverted during the reaction.
static int RXNSTEREO_NONE
          The stereo configuration of the atom is not considered during the reaction.
static int RXNSTEREO_RETENTION
          The stereo configuration of the atom is retained during the reaction.
static int SETSEQ_MAX
          Maximum atom set sequence number is currently 63.
static int SGROUP
          "Atomic number" of an Sgroup.
static int VALENCE_CHECKED
          Valence checked if this flag is set.
protected  double xCoordinate
          X coordinate.
protected  double yCoordinate
          Y coordinate.
protected  double zCoordinate
          Z coordinate.
 
Fields inherited from class chemaxon.struc.CNode
edges, nedges
 
Fields inherited from interface chemaxon.struc.StereoConstants
ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_MASK, CHIRALITY_R, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, TRANS
 
Constructor Summary
MolAtom(double x, double y)
          Construct a carbon atom at the specified location.
MolAtom(int z)
          Construct an atom of the specified type at the origin.
MolAtom(int zZ, double x, double y, double z)
          Construct an atom.
 
Method Summary
protected  void add(CEdge b)
          Add an edge if it had not been already added.
 void bondweights(double[] w, CTransform3D t)
          Calculates the average of the bond unit vectors pointing out of this atom.
 void clear()
          Clear query properties, charge, and hcount.
 void clearCalcstr()
           
 java.lang.Object clone()
          Clones the atom.
protected  void copy(CNode node)
          Make a copy of this atom.
protected  int countAllAtoms()
          Counts all atoms represented by this atom.
static double covalentRadiusOf(int z, int t)
          Gets the covalent radius in C-C bond length units.
static int electronegOf(int z)
          Gets 10 times the electronegativity value for the specified element.
 java.lang.String getAliasstr()
          Gets the alias string.
 int getAtno()
          Gets the atomic number.
 java.lang.String getAtomLabels(boolean showAtnums, int atomIndex, boolean showMap, int[] ranks)
          Gets the string representation of the atom labels.
 int getAtomMap()
          Gets the atom-atom mapping number.
 java.lang.String getAtomSymbol(int style, int aflags, int[] lcenter, CTransform3D preTransform)
          Gets the string representation of the atom symbol.
 int getAttach()
          Gets attachment point information.
 MolBond getBond(int i)
          Gets the i-th bond.
 int getBondCount()
          Gets the number of bonds/ligands.
 int getCalcrgb(int i)
          Gets the calculation result color: (alpha<<24 + red<<16 + green<<8 + blue).
 long getCalcrgbs()
          Gets the calculation result color(s): lower 32 bits and upper 32 bits as (alpha<<24 + red<<16 + green<<8 + blue).
 java.lang.String getCalcstr()
          Gets the calculation result string: "result" or "result1|result2".
 int getCharge()
          Gets the charge.
 int getExplicitHcount()
          Gets number of hydrogen connections.
 int getFlags()
          Gets flags.
 int getHybridizationState()
          Gets the hybridization state.
 int getImplicitHcount()
          Gets the number of implicit hydrogens attached.
 int[] getList()
          Gets the atom list.
 DPoint3 getLocation()
          Gets the coordinates.
 void getLocation(DPoint3 p)
          Gets the coordinates.
 double getMass()
          Gets the atomic weight.
 int getMassno()
          Gets the mass number.
 java.lang.Object getQProp(java.lang.String name)
          Gets a query property.
 int getQPropAsInt(java.lang.String name)
          Gets a query property as an integer.
 int getQueryAromaticity()
          Gets the aromatic/aliphatic query property.
 java.lang.String getQueryLabel()
          Gets the string representation of the query atom
 java.lang.String getQuerystr()
          Gets the query properties.
 int getRadical()
          Gets the radical value.
 int getRadicalCount()
          Gets the number of free electrons.
 int getReactionStereo()
          Gets the reaction stereo property describing how the stereo configuration of the atom changes during the reaction.
 int getRelativeNegativity()
          Check negativity compared to the neighbors.
 int getResidueAtomId()
          Gets the residue atom identifier.
 int getResidueSeq()
          Gets the residue sequence number.
 int getResidueType()
          Gets the residue type.
 int getRgroup()
          Gets the R-group index.
 int getSetSeq()
          Gets the atom set sequence number.
 boolean getStereoCare()
          Reports double bond stereo care information on the connected bonds.
 int getStereoGroupNumber()
          Gets the stereochemical group number.
 int getStereoGroupType()
          Gets the stereochemical group type.
 java.lang.String getSymbol()
          Gets the element symbol.
 int getValence()
          Gets the valence.
 double getX()
          Gets the X coordinate.
 double getY()
          Gets the Y coordinate.
 double getZ()
          Gets the Z coordinate.
 boolean hasAromaticBond()
          True if the atom has aromatic bond.
 boolean hasQProps()
          Does it have query properties?
 boolean hasQueryBonds()
          True if the atom has query bonds ("ANY" bonds).
 boolean hasSMARTSProps()
          Is it a SMARTS query atom?
 boolean hasSMARTSPropsExcluding(java.lang.String exclude)
          Is it a SMARTS query atom?
 boolean hasValenceError()
          Determines if this atom has a valence error.
 boolean insideLabel(double x, double y)
          Determine if the specified point is inside the atom label.
static int ionChargeOf(int z)
          Gets the ion charge.
 boolean isArrowEnd()
          Returns true if this is an arrow endpoint.
 boolean isImplicitizableH(int f)
          Determine if the hydrogen atom is implicitizable or not.
 boolean isNobleGas()
          Is it a noble gas?
static int isotopeType(int z, int a)
          Gets the type of an isotope.
 boolean isPseudo()
          True if the atom is a pseudo atom.
 boolean isQProp()
          Determine wether is a query property or not
 boolean isQuery()
          Is it a query atom?
static boolean isSameParityClass(int i1, int i2, int i3, int i4, int j1, int j2, int j3, int j4)
          Calculates if chirality centers in the structure and the query belong to the same parity class.
 boolean isSelected()
          Determines if this atom is selected.
static java.lang.String nameOf(int z)
          Gets the name of the specified element.
static double naturalWeightOf(int z)
          Gets the natural weight of the element.
static int negOxOf(int z)
          Gets the negative oxidation number.
static int numOf(java.lang.String e)
          Gets the atomic number of an element.
static int numoxstatesOf(int z)
          Gets the number of oxidation states for the specified element.
static int oxstateOf(int z, int k)
          Gets the oxidation states.
static int paritySign(int a, int b, int c, int d)
          Calculates the sign of the parity for the specified indexes.
static int posOxOf(int z)
          Gets the smallest positive oxidation number.
 void qpropCheck()
          Query property checking.
protected  void removeEdge(int i)
          Removes a bond.
static java.lang.String residueSymbolOf(int id)
          Gets the name of a residue.
static int residueTypeOf(java.lang.String name)
          Gets the residue identifier for a residue name.
 void setAliasstr(java.lang.String s)
          Sets the alias string.
 void setAtno(int z)
          Sets the atomic number.
 void setAtomMap(int map)
          Sets the atom-atom mapping number.
 void setAttach(int a)
          Sets attachment point information.
 void setCalcrgbs(long rgbs)
          Sets the calculation color(s): lower 32 bits and upper 32 bits as (alpha<<24 + red<<16 + green<<8 + blue).
 void setCalcstr(java.lang.String s)
          Sets the calculation result string: "result" or "result1|result2".
 void setCharge(int q)
          Sets the charge.
 void setCorners(double xnw, double ynw, double xse, double yse)
          Used internally by MolPainter.
 void setFlags(int f)
          Sets the flags.
 void setFlags(int f, int mask)
          Sets the flags.
 void setHybridizationState(int h)
          Sets the hybridization state.
 void setImplicitHcount(int h)
          Sets the number of implicit hydrogens.
 void setList(int[] l)
          Sets the list elements.
 void setList(int[] l, int n)
          Sets the list elements.
 void setLocation(DPoint3 p)
          Sets the coordinates.
 void setMassno(int a)
          Sets the mass number.
 void setMassnoIfKnown(java.lang.String sym)
          Sets the atomic weight for deuterium or tricium.
 void setQProp(java.lang.String name, int v)
          Sets a query property as an integer.
 void setQProp(java.lang.String name, java.lang.Object v)
          Sets a query property.
 void setQueryAromaticity(int x)
          Sets the aromatic/aliphatic query property.
 void setQuerystr(java.lang.String s)
          Sets the query properties string.
 void setRadical(int r)
          Sets the radical value.
 void setReactionStereo(int r)
          Sets the reaction stereo property describing how the stereo configuration of the atom changes during the reaction.
 void setResidueAtomId(int id)
          Sets the residue atom identifier.
 void setResidueSeq(int n)
          Sets the residue sequence number.
 void setResidueType(int t)
          Sets the residue type.
 void setRgroup(int r)
          Sets the R-group index.
 void setSelected(boolean sel)
          Selects or unselects this atom.
 void setSetSeq(int id)
          Sets the atom set sequence number.
 void setSMARTS(java.lang.String s)
          Sets SMARTS query string data.
 void setStereoGroupNumber(int n)
          Sets the stereochemical group number.
 void setStereoGroupType(int t)
          Sets the stereochemical group type.
 void setValenceError(boolean v)
          Sets or clears the valence error flag.
 void setX(double x)
          Sets the X coordinate.
 void setXY(double x, double y)
          Sets the x and y coordinates.
 void setXYZ(double x, double y, double z)
          Sets the coordinates.
 void setY(double y)
          Sets the Y coordinate.
 void setZ(double z)
          Sets the Z coordinate.
static java.lang.String symbolOf(int z)
          Gets the element symbol for the specified atomic number.
 java.lang.String toString(int style, int aflags, CTransform3D preTransform, int[] lcenter)
          Deprecated. as of Marvin 3.0, replaced by getAtomSymbol and getAtomLabels
 int twicesumbonds(boolean countH, boolean all2)
          Calculates the sum of bond orders.
 void valenceCheck()
          Valence checking.
 
Methods inherited from class chemaxon.struc.CNode
getEdge, getEdgeCount, getLigand, getLock, getParent, indexOf, isBoundTo, pack, removeAllEdges, removeEdge, setNode1, setNode2, sringsize, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LONELY_H

public static final int LONELY_H
Include lonely Hydrogen atom(s).

Since:
3.1
See Also:
MoleculeGraph.implicitizeHydrogens(int), Constant Field Values

ISOTOPE_H

public static final int ISOTOPE_H
Include Hydrogen isotope(s).

Since:
3.1
See Also:
MoleculeGraph.implicitizeHydrogens(int), Constant Field Values

CHARGED_H

public static final int CHARGED_H
Include charged Hydrogen atom(s).

Since:
3.1
See Also:
MoleculeGraph.implicitizeHydrogens(int), Constant Field Values

RADICAL_H

public static final int RADICAL_H
Include radical Hydrogen atom(s).

Since:
3.1
See Also:
MoleculeGraph.implicitizeHydrogens(int), Constant Field Values

MAPPED_H

public static final int MAPPED_H
Mapped Hydrogen atom(s).

Since:
3.1
See Also:
MoleculeGraph.implicitizeHydrogens(int), Constant Field Values

ELEMENT_COUNT

public static final int ELEMENT_COUNT
Number of elements in the periodic system

See Also:
Constant Field Values

ATOM_TYPE_COUNT

public static final int ATOM_TYPE_COUNT
Number of atom types int the elements array

See Also:
Constant Field Values

EMPTY

public static final int EMPTY
Empty atom type. Useful for bond drawing.

See Also:
Constant Field Values

LIST

public static final int LIST
"Atomic number" of the inclusive atom list.

See Also:
Constant Field Values

NOTLIST

public static final int NOTLIST
"Atomic number" of the exclusive atom list.

See Also:
Constant Field Values

LP

public static final int LP
"Atomic number" of the lonely pair.

See Also:
Constant Field Values

ANY

public static final int ANY
"Atomic number" of the any atom A.

See Also:
Constant Field Values

HETERO

public static final int HETERO
"Atomic number" of the hetero any atom Q.

See Also:
Constant Field Values

RGROUP

public static final int RGROUP
"Atomic number" of the Rgroup query "atom".

See Also:
Constant Field Values

SGROUP

public static final int SGROUP
"Atomic number" of an Sgroup. Not implemented.

See Also:
Constant Field Values

VALENCE_CHECKED

public static final int VALENCE_CHECKED
Valence checked if this flag is set.

See Also:
getFlags(), Constant Field Values

FIX_CHARGE

public static final int FIX_CHARGE
The charge is fix if this flag is set.

See Also:
getFlags(), Constant Field Values

HS_UNKNOWN

public static final int HS_UNKNOWN
Unknown hybridization state.

See Also:
getHybridizationState(), Constant Field Values

HS_S

public static final int HS_S
S hybridization state.

See Also:
getHybridizationState(), Constant Field Values

HS_SP

public static final int HS_SP
SP hybridization state.

See Also:
getHybridizationState(), Constant Field Values

HS_SP2

public static final int HS_SP2
SP2 hybridization state.

See Also:
getHybridizationState(), Constant Field Values

HS_SP3

public static final int HS_SP3
SP3 hybridization state.

See Also:
getHybridizationState(), Constant Field Values

RGROUP_MAX

public static final int RGROUP_MAX
Maximum R-group index.

See Also:
setRgroup(int), Constant Field Values

RAD_OFF

public static final int RAD_OFF
Radical value offset in flags.

Since:
3.0
See Also:
Constant Field Values

RAD_MASK

public static final int RAD_MASK
Radical value bits in flags.

Since:
3.0
See Also:
Constant Field Values

RAD_COUNT_MASK

public static final int RAD_COUNT_MASK
Radical's free electron count bits in flags.

Since:
3.0
See Also:
Constant Field Values

RAD1

public static final int RAD1
Monovalent radical center.

Since:
3.0
See Also:
Constant Field Values

RAD2

public static final int RAD2
Divalent radical center.

Since:
3.0
See Also:
Constant Field Values

RAD2_SINGLET

public static final int RAD2_SINGLET
Divalent radical center with singlet electronic configuration.

Since:
3.0
See Also:
Constant Field Values

RAD2_TRIPLET

public static final int RAD2_TRIPLET
Divalent radical center with triplet electronic configuration.

Since:
3.0
See Also:
Constant Field Values

RAD3

public static final int RAD3
Trivalent radical center.

Since:
3.0
See Also:
Constant Field Values

AAMAP_MAX

public static final int AAMAP_MAX
Maximum atom-atom mapping number.

See Also:
setAtomMap(int), Constant Field Values

AAMAP_OFF

public static final int AAMAP_OFF
Atom map offset in flags.

See Also:
Constant Field Values

AAMAP_MASK

public static final int AAMAP_MASK
Atom map mask in flags.

See Also:
getAtomMap(), getFlags(), Constant Field Values

SETSEQ_MAX

public static final int SETSEQ_MAX
Maximum atom set sequence number is currently 63.

Since:
3.0
See Also:
setSetSeq(int), Constant Field Values

RESTYPE_MAX

public static final int RESTYPE_MAX
Maximum residue type is currently 63.

Since:
3.0
See Also:
setResidueType(int), Constant Field Values

RESSEQ_MAX

public static final int RESSEQ_MAX
Maximum residue sequence number is currently 8191.

Since:
3.0
See Also:
setResidueSeq(int), Constant Field Values

RXNSTEREO_NONE

public static final int RXNSTEREO_NONE
The stereo configuration of the atom is not considered during the reaction.

Since:
3.0
See Also:
Constant Field Values

RXNSTEREO_INVERSION

public static final int RXNSTEREO_INVERSION
The stereo configuration of the atom is inverted during the reaction.

Since:
3.0
See Also:
Constant Field Values

RXNSTEREO_RETENTION

public static final int RXNSTEREO_RETENTION
The stereo configuration of the atom is retained during the reaction.

Since:
3.0
See Also:
Constant Field Values

AROMATIC

public static final int AROMATIC
Aromatic query atom.

Since:
3.3
See Also:
getQueryAromaticity(), Constant Field Values

ALIPHATIC

public static final int ALIPHATIC
Aliphatic query atom.

Since:
3.3
See Also:
getQueryAromaticity(), Constant Field Values

AROMATIC_OR_ALIPHATIC

public static final int AROMATIC_OR_ALIPHATIC
Aromatic or aliphatic query atom.

Since:
3.3
See Also:
getQueryAromaticity(), Constant Field Values

ATTACH1

public static final int ATTACH1
Attachment point on first site.

Since:
3.1
See Also:
getAttach(), Constant Field Values

ATTACH2

public static final int ATTACH2
Attachment point on second site.

Since:
3.1
See Also:
getAttach(), Constant Field Values

ATTACH_BOTH

public static final int ATTACH_BOTH
Attachment point on first and second site.

Since:
3.1
See Also:
getAttach(), Constant Field Values

xCoordinate

protected transient double xCoordinate
X coordinate.


yCoordinate

protected transient double yCoordinate
Y coordinate.


zCoordinate

protected transient double zCoordinate
Z coordinate.

Constructor Detail

MolAtom

public MolAtom(int zZ,
               double x,
               double y,
               double z)
Construct an atom.

Parameters:
zZ - the atomic number
x - the x coordinate
y - the y coordinate
z - the z coordinate

MolAtom

public MolAtom(double x,
               double y)
Construct a carbon atom at the specified location.

Parameters:
x - the x coordinate
y - the y coordinate

MolAtom

public MolAtom(int z)
Construct an atom of the specified type at the origin.

Parameters:
z - the atomic number
Method Detail

getBondCount

public final int getBondCount()
Gets the number of bonds/ligands.

Returns:
the number of bonds
Since:
3.0

getBond

public final MolBond getBond(int i)
Gets the i-th bond.

Parameters:
i - bond index
Returns:
the bond object
Since:
3.0

getX

public double getX()
Gets the X coordinate.

Returns:
the x coordinate in Angstroms

setX

public void setX(double x)
Sets the X coordinate.

Parameters:
x - the x coordinate in Angstroms

getY

public double getY()
Gets the Y coordinate.

Returns:
the y coordinate in Angstroms

setY

public void setY(double y)
Sets the Y coordinate.

Parameters:
y - the y coordinate in Angstroms

getZ

public double getZ()
Gets the Z coordinate.

Returns:
the z coordinate in Angstroms

setZ

public void setZ(double z)
Sets the Z coordinate.

Parameters:
z - the z coordinate in Angstroms

setXY

public void setXY(double x,
                  double y)
Sets the x and y coordinates.

Parameters:
x - the x coordinate in Angstroms
y - the y coordinate in Angstroms

setXYZ

public void setXYZ(double x,
                   double y,
                   double z)
Sets the coordinates.

Parameters:
x - the x coordinate in Angstroms
y - the y coordinate in Angstroms
z - the z coordinate in Angstroms

getLocation

public final DPoint3 getLocation()
Gets the coordinates.

Returns:
the location

getLocation

public final void getLocation(DPoint3 p)
Gets the coordinates.

Parameters:
p - object that will store the location

setLocation

public void setLocation(DPoint3 p)
Sets the coordinates.

Parameters:
p - the location

getSymbol

public java.lang.String getSymbol()
Gets the element symbol. The symbol is the same as the MDL codename for special atom types: "L" for LIST and NOTLIST.

Returns:
the symbol

getAtno

public int getAtno()
Gets the atomic number.

Returns:
the atomic number

setAtno

public void setAtno(int z)
Sets the atomic number.

Parameters:
z - the atomic number

getMassno

public int getMassno()
Gets the mass number. In the case of an element it returns 0, because it is a mix of isotopes having different mass numbers.

Returns:
the mass number, or zero if not specified

setMassno

public void setMassno(int a)
Sets the mass number.

Parameters:
a - the mass number or zero

setMassnoIfKnown

public void setMassnoIfKnown(java.lang.String sym)
Sets the atomic weight for deuterium or tricium.

Parameters:
sym - the atom symbol

getMass

public double getMass()
Gets the atomic weight.

Returns:
the atomic weight

isNobleGas

public boolean isNobleGas()
Is it a noble gas?

Returns:
true if noble gas, false otherwise

getRelativeNegativity

public int getRelativeNegativity()
Check negativity compared to the neighbors.

Returns:
-1 if the atom is more electronegative than its neighbors, 1 if the neighbors are more electronegative, 0 if it has negative and positive neighbors also or or the neighbors have the same e.n. as the atom

getImplicitHcount

public int getImplicitHcount()
Gets the number of implicit hydrogens attached.

Returns:
the implicit hydrogen count or the number of query hydrogens

setImplicitHcount

public void setImplicitHcount(int h)
Sets the number of implicit hydrogens. Also removes the "H" query property.

Parameters:
h - the number of implicit hydrogens
Throws:
java.lang.IllegalArgumentException - negative h value specified

getCharge

public int getCharge()
Gets the charge.

Returns:
the charge

setCharge

public void setCharge(int q)
Sets the charge.

Parameters:
q - the charge

getRadical

public int getRadical()
Gets the radical value.

Returns:
the radical value
Since:
3.0
See Also:
RAD1, RAD2, RAD2_SINGLET, RAD2_TRIPLET, RAD3

setRadical

public void setRadical(int r)
Sets the radical value.

Parameters:
r - the radical value
Since:
3.0
See Also:
RAD1, RAD2, RAD2_SINGLET, RAD2_TRIPLET, RAD3

getRadicalCount

public int getRadicalCount()
Gets the number of free electrons.

Returns:
the number of free electrons
Since:
3.0

getValence

public int getValence()
Gets the valence. The valence is the sum of bond orders plus the number of query hydrogen atoms. Non-query, implicit hydrogens are not counted.

Returns:
the valence

getExplicitHcount

public int getExplicitHcount()
Gets number of hydrogen connections.

Returns:
the number of H connections

hasQProps

public boolean hasQProps()
Does it have query properties?

Returns:
true if it has query properties, false otherwise

getQProp

public java.lang.Object getQProp(java.lang.String name)
Gets a query property.

Parameters:
name - the property name
Returns:
the value of the property or null if not set

getQPropAsInt

public int getQPropAsInt(java.lang.String name)
Gets a query property as an integer.

Parameters:
name - the property name
Returns:
the value of the property or -1 if not set
See Also:
getQProp(java.lang.String)

setQProp

public void setQProp(java.lang.String name,
                     java.lang.Object v)
Sets a query property.

Parameters:
name - the property name
v - the value
See Also:
getQProp(java.lang.String)

setQProp

public void setQProp(java.lang.String name,
                     int v)
Sets a query property as an integer.

Parameters:
name - the property name
v - the value

getQueryAromaticity

public int getQueryAromaticity()
Gets the aromatic/aliphatic query property.

Returns:
0, AROMATIC, ALIPHATIC or AROMATIC_OR_ALIPHATIC
Since:
3.3

setQueryAromaticity

public void setQueryAromaticity(int x)
Sets the aromatic/aliphatic query property.

Parameters:
x - 0, AROMATIC, ALIPHATIC or AROMATIC_OR_ALIPHATIC
Since:
3.3

getRgroup

public int getRgroup()
Gets the R-group index.

Returns:
a number between 1 and 32

setRgroup

public void setRgroup(int r)
Sets the R-group index.

Parameters:
r - Rgroup number, between 1 and 32
See Also:
RGROUP_MAX

getAttach

public int getAttach()
Gets attachment point information.

Returns:
0 (not an attachment point), ATTACH1 (first), ATTACH2 (second) or ATTACH_BOTH (both)

setAttach

public void setAttach(int a)
Sets attachment point information.

Returns:
param a 0 (not an attachment point), ATTACH1 (first), ATTACH2 (second) or ATTACH_BOTH (both)

getHybridizationState

public int getHybridizationState()
Gets the hybridization state.

Returns:
the hybridization state
See Also:
HS_UNKNOWN, HS_S, HS_SP, HS_SP2, HS_SP3

setHybridizationState

public void setHybridizationState(int h)
Sets the hybridization state.

Parameters:
h - the hybridization state
See Also:
getHybridizationState()

getAtomMap

public int getAtomMap()
Gets the atom-atom mapping number.

Returns:
the map value (positive integer) or 0

setAtomMap

public void setAtomMap(int map)
Sets the atom-atom mapping number.

Parameters:
map - the map value (positive integer) or 0
See Also:
AAMAP_MAX

getSetSeq

public int getSetSeq()
Gets the atom set sequence number.

Returns:
a number between 0 and SETSEQ_MAX
See Also:
SETSEQ_MAX

setSetSeq

public void setSetSeq(int id)
Sets the atom set sequence number.

Parameters:
id - a number between 0 and SETSEQ_MAX
See Also:
SETSEQ_MAX

residueTypeOf

public static int residueTypeOf(java.lang.String name)
Gets the residue identifier for a residue name.

Parameters:
name - residue name
Returns:
the residue type
Since:
3.1.4

residueSymbolOf

public static java.lang.String residueSymbolOf(int id)
Gets the name of a residue.

Parameters:
id - the residue identifier
Returns:
the residue symbol
Since:
3.1.4

getResidueType

public int getResidueType()
Gets the residue type.

Returns:
the residue type
See Also:
RESTYPE_MAX

setResidueType

public void setResidueType(int t)
Sets the residue type.

Parameters:
t - the residue type
See Also:
RESTYPE_MAX

getResidueSeq

public int getResidueSeq()
Gets the residue sequence number.

Returns:
the residue sequence number
See Also:
RESSEQ_MAX

setResidueSeq

public void setResidueSeq(int n)
Sets the residue sequence number.

Parameters:
n - the residue sequence number
See Also:
RESSEQ_MAX

getResidueAtomId

public int getResidueAtomId()
Gets the residue atom identifier. Atoms in amino acids and nucleic acids are identified uniquely by the atom symbol and the residue atom identifier.

Returns:
the residue atom identifier
Since:
3.1.3

setResidueAtomId

public void setResidueAtomId(int id)
Sets the residue atom identifier.

Returns:
the residue atom identifier
Since:
3.1.3

isArrowEnd

public final boolean isArrowEnd()
Returns true if this is an arrow endpoint.

See Also:
MolBond.isArrow()

bondweights

public void bondweights(double[] w,
                        CTransform3D t)
Calculates the average of the bond unit vectors pointing out of this atom. The result is not a unit vector.

Parameters:
w - 3-element array that will contain the resulting vector
t - the rotation matrix

toString

public java.lang.String toString(int style,
                                 int aflags,
                                 CTransform3D preTransform,
                                 int[] lcenter)
Deprecated. as of Marvin 3.0, replaced by getAtomSymbol and getAtomLabels

Make a string representation in the specified style.

Parameters:
style - normal (0), show hydrogen count (1), SMARTS string with total H count(2), show total hydrogen count (3), don't show mapping (4), or force SMARTS query string (5).
aflags - atom flags
preTransform - viewing transformation
lcenter - if not null, then its first two element (index 0-1) will will be set to the index and the length of the element symbol substring in the returned string, the element at at index 2 will be set to +1 if the H label is above, -1 if below the element symbol or 0 otherwise
Returns:
the string representation

getAtomSymbol

public java.lang.String getAtomSymbol(int style,
                                      int aflags,
                                      int[] lcenter,
                                      CTransform3D preTransform)
Gets the string representation of the atom symbol.

Parameters:
style - normal (0), show hydrogen count (1), SMARTS string with total H count(2), show total hydrogen count (3), don't show mapping (4), or force SMARTS query string (5).
aflags - atom flags
preTransform - viewing transformation
lcenter - if not null, then its first two element (index 0-1) will will be set to the index and the length of the element symbol substring in the returned string, the element at at index 2 will be set to +1 if the H label is above, -1 if below the element symbol or 0 otherwise
Returns:
the string representation
Since:
3.0

getAtomLabels

public java.lang.String getAtomLabels(boolean showAtnums,
                                      int atomIndex,
                                      boolean showMap,
                                      int[] ranks)
Gets the string representation of the atom labels.

Parameters:
showAtnums - display atom number
atomIndex - display atom index
showMap - display atom mapping
ranks - if not null display graph invariant esle not
Returns:
the string representation
Since:
3.0

getQueryLabel

public java.lang.String getQueryLabel()
Gets the string representation of the query atom

Returns:
the string representation
Since:
3.0

isQuery

public final boolean isQuery()
Is it a query atom?

Returns:
true if it is a query atom, false otherwise

isQProp

public boolean isQProp()
Determine wether is a query property or not

Returns:
true if query property false if not

isImplicitizableH

public boolean isImplicitizableH(int f)
Determine if the hydrogen atom is implicitizable or not. Only bound, non-isotope, neutral, non-radical, non-mapped H atoms are implicitizable by default (0 argument). If the argument is nonzero, then the return value can be true for lonely, isotope, charged, radical or mapped H atoms also.

Parameters:
f - flags specifying special H atom types to include
Returns:
true if the hydrogen is implicitizable, false otherwise
Since:
3.1
See Also:
LONELY_H, ISOTOPE_H, CHARGED_H, RADICAL_H, MAPPED_H, MoleculeGraph.implicitizeHydrogens(int)

isPseudo

public boolean isPseudo()
True if the atom is a pseudo atom. Currently pseudo atoms are ANY atoms having an alias enclosed in single quotes.

Returns:
true if the atom is a pseudo atom, false otherwise
Since:
3.3

hasAromaticBond

public final boolean hasAromaticBond()
True if the atom has aromatic bond.

Returns:
true if it has query bonds, false otherwise

hasQueryBonds

public final boolean hasQueryBonds()
True if the atom has query bonds ("ANY" bonds).

Returns:
true if it has query bonds, false otherwise

hasSMARTSProps

public final boolean hasSMARTSProps()
Is it a SMARTS query atom?

Returns:
true if it has SMARTS properties, false otherwise

hasSMARTSPropsExcluding

public final boolean hasSMARTSPropsExcluding(java.lang.String exclude)
Is it a SMARTS query atom?

Parameters:
exclude - list of SMARTS properties to exclude
Returns:
true if it has SMARTS properties, false otherwise
Since:
3.1.2

setSMARTS

public void setSMARTS(java.lang.String s)
               throws java.lang.SecurityException
Sets SMARTS query string data.

Parameters:
s - the SMARTS string
Throws:
java.lang.SecurityException - the SmilesImport cannot be loaded, possibly because of a misconfigured firewall

getQuerystr

public java.lang.String getQuerystr()
Gets the query properties.

Returns:
the query string

setQuerystr

public void setQuerystr(java.lang.String s)
Sets the query properties string.

Parameters:
s - the query string

setAliasstr

public void setAliasstr(java.lang.String s)
Sets the alias string.

Parameters:
s - the alias

getAliasstr

public java.lang.String getAliasstr()
Gets the alias string.

Returns:
the alias

setCalcstr

public void setCalcstr(java.lang.String s)
Sets the calculation result string: "result" or "result1|result2".


setCalcrgbs

public void setCalcrgbs(long rgbs)
Sets the calculation color(s): lower 32 bits and upper 32 bits as (alpha<<24 + red<<16 + green<<8 + blue).

Parameters:
rgbs - the calculation color(s)

getCalcstr

public java.lang.String getCalcstr()
Gets the calculation result string: "result" or "result1|result2".

Returns:
the calcstr

getCalcrgbs

public long getCalcrgbs()
Gets the calculation result color(s): lower 32 bits and upper 32 bits as (alpha<<24 + red<<16 + green<<8 + blue).

Returns:
the calcrgbs

getCalcrgb

public int getCalcrgb(int i)
Gets the calculation result color: (alpha<<24 + red<<16 + green<<8 + blue).

Parameters:
i - is the result index (0 or 1)
Returns:
the calcrgb

clearCalcstr

public void clearCalcstr()

getList

public int[] getList()
Gets the atom list.

Returns:
the list

setList

public void setList(int[] l,
                    int n)
Sets the list elements.

Parameters:
l - the list
n - number of elements to set

setList

public void setList(int[] l)
Sets the list elements.

Parameters:
l - the list

getReactionStereo

public int getReactionStereo()
Gets the reaction stereo property describing how the stereo configuration of the atom changes during the reaction.

Returns:
the reaction stereo property
See Also:
RXNSTEREO_NONE, RXNSTEREO_INVERSION, RXNSTEREO_RETENTION

setReactionStereo

public void setReactionStereo(int r)
Sets the reaction stereo property describing how the stereo configuration of the atom changes during the reaction.

Parameters:
r - the reaction stereo property
Since:
3.0
See Also:
RXNSTEREO_NONE, RXNSTEREO_INVERSION, RXNSTEREO_RETENTION

clear

public void clear()
Clear query properties, charge, and hcount.


clone

public java.lang.Object clone()
Clones the atom. The bonds are not cloned: their references do not change.

Specified by:
clone in class CNode
Returns:
the clone

insideLabel

public boolean insideLabel(double x,
                           double y)
Determine if the specified point is inside the atom label.

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
true if inside, false if outside

numOf

public static int numOf(java.lang.String e)
Gets the atomic number of an element.

Parameters:
e - the element name
Returns:
the atomic number or zero if not found

symbolOf

public static java.lang.String symbolOf(int z)
Gets the element symbol for the specified atomic number. The symbol is the same as the MDL codename for special atom types: "L" for LIST and NOTLIST.

Parameters:
z - the atomic number
Returns:
the symbol

nameOf

public static java.lang.String nameOf(int z)
Gets the name of the specified element.

Parameters:
z - the atomic number
Returns:
the name

electronegOf

public static int electronegOf(int z)
Gets 10 times the electronegativity value for the specified element.

Parameters:
z - the atomic number
Returns:
the electronegativity

numoxstatesOf

public static int numoxstatesOf(int z)
Gets the number of oxidation states for the specified element.

Parameters:
z - the atomic number
Returns:
the number of states

oxstateOf

public static int oxstateOf(int z,
                            int k)
Gets the oxidation states.

Parameters:
z - the atomic number
k - the oxidation state index
Returns:
the oxidateon state

negOxOf

public static int negOxOf(int z)
Gets the negative oxidation number.

Parameters:
z - the atomic number
Returns:
the negative oxidation number
Since:
2.7

posOxOf

public static int posOxOf(int z)
Gets the smallest positive oxidation number.

Parameters:
z - the atomic number
Returns:
the smallest positive oxidation number
Since:
2.7

ionChargeOf

public static int ionChargeOf(int z)
Gets the ion charge.

Parameters:
z - the atomic number
Returns:
the charge
Since:
2.7

covalentRadiusOf

public static double covalentRadiusOf(int z,
                                      int t)
Gets the covalent radius in C-C bond length units.

Parameters:
z - the atomic number
t - the bond type (1, 2, 3)
Returns:
the covalent radius
Since:
2.7

naturalWeightOf

public static double naturalWeightOf(int z)
Gets the natural weight of the element. WARNING: This method does not return the exact value.

Parameters:
z - the atomic number
Returns:
the weight

isotopeType

public static int isotopeType(int z,
                              int a)
Gets the type of an isotope.

Parameters:
z - atomic number
a - mass number
Returns:
0 if nonexistent, 1 if unstable, 2 if naturally occuring

twicesumbonds

public int twicesumbonds(boolean countH,
                         boolean all2)
Calculates the sum of bond orders.

Parameters:
countH - also count bonds to explicit hydrogen atoms
all2 - calculate (two times) the number of bonds instead of the sum of bond orders
Returns:
two times the sum

qpropCheck

public void qpropCheck()
Query property checking.


valenceCheck

public void valenceCheck()
Valence checking. Determines if there is a valence error. Calculates implicit hydrogen atoms.


setCorners

public void setCorners(double xnw,
                       double ynw,
                       double xse,
                       double yse)
Used internally by MolPainter.

Parameters:
xnw - north-west corner x
ynw - north-west corner y
xse - south-east corner x
yse - south-east corner y

getFlags

public int getFlags()
Gets flags. Flags contain the selected (1 bit), valenceError (1 bit), explicitCharge (1 bit), parity (3 bit), R/S (2 bit), hybridization state (3 bit), atom map (10 bit) fields.

Returns:
the flags
See Also:
StereoConstants.PARITY_MASK, StereoConstants.CHIRALITY_MASK, StereoConstants.ATOMSTEREO_MASK

setFlags

public void setFlags(int f)
Sets the flags.

Parameters:
f - new flags

setFlags

public void setFlags(int f,
                     int mask)
Sets the flags.

Parameters:
f - new flags
mask - bits to set in flags

isSelected

public boolean isSelected()
Determines if this atom is selected.

Returns:
true if selected, false otherwise
Since:
2.9.12

setSelected

public void setSelected(boolean sel)
Selects or unselects this atom.

Parameters:
sel - true to select, false to unselect
Since:
2.9.12

hasValenceError

public boolean hasValenceError()
Determines if this atom has a valence error.

Returns:
true in case of error, false otherwise
Since:
2.9.12

setValenceError

public void setValenceError(boolean v)
Sets or clears the valence error flag.

Parameters:
v - true to set, false to unset
Since:
2.9.12

getStereoCare

public boolean getStereoCare()
Reports double bond stereo care information on the connected bonds.

Returns:
True if there is -at least- one bond with stereo care box on, false else.
See Also:
MolBond.getFlags(), MolBond.setFlags(int)

getStereoGroupType

public int getStereoGroupType()
Gets the stereochemical group type.

Returns:
the stereochemical group type
Since:
3.1.4
See Also:
StereoConstants.STGRP_NONE, StereoConstants.STGRP_ABS, StereoConstants.STGRP_OR, StereoConstants.STGRP_AND

setStereoGroupType

public void setStereoGroupType(int t)
Sets the stereochemical group type.

Parameters:
t - the stereochemical group type
Since:
3.1.4
See Also:
getStereoGroupType()

getStereoGroupNumber

public int getStereoGroupNumber()
Gets the stereochemical group number.

Returns:
the stereochemical group number (positive integer)
Since:
3.1.4
See Also:
getStereoGroupType(), StereoConstants.STGRP_OR, StereoConstants.STGRP_AND

setStereoGroupNumber

public void setStereoGroupNumber(int n)
Sets the stereochemical group number.

Parameters:
n - the stereochemical group number (positive integer)
Since:
3.1.4
See Also:
getStereoGroupNumber()

copy

protected void copy(CNode node)
Make a copy of this atom.

Parameters:
node - the target atom

add

protected void add(CEdge b)
Add an edge if it had not been already added. Also runs valence checking if charge and implicit hydogens were previously set this way.

Overrides:
add in class CNode
Parameters:
b - the edge to add

removeEdge

protected void removeEdge(int i)
Removes a bond. Also runs valence checking if charge and implicit hydogens were previously set this way.

Overrides:
removeEdge in class CNode
Parameters:
i - bond index

paritySign

public static int paritySign(int a,
                             int b,
                             int c,
                             int d)
Calculates the sign of the parity for the specified indexes.

Parameters:
a - first atom index
b - second atom index
c - third atom index
d - fourth atom index
Returns:
+1, -1, or 0 (if two or more indexes equal)

isSameParityClass

public static boolean isSameParityClass(int i1,
                                        int i2,
                                        int i3,
                                        int i4,
                                        int j1,
                                        int j2,
                                        int j3,
                                        int j4)
Calculates if chirality centers in the structure and the query belong to the same parity class. i1, ..., i4 are indexes of neighbors in the structure. j1, ..., j4 are indexes of corresponding neighbors in the query. In the case of explicit H the index has to be set to Integer.MAX_VALUE. In the case of implicit H i4 (or j4) has to be set to Integer.MAX_VALUE.

See Also:
paritySign(int, int, int, int)

countAllAtoms

protected int countAllAtoms()
Counts all atoms represented by this atom.

Returns:
1
Since:
3.0