Class SmilesAtom

java.lang.Object
javajs.util.T3
javajs.util.P3
org.jmol.smiles.SmilesAtom
All Implemented Interfaces:
Serializable, JSONEncodable, Node, SimpleNode

public class SmilesAtom extends P3 implements Node
This class represents an atom in a SmilesMolecule.
See Also:
  • Field Details

  • Constructor Details

    • SmilesAtom

      public SmilesAtom()
  • Method Details

    • getAtomType

      public String getAtomType()
      Specified by:
      getAtomType in interface Node
    • getChiralClass

      public int getChiralClass()
    • isDefined

      public boolean isDefined()
    • setBonds

      public void setBonds(SmilesBond[] bonds)
    • setIndex

      public SmilesAtom setIndex(int index)
      Constructs a SmilesAtom.
      Parameters:
      index - Atom number in the molecule.
      Returns:
      this
    • setTopoAtom

      public SmilesAtom setTopoAtom(int iComponent, int ptAtom, String symbol, int charge, int patternIndex)
    • setHydrogenCount

      public boolean setHydrogenCount()
      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.
      Returns:
      false if inappropriate
    • getIndex

      public int getIndex()
      Returns the atom index of the atom.
      Specified by:
      getIndex in interface Node
      Specified by:
      getIndex in interface SimpleNode
      Returns:
      Atom index.
    • setSymbol

      public boolean setSymbol(String symbol)
      Sets the symbol of the atm.
      Parameters:
      symbol - Atom symbol.
      Returns:
      false if invalid symbol
    • getElementNumber

      public int getElementNumber()
      Returns the atomic number of the element or 0
      Specified by:
      getElementNumber in interface Node
      Specified by:
      getElementNumber in interface SimpleNode
      Returns:
      atomicNumber
    • getAtomicMass

      public int getAtomicMass()
      Returns the atomic mass of the atom.
      Returns:
      Atomic mass.
    • getAtomNumber

      public int getAtomNumber()
      Returns the Jmol atom number
      Specified by:
      getAtomNumber in interface Node
    • 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.
    • getMatchingAtomIndex

      public int getMatchingAtomIndex()
      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 index
    • getMatchingAtom

      public Node getMatchingAtom()
      Returns the matching atom or null.
      Returns:
      matching atom
    • setMatchingAtom

      public void setMatchingAtom(Node jmolAtom, int index)
      Sets the number of a matching atom in a molecule. This value is temporary, it is used during the pattern matching algorithm.
      Parameters:
      jmolAtom -
      index - Temporary: number of a matching atom in a molecule.
    • 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 Node
    • getMoleculeNumber

      public int getMoleculeNumber(boolean inModel)
      Specified by:
      getMoleculeNumber in interface Node
    • getAtomSite

      public int getAtomSite()
      Specified by:
      getAtomSite in interface Node
    • getFormalCharge

      public int getFormalCharge()
      Specified by:
      getFormalCharge in interface Node
      Specified by:
      getFormalCharge in interface SimpleNode
      Returns:
      the formal charge for this atom
    • getIsotopeNumber

      public int getIsotopeNumber()
      Specified by:
      getIsotopeNumber in interface Node
      Specified by:
      getIsotopeNumber in interface SimpleNode
    • getAtomicAndIsotopeNumber

      public int getAtomicAndIsotopeNumber()
      Specified by:
      getAtomicAndIsotopeNumber in interface Node
    • getAtomName

      public String getAtomName()
      Specified by:
      getAtomName in interface Node
      Specified by:
      getAtomName in interface SimpleNode
    • getGroup3

      public String getGroup3(boolean allowNull)
      Specified by:
      getGroup3 in interface Node
    • getGroup1

      public String getGroup1(char c0)
      Specified by:
      getGroup1 in interface Node
    • setBondArray

      public void setBondArray()
    • getEdges

      public Edge[] getEdges()
      Description copied from interface: SimpleNode
      Get the bond array, including hydrogen bonds.
      Specified by:
      getEdges in interface Node
      Specified by:
      getEdges in interface SimpleNode
      Returns:
      number of bonds
    • 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 Node
      Specified by:
      getCovalentBondCount in interface SimpleNode
      Returns:
      Number of bonds.
    • getBondCount

      public int getBondCount()
      Description copied from interface: SimpleNode
      Get the total number of bonds, including hydrogen bonds.
      Specified by:
      getBondCount in interface SimpleNode
      Returns:
      number of bonds
    • getCovalentBondCountPlusMissingH

      public int getCovalentBondCountPlusMissingH()
      Description copied from interface: Node
      includes actual + missing
      Specified by:
      getCovalentBondCountPlusMissingH in interface Node
      Returns:
      actual + missing
    • getTotalHydrogenCount

      public int getTotalHydrogenCount()
      Specified by:
      getTotalHydrogenCount in interface Node
    • getImplicitHydrogenCount

      public int getImplicitHydrogenCount()
      Description copied from interface: Node
      can be > 0 for PDB model with no H atoms or for SMILES string CCC
      Specified by:
      getImplicitHydrogenCount in interface Node
      Returns:
      number of missing H atoms
    • getExplicitHydrogenCount

      public int getExplicitHydrogenCount()
      Description copied from interface: Node
      [CH2] for example
      Specified by:
      getExplicitHydrogenCount in interface Node
      Returns:
      number of H atoms in brackets
    • getMatchingBondedAtom

      public int getMatchingBondedAtom(int i)
    • getBondedAtomIndex

      public int getBondedAtomIndex(int j)
      Specified by:
      getBondedAtomIndex in interface Node
    • getCovalentHydrogenCount

      public int getCovalentHydrogenCount()
      Specified by:
      getCovalentHydrogenCount in interface Node
    • getValence

      public int getValence()
      Specified by:
      getValence in interface Node
      Specified by:
      getValence in interface SimpleNode
      Returns:
      the sum of the bond orders for this atom
    • getTotalValence

      public int getTotalValence()
      Specified by:
      getTotalValence in interface Node
    • isLeadAtom

      public boolean isLeadAtom()
      Specified by:
      isLeadAtom in interface Node
    • getOffsetResidueAtom

      public int getOffsetResidueAtom(String name, int offset)
      Specified by:
      getOffsetResidueAtom in interface Node
    • getGroupBits

      public void getGroupBits(BS bs)
      Specified by:
      getGroupBits in interface Node
    • isCrossLinked

      public boolean isCrossLinked(Node node)
      Specified by:
      isCrossLinked in interface Node
    • getCrossLinkVector

      public boolean getCrossLinkVector(Lst<Integer> vLinks, boolean crosslinkCovalent, boolean crosslinkHBond)
      Specified by:
      getCrossLinkVector in interface Node
    • getBioStructureTypeName

      public String getBioStructureTypeName()
      Specified by:
      getBioStructureTypeName in interface Node
    • getInsertionCode

      public char getInsertionCode()
      Specified by:
      getInsertionCode in interface Node
    • getResno

      public int getResno()
      Specified by:
      getResno in interface Node
    • getChainID

      public int getChainID()
      Specified by:
      getChainID in interface Node
    • getChainIDStr

      public String getChainIDStr()
      Specified by:
      getChainIDStr in interface Node
    • getBioSmilesType

      public char getBioSmilesType()
      Specified by:
      getBioSmilesType in interface Node
    • isNucleic

      public boolean isNucleic()
    • isPurine

      public boolean isPurine()
      Specified by:
      isPurine in interface Node
    • isPyrimidine

      public boolean isPyrimidine()
      Specified by:
      isPyrimidine in interface Node
    • isDeleted

      public boolean isDeleted()
      Specified by:
      isDeleted in interface Node
    • findAtomsLike

      public BS findAtomsLike(String substring)
      Specified by:
      findAtomsLike in interface Node
    • toString

      public String toString()
      Description copied from class: T3
      Returns a string that contains the values of this Tuple3f. The form is (x,y,z).
      Overrides:
      toString in class T3
      Returns:
      the String representation
    • getFloatProperty

      public float getFloatProperty(String property)
      Specified by:
      getFloatProperty in interface Node
      Parameters:
      property - "property_xxxx"
      Returns:
      value or Float.NaN
    • getMass

      public float getMass()
      Specified by:
      getMass in interface Node
      Specified by:
      getMass in interface SimpleNode
      Returns:
      the mass or, if specified, the mass number
    • getCIPChirality

      public String getCIPChirality(boolean doCalculate)
      Specified by:
      getCIPChirality in interface Node
    • setCIPChirality

      public void setCIPChirality(int c)
      Specified by:
      setCIPChirality in interface Node
      Specified by:
      setCIPChirality in interface SimpleNode
    • getCIPChiralityCode

      public int getCIPChiralityCode()
      Specified by:
      getCIPChiralityCode in interface Node
    • getXYZ

      public P3 getXYZ()
      Specified by:
      getXYZ in interface Node
      Specified by:
      getXYZ in interface SimpleNode
      Returns:
      the position of this atom
    • getStereo

      public SmilesStereo getStereo()
    • getPatternIndex

      public int getPatternIndex()
    • modelIsRawPDB

      public boolean modelIsRawPDB()
      Specified by:
      modelIsRawPDB in interface Node
    • definesStereo

      public boolean definesStereo()
      for InChI or any other system that self-defines stereochemistry.
      Returns:
      false
    • getStereoAtAt

      public String getStereoAtAt(SimpleNode[] nodes)
    • isStereoOpposite

      public Boolean isStereoOpposite(int i2, int iA, int iB)
      Parameters:
      i2 -
      iA -
      iB -
      Returns:
      TRUE if opposite