Package org.jmol.smiles
Class SmilesAtom
- java.lang.Object
-
- javajs.util.T3
-
- javajs.util.P3
-
- org.jmol.smiles.SmilesAtom
-
- All Implemented Interfaces:
java.io.Serializable,javajs.api.JSONEncodable,Node
public class SmilesAtom extends javajs.util.P3 implements Node
This class represents an atom in aSmilesMolecule.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanaromaticAmbiguous(package private) floatatomClassprivate intatomicMass(package private) intatomNumber(package private) intatomSite(package private) java.lang.StringatomType(package private) java.lang.StringbioAtomName(package private) charbioType(package private) intbondCount(package private) SmilesBond[]bondsprivate intcharge(package private) intcomponent(package private) intconnectivityprivate intcovalentHydrogenCount(package private) intdegree(package private) booleanelementDefined(package private) intelementNumber(package private) intexplicitHydrogenCount(package private) booleanhasSubpattern(package private) booleanhasSymbol(package private) intimplicitHydrogenCount(package private) intindex(package private) intiNested(package private) charinsCode(package private) booleanisAND(package private) booleanisAromatic(package private) booleanisBioAtom(package private) booleanisBioAtomWild(package private) booleanisBioResidue(package private) booleanisFirsttrue if this atom is the first SMILES atom or first after a .(package private) booleanisLeadAtomprivate booleanisTopoAtom(package private) intjmolIndex(package private) intmapIndex(package private) intmatchingComponentprivate intmatchingIndexprivate NodematchingNodeprivate intmissingHydrogenCount(package private) intnonhydrogenDegree(package private) booleannot(package private) intnotBondedIndex(package private) booleannotCrossLinked(package private) intnSubAtoms(package private) SmilesAtomparent(package private) java.lang.Stringpattern(package private) intprimitiveType(package private) java.lang.Stringreferance(package private) java.lang.StringresidueChar(package private) java.lang.StringresidueName(package private) intresidueNumber(package private) intringConnectivity(package private) intringMembership(package private) intringSize(package private) booleanselected(package private) SmilesStereostereo(package private) SmilesAtom[]subAtoms(package private) java.lang.Stringsymbol(package private) static java.lang.StringUNBRACKETED_SET(package private) intvalence
-
Constructor Summary
Constructors Constructor Description SmilesAtom()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddBond(SmilesBond bond)Add a bond to the atom.(package private) SmilesAtomaddSubAtom(SmilesAtom sAtom, boolean isAND)(package private) static booleanallowSmilesUnbracketed(java.lang.String xx)BSfindAtomsLike(java.lang.String substring)intgetAtomicAndIsotopeNumber()intgetAtomicMass()Returns the atomic mass of the atom.(package private) static java.lang.StringgetAtomLabel(int atomicNumber, int isotopeNumber, int valence, int charge, float osclass, int nH, boolean isAromatic, java.lang.String stereo)called from SmilesGeneratorjava.lang.StringgetAtomName()intgetAtomNumber()Returns the Jmol atom numberintgetAtomSite()java.lang.StringgetAtomType()chargetBioSmilesType()java.lang.StringgetBioStructureTypeName()SmilesBondgetBond(int number)Returns the bond at indexnumber.intgetBondCount()intgetBondedAtomIndex(int j)(package private) SmilesBondgetBondNotTo(SmilesAtom atom, boolean allowH)(package private) SmilesBondgetBondTo(SmilesAtom atom)if atom is null, return bond TO this atom (bond.atom2 == this) otherwise, return bond connecting this atom with that atomintgetChainID()java.lang.StringgetChainIDStr()intgetCharge()Returns the charge of the atom.intgetChiralClass()intgetCovalentBondCount()Returns the number of bonds of this atom.intgetCovalentBondCountPlusMissingH()includes actual + missingintgetCovalentHydrogenCount()booleangetCrossLinkVector(javajs.util.Lst<java.lang.Integer> vLinks, boolean crosslinkCovalent, boolean crosslinkHBond)(package private) static intgetDefaultCount(int elementNumber, boolean isAromatic)Edge[]getEdges()intgetElementNumber()Returns the atomic number of the element or 0intgetExplicitHydrogenCount()floatgetFloatProperty(java.lang.String property)intgetFormalCharge()java.lang.StringgetGroup1(char c0)java.lang.StringgetGroup3(boolean allowNull)voidgetGroupBits(BS bs)intgetImplicitHydrogenCount()can be > 0 for PDB model with no H atoms or for SMILES string CCCintgetIndex()Returns the atom index of the atom.chargetInsertionCode()intgetIsotopeNumber()NodegetMatchingAtom()Returns the matching atom or null.intgetMatchingAtomIndex()Returns the number of a matching atom in a molecule.intgetMatchingBondedAtom(int i)intgetModelIndex()intgetMoleculeNumber(boolean inModel)intgetOffsetResidueAtom(java.lang.String name, int offset)intgetResno()intgetTotalHydrogenCount()intgetTotalValence()intgetValence()booleanisCrossLinked(Node node)booleanisDefined()booleanisDeleted()booleanisLeadAtom()booleanisNucleic()booleanisPurine()booleanisPyrimidine()voidsetAtomicMass(int mass)Sets the atomic mass of the atom.(package private) voidsetAtomName(java.lang.String name)(package private) voidsetBioAtom(char bioType)voidsetBondArray()voidsetBonds(SmilesBond[] bonds)voidsetCharge(int charge)Sets the charge of the atom.voidsetConnectivity(int connectivity)voidsetDegree(int degree)voidsetExplicitHydrogenCount(int count)Sets the number of explicit hydrogen atoms bonded with this atom.booleansetHydrogenCount()Finalizes the hydrogen count hydrogens in aSmilesMolecule.voidsetImplicitHydrogenCount(int count)Sets the number of implicit hydrogen atoms bonded with this atom.SmilesAtomsetIndex(int index)Constructs aSmilesAtom.voidsetMatchingAtom(Node jmolAtom, int index)Sets the number of a matching atom in a molecule.voidsetNonhydrogenDegree(int degree)voidsetRingConnectivity(int rc)voidsetRingMembership(int rm)voidsetRingSize(int rs)booleansetSymbol(java.lang.String symbol)Sets the symbol of the atm.SmilesAtomsetTopoAtom(int iComponent, int ptAtom, java.lang.String symbol, int charge)voidsetValence(int valence)java.lang.StringtoString()Returns a string that contains the values of this Tuple3f.-
Methods inherited from class javajs.util.T3
add, add2, add3, ave, cross, distance, distanceSquared, dot, equals, hashCode, length, lengthSquared, normalize, scale, scaleAdd2, scaleT, set, setA, setT, sub, sub2, toJSON
-
-
-
-
Field Detail
-
UNBRACKETED_SET
static final java.lang.String UNBRACKETED_SET
- See Also:
- Constant Field Values
-
pattern
java.lang.String pattern
-
primitiveType
int primitiveType
-
isAND
boolean isAND
-
subAtoms
SmilesAtom[] subAtoms
-
nSubAtoms
int nSubAtoms
-
index
int index
-
referance
java.lang.String referance
-
residueName
java.lang.String residueName
-
residueChar
java.lang.String residueChar
-
insCode
char insCode
-
isBioAtom
boolean isBioAtom
-
isBioResidue
boolean isBioResidue
-
isBioAtomWild
boolean isBioAtomWild
-
bioType
char bioType
-
isLeadAtom
boolean isLeadAtom
-
notBondedIndex
int notBondedIndex
-
notCrossLinked
boolean notCrossLinked
-
aromaticAmbiguous
boolean aromaticAmbiguous
-
covalentHydrogenCount
private int covalentHydrogenCount
-
not
boolean not
-
selected
boolean selected
-
hasSymbol
boolean hasSymbol
-
elementDefined
boolean elementDefined
-
atomType
java.lang.String atomType
-
bioAtomName
java.lang.String bioAtomName
-
isFirst
boolean isFirst
true if this atom is the first SMILES atom or first after a . with no connector
-
jmolIndex
int jmolIndex
-
elementNumber
int elementNumber
-
atomNumber
int atomNumber
-
residueNumber
int residueNumber
-
explicitHydrogenCount
int explicitHydrogenCount
-
implicitHydrogenCount
int implicitHydrogenCount
-
parent
SmilesAtom parent
-
bonds
SmilesBond[] bonds
-
bondCount
int bondCount
-
iNested
int iNested
-
isAromatic
boolean isAromatic
-
atomicMass
private int atomicMass
-
charge
private int charge
-
matchingIndex
private int matchingIndex
-
stereo
SmilesStereo stereo
-
component
int component
-
matchingComponent
int matchingComponent
-
atomSite
int atomSite
-
degree
int degree
-
nonhydrogenDegree
int nonhydrogenDegree
-
valence
int valence
-
connectivity
int connectivity
-
ringMembership
int ringMembership
-
ringSize
int ringSize
-
ringConnectivity
int ringConnectivity
-
matchingNode
private Node matchingNode
-
hasSubpattern
boolean hasSubpattern
-
mapIndex
int mapIndex
-
atomClass
float atomClass
-
symbol
java.lang.String symbol
-
isTopoAtom
private boolean isTopoAtom
-
missingHydrogenCount
private int missingHydrogenCount
-
-
Method Detail
-
allowSmilesUnbracketed
static boolean allowSmilesUnbracketed(java.lang.String xx)
-
getAtomType
public java.lang.String getAtomType()
- Specified by:
getAtomTypein interfaceNode
-
getChiralClass
public int getChiralClass()
-
isDefined
public boolean isDefined()
-
setBioAtom
void setBioAtom(char bioType)
-
setAtomName
void setAtomName(java.lang.String name)
-
setBonds
public void setBonds(SmilesBond[] bonds)
-
addSubAtom
SmilesAtom addSubAtom(SmilesAtom sAtom, boolean isAND)
-
setIndex
public SmilesAtom setIndex(int index)
Constructs aSmilesAtom.- Parameters:
index- Atom number in the molecule.- Returns:
- this
-
setTopoAtom
public SmilesAtom setTopoAtom(int iComponent, int ptAtom, java.lang.String symbol, int charge)
-
setHydrogenCount
public boolean setHydrogenCount()
Finalizes the hydrogen count hydrogens in aSmilesMolecule. "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
-
getDefaultCount
static int getDefaultCount(int elementNumber, boolean isAromatic)
-
getIndex
public int getIndex()
Returns the atom index of the atom.
-
setSymbol
public boolean setSymbol(java.lang.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:
getElementNumberin interfaceNode- 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:
getAtomNumberin interfaceNode
-
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:
getModelIndexin interfaceNode
-
getMoleculeNumber
public int getMoleculeNumber(boolean inModel)
- Specified by:
getMoleculeNumberin interfaceNode
-
getAtomSite
public int getAtomSite()
- Specified by:
getAtomSitein interfaceNode
-
getFormalCharge
public int getFormalCharge()
- Specified by:
getFormalChargein interfaceNode
-
getIsotopeNumber
public int getIsotopeNumber()
- Specified by:
getIsotopeNumberin interfaceNode
-
getAtomicAndIsotopeNumber
public int getAtomicAndIsotopeNumber()
- Specified by:
getAtomicAndIsotopeNumberin interfaceNode
-
getAtomName
public java.lang.String getAtomName()
- Specified by:
getAtomNamein interfaceNode
-
getGroup3
public java.lang.String getGroup3(boolean allowNull)
-
addBond
void addBond(SmilesBond bond)
Add a bond to the atom.- Parameters:
bond- Bond to add.
-
setBondArray
public void setBondArray()
-
getBond
public SmilesBond getBond(int number)
Returns the bond at indexnumber.- Parameters:
number- Bond number.- Returns:
- Bond.
-
getCovalentBondCount
public int getCovalentBondCount()
Returns the number of bonds of this atom.- Specified by:
getCovalentBondCountin interfaceNode- Returns:
- Number of bonds.
-
getBondCount
public int getBondCount()
- Specified by:
getBondCountin interfaceNode
-
getCovalentBondCountPlusMissingH
public int getCovalentBondCountPlusMissingH()
Description copied from interface:Nodeincludes actual + missing- Specified by:
getCovalentBondCountPlusMissingHin interfaceNode- Returns:
- actual + missing
-
getTotalHydrogenCount
public int getTotalHydrogenCount()
- Specified by:
getTotalHydrogenCountin interfaceNode
-
getImplicitHydrogenCount
public int getImplicitHydrogenCount()
Description copied from interface:Nodecan be > 0 for PDB model with no H atoms or for SMILES string CCC- Specified by:
getImplicitHydrogenCountin interfaceNode- Returns:
- number of missing H atoms
-
getExplicitHydrogenCount
public int getExplicitHydrogenCount()
-
getMatchingBondedAtom
public int getMatchingBondedAtom(int i)
-
getBondedAtomIndex
public int getBondedAtomIndex(int j)
- Specified by:
getBondedAtomIndexin interfaceNode
-
getCovalentHydrogenCount
public int getCovalentHydrogenCount()
- Specified by:
getCovalentHydrogenCountin interfaceNode
-
getValence
public int getValence()
- Specified by:
getValencein interfaceNode
-
getTotalValence
public int getTotalValence()
- Specified by:
getTotalValencein interfaceNode
-
getBondTo
SmilesBond getBondTo(SmilesAtom atom)
if atom is null, return bond TO this atom (bond.atom2 == 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:
isLeadAtomin interfaceNode
-
getOffsetResidueAtom
public int getOffsetResidueAtom(java.lang.String name, int offset)- Specified by:
getOffsetResidueAtomin interfaceNode
-
getGroupBits
public void getGroupBits(BS bs)
- Specified by:
getGroupBitsin interfaceNode
-
isCrossLinked
public boolean isCrossLinked(Node node)
- Specified by:
isCrossLinkedin interfaceNode
-
getCrossLinkVector
public boolean getCrossLinkVector(javajs.util.Lst<java.lang.Integer> vLinks, boolean crosslinkCovalent, boolean crosslinkHBond)- Specified by:
getCrossLinkVectorin interfaceNode
-
getBioStructureTypeName
public java.lang.String getBioStructureTypeName()
- Specified by:
getBioStructureTypeNamein interfaceNode
-
getInsertionCode
public char getInsertionCode()
- Specified by:
getInsertionCodein interfaceNode
-
getChainID
public int getChainID()
- Specified by:
getChainIDin interfaceNode
-
getChainIDStr
public java.lang.String getChainIDStr()
- Specified by:
getChainIDStrin interfaceNode
-
getAtomLabel
static java.lang.String getAtomLabel(int atomicNumber, int isotopeNumber, int valence, int charge, float osclass, int nH, boolean isAromatic, java.lang.String stereo)called from SmilesGenerator- Parameters:
atomicNumber-isotopeNumber-valence- set -1 to force bracketscharge-osclass- OpenSMILES valuenH-isAromatic-stereo-- Returns:
- label
-
getBioSmilesType
public char getBioSmilesType()
- Specified by:
getBioSmilesTypein interfaceNode
-
isNucleic
public boolean isNucleic()
-
isPyrimidine
public boolean isPyrimidine()
- Specified by:
isPyrimidinein interfaceNode
-
findAtomsLike
public BS findAtomsLike(java.lang.String substring)
- Specified by:
findAtomsLikein interfaceNode
-
toString
public java.lang.String toString()
Description copied from class:javajs.util.T3Returns a string that contains the values of this Tuple3f. The form is (x,y,z).- Overrides:
toStringin classjavajs.util.T3- Returns:
- the String representation
-
getFloatProperty
public float getFloatProperty(java.lang.String property)
- Specified by:
getFloatPropertyin interfaceNode- Parameters:
property- "property_xxxx"- Returns:
- value or Float.NaN
-
-