org.jmol.smiles
Class SmilesAtom

java.lang.Object
  extended by javax.vecmath.Tuple3f
      extended by javax.vecmath.Point3f
          extended by org.jmol.smiles.SmilesAtom
All Implemented Interfaces:
Serializable, Cloneable, JmolNode

public class SmilesAtom
extends Point3f
implements JmolNode

This class represents an atom in a SmilesMolecule.

See Also:
Serialized Form

Field Summary
private  short atomicMass
           
(package private)  String atomName
           
(package private)  int atomSite
           
(package private)  SmilesAtom[] atomsOr
           
(package private)  char bioType
           
(package private)  int bondCount
           
(package private)  SmilesBond[] bonds
           
private  int charge
           
private  int chiralClass
           
private  int chiralOrder
           
(package private)  int component
           
(package private)  int connectivity
           
private  int covalentHydrogenCount
           
(package private)  int degree
           
(package private)  short elementNumber
           
(package private)  boolean hasSymbol
           
(package private)  int implicitHydrogenCount
           
(package private)  int index
           
(package private)  int iNested
           
private  boolean isAromatic
           
(package private)  boolean isBioAtom
           
(package private)  boolean isFirst
           
(package private)  boolean isLeadAtom
           
(package private)  int jmolIndex
           
private  int matchingAtom
           
(package private)  int missingHydrogenCount
           
(package private)  int nAtomsOr
           
(package private)  int nonhydrogenDegree
           
(package private)  boolean not
           
(package private)  int notBondedIndex
           
(package private)  boolean notCrossLinked
           
(package private)  int nPrimitives
           
(package private)  SmilesAtom parent
           
(package private)  SmilesAtom[] primitives
           
(package private)  String residueChar
           
(package private)  String residueName
           
(package private)  int ringConnectivity
           
(package private)  int ringMembership
           
(package private)  int ringSize
           
(package private)  boolean selected
           
(package private) static int STEREOCHEMISTRY_ALLENE
           
(package private) static int STEREOCHEMISTRY_DEFAULT
           
(package private) static int STEREOCHEMISTRY_OCTAHEDRAL
           
(package private) static int STEREOCHEMISTRY_SQUARE_PLANAR
           
(package private) static int STEREOCHEMISTRY_TETRAHEDRAL
           
(package private) static int STEREOCHEMISTRY_TRIGONAL_BIPYRAMIDAL
           
(package private) static String UNBRACKETED_SET
           
(package private)  int valence
           
 
Fields inherited from class javax.vecmath.Tuple3f
x, y, z
 
Constructor Summary
SmilesAtom(int index)
          Constructs a SmilesAtom.
SmilesAtom(int iComponent, int ptAtom, int flags, short atomicNumber, int charge)
           
 
Method Summary
 SmilesAtom addAtomOr()
           
(package private)  void addBond(SmilesBond bond)
          Add a bond to the atom.
 SmilesAtom addPrimitive()
           
(package private) static boolean allowSmilesUnbracketed(String xx)
           
 short getAtomicAndIsotopeNumber()
           
 short getAtomicMass()
          Returns the atomic mass of the atom.
(package private) static String getAtomLabel(int atomicNumber, int isotopeNumber, int valence, int charge, int nH, boolean isAromatic, String stereo)
           
 String getAtomName()
           
 int getAtomSite()
           
 SmilesBond getBond(int number)
          Returns the bond at index number.
 int getBondCount()
           
 int getBondedAtomIndex(int j)
           
(package private)  SmilesBond getBondNotTo(SmilesAtom atom, boolean allowH)
           
(package private)  SmilesBond getBondTo(SmilesAtom atom)
          if atom is null, return bond TO this atom (bond.getAtom2() == this) otherwise, return bond connecting this atom with that atom
 char getChainID()
           
 int getCharge()
          Returns the charge of the atom.
 int getChiralClass()
          Returns the chiral class of the atom.
(package private) static int getChiralityClass(String xx)
           
 int getChiralOrder()
          Returns the chiral order of the atom.
 int getCovalentBondCount()
          Returns the number of bonds of this atom.
 int getCovalentHydrogenCount()
           
 boolean getCrossLinkLeadAtomIndexes(List vLinks)
           
(package private) static int getDefaultCount(int elementNumber, boolean isAromatic)
           
 JmolEdge[] getEdges()
           
 short getElementNumber()
          Returns the atomic number of the element or 0
 int getExplicitHydrogenCount()
           
 int getFormalCharge()
           
 String getGroup1(char c0)
           
 String getGroup3(boolean allowNull)
           
 String getGroupType()
           
 int getImplicitHydrogenCount()
           
 int getIndex()
          Returns the atom index of the atom.
 short getIsotopeNumber()
           
 int getMatchingAtom()
          Returns the number of a matching atom in a molecule.
 int getMatchingBondedAtom(int i)
           
 int getModelIndex()
           
 int getOffsetResidueAtom(String name, int offset)
           
 int getResno()
           
 int getValence()
           
 boolean isAromatic()
           
 boolean isCrossLinked(JmolNode node)
           
 boolean isDeleted()
           
 boolean isDna()
           
 boolean isLeadAtom()
           
 boolean isNucleic()
           
 boolean isProtein()
           
 boolean isPurine()
           
 boolean isPyrimidine()
           
 boolean isRna()
           
 void setAtomicMass(int mass)
          Sets the atomic mass of the atom.
(package private)  void setAtomName(String name)
           
(package private)  void setBioAtom(char bioType)
           
 void setBondArray()
           
 void setBonds(SmilesBond[] bonds)
           
 void setCharge(int charge)
          Sets the charge of the atom.
 void setChiralClass(int chiralClass)
          Sets the chiral class of the atom.
 void setChiralOrder(int chiralOrder)
          Sets the chiral order of the atom.
 void setConnectivity(int connectivity)
           
 void setDegree(int degree)
           
 void setExplicitHydrogenCount(int count)
          Sets the number of explicit hydrogen atoms bonded with this atom.
 void setGroupBits(BitSet bs)
           
 boolean setHydrogenCount(SmilesSearch molecule)
          Finalizes the hydrogen count hydrogens in a SmilesMolecule.
 void setImplicitHydrogenCount(int count)
          Sets the number of implicit hydrogen atoms bonded with this atom.
 void setMatchingAtom(int atom)
          Sets the number of a matching atom in a molecule.
 void setNonhydrogenDegree(int degree)
           
 void setRingConnectivity(int rc)
           
 void setRingMembership(int rm)
           
 void setRingSize(int rs)
           
 boolean setSymbol(String symbol)
          Sets the symbol of the atm.
 void setValence(int valence)
           
 String toString()
           
 
Methods inherited from class javax.vecmath.Point3f
distance, distanceL1, distanceLinf, distanceSquared, project
 
Methods inherited from class javax.vecmath.Tuple3f
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, get, getX, getY, getZ, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setX, setY, setZ, sub, sub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jmol.api.JmolNode
set
 

Field Detail

STEREOCHEMISTRY_DEFAULT

static final int STEREOCHEMISTRY_DEFAULT
See Also:
Constant Field Values

STEREOCHEMISTRY_ALLENE

static final int STEREOCHEMISTRY_ALLENE
See Also:
Constant Field Values

STEREOCHEMISTRY_TETRAHEDRAL

static final int STEREOCHEMISTRY_TETRAHEDRAL
See Also:
Constant Field Values

STEREOCHEMISTRY_TRIGONAL_BIPYRAMIDAL

static final int STEREOCHEMISTRY_TRIGONAL_BIPYRAMIDAL
See Also:
Constant Field Values

STEREOCHEMISTRY_OCTAHEDRAL

static final int STEREOCHEMISTRY_OCTAHEDRAL
See Also:
Constant Field Values

STEREOCHEMISTRY_SQUARE_PLANAR

static final int STEREOCHEMISTRY_SQUARE_PLANAR
See Also:
Constant Field Values

UNBRACKETED_SET

static final String UNBRACKETED_SET
See Also:
Constant Field Values

index

int index

atomName

String atomName

residueName

String residueName

residueChar

String residueChar

isBioAtom

boolean isBioAtom

bioType

char bioType

isLeadAtom

boolean isLeadAtom

notBondedIndex

int notBondedIndex

notCrossLinked

boolean notCrossLinked

not

boolean not

selected

boolean selected

hasSymbol

boolean hasSymbol

isFirst

boolean isFirst

jmolIndex

int jmolIndex

elementNumber

short elementNumber

atomicMass

private short atomicMass

charge

private int charge

missingHydrogenCount

int missingHydrogenCount

implicitHydrogenCount

int implicitHydrogenCount

matchingAtom

private int matchingAtom

chiralClass

private int chiralClass

chiralOrder

private int chiralOrder

isAromatic

private boolean isAromatic

parent

SmilesAtom parent

bonds

SmilesBond[] bonds

bondCount

int bondCount

iNested

int iNested

atomsOr

SmilesAtom[] atomsOr

nAtomsOr

int nAtomsOr

primitives

SmilesAtom[] primitives

nPrimitives

int nPrimitives

component

int component

atomSite

int atomSite

degree

int degree

nonhydrogenDegree

int nonhydrogenDegree

valence

int valence

connectivity

int connectivity

ringMembership

int ringMembership

ringSize

int ringSize

ringConnectivity

int ringConnectivity

covalentHydrogenCount

private int covalentHydrogenCount
Constructor Detail

SmilesAtom

public SmilesAtom(int index)
Constructs a SmilesAtom.

Parameters:
index - Atom number in the molecule.

SmilesAtom

public SmilesAtom(int iComponent,
                  int ptAtom,
                  int flags,
                  short atomicNumber,
                  int charge)
Method Detail

getChiralityClass

static int getChiralityClass(String xx)

allowSmilesUnbracketed

static boolean allowSmilesUnbracketed(String xx)

setBioAtom

void setBioAtom(char bioType)

setAtomName

void setAtomName(String name)

setBonds

public void setBonds(SmilesBond[] bonds)

addAtomOr

public SmilesAtom addAtomOr()

addPrimitive

public SmilesAtom addPrimitive()

toString

public String toString()
Overrides:
toString in class Tuple3f

setHydrogenCount

public boolean setHydrogenCount(SmilesSearch molecule)
Finalizes the hydrogen count hydrogens in a SmilesMolecule. "missing" here means the number of atoms not present in the SMILES string for unbracketed atoms or the number of hydrogen atoms "CC" being really CH3CH3 or explicitly mentioned in the bracketed atom, "[CH2]". These hydrogen atoms are not part of the topological model constructed and need to be accounted for.

Parameters:
molecule - Molecule containing the atom.
Returns:
false if inappropriate

getDefaultCount

static int getDefaultCount(int elementNumber,
                           boolean isAromatic)

getIndex

public int getIndex()
Returns the atom index of the atom.

Specified by:
getIndex in interface JmolNode
Returns:
Atom index.

isAromatic

public boolean isAromatic()
Returns:
whether symbol was lower case

setSymbol

public boolean setSymbol(String symbol)
Sets the symbol of the atm.

Parameters:
symbol - Atom symbol.
Returns:
false if invalid symbol

getElementNumber

public short getElementNumber()
Returns the atomic number of the element or 0

Specified by:
getElementNumber in interface JmolNode
Returns:
atomicNumber

getAtomicMass

public short getAtomicMass()
Returns the atomic mass of the atom.

Returns:
Atomic mass.

setAtomicMass

public void setAtomicMass(int mass)
Sets the atomic mass of the atom.

Parameters:
mass - Atomic mass.

getCharge

public int getCharge()
Returns the charge of the atom.

Returns:
Charge.

setCharge

public void setCharge(int charge)
Sets the charge of the atom.

Parameters:
charge - Charge.

getMatchingAtom

public int getMatchingAtom()
Returns the number of a matching atom in a molecule. This value is temporary, it is used during the pattern matching algorithm.

Returns:
matching atom.

setMatchingAtom

public void setMatchingAtom(int atom)
Sets the number of a matching atom in a molecule. This value is temporary, it is used during the pattern matching algorithm.

Parameters:
atom - Temporary: number of a matching atom in a molecule.

getChiralClass

public int getChiralClass()
Returns the chiral class of the atom. (see CHIRALITY_... constants)

Returns:
Chiral class.

setChiralClass

public void setChiralClass(int chiralClass)
Sets the chiral class of the atom. (see CHIRALITY_... constants)

Parameters:
chiralClass - Chiral class.

getChiralOrder

public int getChiralOrder()
Returns the chiral order of the atom.

Returns:
Chiral order.

setChiralOrder

public void setChiralOrder(int chiralOrder)
Sets the chiral order of the atom.

Parameters:
chiralOrder - Chiral order.

setExplicitHydrogenCount

public void setExplicitHydrogenCount(int count)
Sets the number of explicit hydrogen atoms bonded with this atom.

Parameters:
count - Number of hydrogen atoms.

setImplicitHydrogenCount

public void setImplicitHydrogenCount(int count)
Sets the number of implicit hydrogen atoms bonded with this atom.

Parameters:
count - Number of hydrogen atoms.

setDegree

public void setDegree(int degree)

setNonhydrogenDegree

public void setNonhydrogenDegree(int degree)

setValence

public void setValence(int valence)

setConnectivity

public void setConnectivity(int connectivity)

setRingMembership

public void setRingMembership(int rm)

setRingSize

public void setRingSize(int rs)

setRingConnectivity

public void setRingConnectivity(int rc)

getModelIndex

public int getModelIndex()
Specified by:
getModelIndex in interface JmolNode

getAtomSite

public int getAtomSite()
Specified by:
getAtomSite in interface JmolNode

getImplicitHydrogenCount

public int getImplicitHydrogenCount()
Specified by:
getImplicitHydrogenCount in interface JmolNode

getExplicitHydrogenCount

public int getExplicitHydrogenCount()

getFormalCharge

public int getFormalCharge()
Specified by:
getFormalCharge in interface JmolNode

getIsotopeNumber

public short getIsotopeNumber()
Specified by:
getIsotopeNumber in interface JmolNode

getAtomicAndIsotopeNumber

public short getAtomicAndIsotopeNumber()
Specified by:
getAtomicAndIsotopeNumber in interface JmolNode

getAtomName

public String getAtomName()
Specified by:
getAtomName in interface JmolNode

getGroup3

public String getGroup3(boolean allowNull)
Specified by:
getGroup3 in interface JmolNode

getGroup1

public String getGroup1(char c0)
Specified by:
getGroup1 in interface JmolNode

addBond

void addBond(SmilesBond bond)
Add a bond to the atom.

Parameters:
bond - Bond to add.

setBondArray

public void setBondArray()

getEdges

public JmolEdge[] getEdges()
Specified by:
getEdges in interface JmolNode

getBond

public SmilesBond getBond(int number)
Returns the bond at index number.

Parameters:
number - Bond number.
Returns:
Bond.

getCovalentBondCount

public int getCovalentBondCount()
Returns the number of bonds of this atom.

Specified by:
getCovalentBondCount in interface JmolNode
Returns:
Number of bonds.

getBondCount

public int getBondCount()

getMatchingBondedAtom

public int getMatchingBondedAtom(int i)

getBondedAtomIndex

public int getBondedAtomIndex(int j)
Specified by:
getBondedAtomIndex in interface JmolNode

getCovalentHydrogenCount

public int getCovalentHydrogenCount()
Specified by:
getCovalentHydrogenCount in interface JmolNode

getValence

public int getValence()
Specified by:
getValence in interface JmolNode

getBondTo

SmilesBond getBondTo(SmilesAtom atom)
if atom is null, return bond TO this atom (bond.getAtom2() == this) otherwise, return bond connecting this atom with that atom

Parameters:
atom -
Returns:
bond

getBondNotTo

SmilesBond getBondNotTo(SmilesAtom atom,
                        boolean allowH)

isLeadAtom

public boolean isLeadAtom()
Specified by:
isLeadAtom in interface JmolNode

getOffsetResidueAtom

public int getOffsetResidueAtom(String name,
                                int offset)
Specified by:
getOffsetResidueAtom in interface JmolNode

setGroupBits

public void setGroupBits(BitSet bs)
Specified by:
setGroupBits in interface JmolNode

isCrossLinked

public boolean isCrossLinked(JmolNode node)
Specified by:
isCrossLinked in interface JmolNode

getCrossLinkLeadAtomIndexes

public boolean getCrossLinkLeadAtomIndexes(List vLinks)
Specified by:
getCrossLinkLeadAtomIndexes in interface JmolNode

getGroupType

public String getGroupType()
Specified by:
getGroupType in interface JmolNode

getResno

public int getResno()
Specified by:
getResno in interface JmolNode

getChainID

public char getChainID()
Specified by:
getChainID in interface JmolNode

getAtomLabel

static String getAtomLabel(int atomicNumber,
                           int isotopeNumber,
                           int valence,
                           int charge,
                           int nH,
                           boolean isAromatic,
                           String stereo)

isDna

public boolean isDna()
Specified by:
isDna in interface JmolNode

isRna

public boolean isRna()
Specified by:
isRna in interface JmolNode

isNucleic

public boolean isNucleic()
Specified by:
isNucleic in interface JmolNode

isProtein

public boolean isProtein()
Specified by:
isProtein in interface JmolNode

isPurine

public boolean isPurine()
Specified by:
isPurine in interface JmolNode

isPyrimidine

public boolean isPyrimidine()
Specified by:
isPyrimidine in interface JmolNode

isDeleted

public boolean isDeleted()
Specified by:
isDeleted in interface JmolNode