Package org.jmol.smiles
Class SmilesAtom
java.lang.Object
javajs.util.T3
javajs.util.P3
org.jmol.smiles.SmilesAtom
- All Implemented Interfaces:
Serializable,javajs.api.JSONEncodable,Node,SimpleNode
This class represents an atom in a
SmilesMolecule.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) floatprivate int(package private) int(package private) int(package private) String(package private) String(package private) char(package private) int(package private) SmilesBond[]private intprivate int(package private) int(package private) intprivate int(package private) int(package private) boolean(package private) int(package private) int(package private) boolean(package private) boolean(package private) int(package private) int(package private) int(package private) char(package private) boolean(package private) boolean(package private) boolean(package private) boolean(package private) boolean(package private) booleantrue if this atom is the first SMILES atom or first after a .(package private) booleanprivate boolean(package private) int(package private) int(package private) intprivate intprivate Nodeprivate int(package private) int(package private) boolean(package private) int(package private) boolean(package private) int(package private) SmilesAtom(package private) String(package private) int(package private) int(package private) String(package private) String(package private) String(package private) int(package private) int(package private) int(package private) int(package private) boolean(package private) SmilesAtom[](package private) String(package private) static final String(package private) intFields inherited from class javajs.util.T3
x, y, z -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddBond(SmilesBond bond) Add a bond to the atom.(package private) SmilesAtomaddSubAtom(SmilesAtom sAtom, boolean isAND) (package private) static booleanbooleanfor InChI or any other system that self-defines stereochemistry.javajs.util.BSfindAtomsLike(String substring) intintReturns the atomic mass of the atom.(package private) static StringgetAtomLabel(int atomicNumber, int isotopeNumber, int valence, int charge, float osclass, int nH, boolean isAromatic, String stereo, boolean is2D) called from SmilesGeneratorintReturns the Jmol atom numberintchargetBond(int number) Returns the bond at indexnumber.intGet the total number of bonds, including hydrogen bonds.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 atomintintReturns the charge of the atom.intgetCIPChirality(boolean doCalculate) intintReturns the number of bonds of this atom.intincludes actual + missingintbooleangetCrossLinkVector(javajs.util.Lst<Integer> vLinks, boolean crosslinkCovalent, boolean crosslinkHBond) (package private) static intgetDefaultCount(int elementNumber, boolean isAromatic) Edge[]getEdges()Get the bond array, including hydrogen bonds.intReturns the atomic number of the element or 0int[CH2] for examplefloatgetFloatProperty(String property) intgetGroup1(char c0) getGroup3(boolean allowNull) voidgetGroupBits(javajs.util.BS bs) intcan be > 0 for PDB model with no H atoms or for SMILES string CCCintgetIndex()Returns the atom index of the atom.charintfloatgetMass()Returns the matching atom or null.intReturns the number of a matching atom in a molecule.intgetMatchingBondedAtom(int i) intintgetMoleculeNumber(boolean inModel) intgetOffsetResidueAtom(String name, int offset) intintgetResno()getStereoAtAt(SimpleNode[] nodes) intintintjavajs.util.P3getXYZ()booleanisCrossLinked(Node node) booleanbooleanbooleanbooleanbooleanisPurine()booleanisStereoOpposite(int i2, int iA, int iB) booleanvoidsetAtomicMass(int mass) Sets the atomic mass of the atom.(package private) voidsetAtomName(String name) (package private) voidsetBioAtom(char bioType) voidvoidsetBonds(SmilesBond[] bonds) voidsetCharge(int charge) Sets the charge of the atom.voidsetCIPChirality(int c) voidsetConnectivity(int connectivity) voidsetDegree(int degree) voidsetExplicitHydrogenCount(int count) Sets the number of explicit hydrogen atoms bonded with this atom.booleanFinalizes the hydrogen count hydrogens in aSmilesMolecule.voidsetImplicitHydrogenCount(int count) Sets the number of implicit hydrogen atoms bonded with this atom.setIndex(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) booleanSets the symbol of the atm.setTopoAtom(int iComponent, int ptAtom, String symbol, int charge, int patternIndex) voidsetValence(int valence) toString()Returns a string that contains the values of this Tuple3f.Methods inherited from class javajs.util.P3
getUnlikely, new3, newA, newPMethods inherited from class javajs.util.T3
add, add2, add3, ave, cross, distance, distanceSquared, dot, equals, floatToIntBits, hashCode, length, lengthSquared, normalize, scale, scaleAdd2, scaleT, set, setA, setT, sub, sub2, toJSON
-
Field Details
-
UNBRACKETED_SET
- See Also:
-
patternIndex
int patternIndex -
pattern
String pattern -
primitiveType
int primitiveType -
isAND
boolean isAND -
subAtoms
SmilesAtom[] subAtoms -
nSubAtoms
int nSubAtoms -
index
int index -
referance
String referance -
residueName
String residueName -
residueChar
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
String atomType -
bioAtomName
String bioAtomName -
isFirst
boolean isFirsttrue 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
-
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
-
hasSubpattern
boolean hasSubpattern -
mapIndex
int mapIndex -
atomClass
float atomClass -
symbol
String symbol -
isTopoAtom
private boolean isTopoAtom -
missingHydrogenCount
private int missingHydrogenCount -
cipChirality
private int cipChirality
-
-
Constructor Details
-
SmilesAtom
public SmilesAtom()
-
-
Method Details
-
allowSmilesUnbracketed
-
getAtomType
- Specified by:
getAtomTypein interfaceNode
-
getChiralClass
public int getChiralClass() -
isDefined
public boolean isDefined() -
setBioAtom
void setBioAtom(char bioType) -
setAtomName
-
setBonds
-
addSubAtom
-
setIndex
Constructs aSmilesAtom.- 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 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.- Specified by:
getIndexin interfaceNode- Specified by:
getIndexin interfaceSimpleNode- Returns:
- Atom index.
-
setSymbol
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- Specified by:
getElementNumberin interfaceSimpleNode- 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
Returns the matching atom or null.- Returns:
- matching atom
-
setMatchingAtom
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- Specified by:
getFormalChargein interfaceSimpleNode- Returns:
- the formal charge for this atom
-
getIsotopeNumber
public int getIsotopeNumber()- Specified by:
getIsotopeNumberin interfaceNode- Specified by:
getIsotopeNumberin interfaceSimpleNode
-
getAtomicAndIsotopeNumber
public int getAtomicAndIsotopeNumber()- Specified by:
getAtomicAndIsotopeNumberin interfaceNode
-
getAtomName
- Specified by:
getAtomNamein interfaceNode- Specified by:
getAtomNamein interfaceSimpleNode
-
getGroup3
-
getGroup1
-
addBond
Add a bond to the atom.- Parameters:
bond- Bond to add.
-
setBondArray
public void setBondArray() -
getEdges
Description copied from interface:SimpleNodeGet the bond array, including hydrogen bonds.- Specified by:
getEdgesin interfaceNode- Specified by:
getEdgesin interfaceSimpleNode- Returns:
- number of bonds
-
getBond
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- Specified by:
getCovalentBondCountin interfaceSimpleNode- Returns:
- Number of bonds.
-
getBondCount
public int getBondCount()Description copied from interface:SimpleNodeGet the total number of bonds, including hydrogen bonds.- Specified by:
getBondCountin interfaceSimpleNode- Returns:
- number of bonds
-
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()Description copied from interface:Node[CH2] for example- Specified by:
getExplicitHydrogenCountin interfaceNode- Returns:
- number of H atoms in brackets
-
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- Specified by:
getValencein interfaceSimpleNode- Returns:
- the sum of the bond orders for this atom
-
getTotalValence
public int getTotalValence()- Specified by:
getTotalValencein interfaceNode
-
getBondTo
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
-
isLeadAtom
public boolean isLeadAtom()- Specified by:
isLeadAtomin interfaceNode
-
getOffsetResidueAtom
- Specified by:
getOffsetResidueAtomin interfaceNode
-
getGroupBits
public void getGroupBits(javajs.util.BS bs) - Specified by:
getGroupBitsin interfaceNode
-
isCrossLinked
- Specified by:
isCrossLinkedin interfaceNode
-
getCrossLinkVector
public boolean getCrossLinkVector(javajs.util.Lst<Integer> vLinks, boolean crosslinkCovalent, boolean crosslinkHBond) - Specified by:
getCrossLinkVectorin interfaceNode
-
getBioStructureTypeName
- Specified by:
getBioStructureTypeNamein interfaceNode
-
getInsertionCode
public char getInsertionCode()- Specified by:
getInsertionCodein interfaceNode
-
getResno
public int getResno() -
getChainID
public int getChainID()- Specified by:
getChainIDin interfaceNode
-
getChainIDStr
- Specified by:
getChainIDStrin interfaceNode
-
getAtomLabel
static String getAtomLabel(int atomicNumber, int isotopeNumber, int valence, int charge, float osclass, int nH, boolean isAromatic, String stereo, boolean is2D) called from SmilesGenerator- Parameters:
atomicNumber-isotopeNumber-valence- set -1 to force bracketscharge-osclass- OpenSMILES valuenH-isAromatic-stereo-is2D-- Returns:
- label
-
getBioSmilesType
public char getBioSmilesType()- Specified by:
getBioSmilesTypein interfaceNode
-
isNucleic
public boolean isNucleic() -
isPurine
public boolean isPurine() -
isPyrimidine
public boolean isPyrimidine()- Specified by:
isPyrimidinein interfaceNode
-
isDeleted
public boolean isDeleted() -
findAtomsLike
- Specified by:
findAtomsLikein interfaceNode
-
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
- Specified by:
getFloatPropertyin interfaceNode- Parameters:
property- "property_xxxx"- Returns:
- value or Float.NaN
-
getMass
public float getMass()- Specified by:
getMassin interfaceNode- Specified by:
getMassin interfaceSimpleNode- Returns:
- the mass or, if specified, the mass number
-
getCIPChirality
- Specified by:
getCIPChiralityin interfaceNode
-
setCIPChirality
public void setCIPChirality(int c) - Specified by:
setCIPChiralityin interfaceNode- Specified by:
setCIPChiralityin interfaceSimpleNode
-
getCIPChiralityCode
public int getCIPChiralityCode()- Specified by:
getCIPChiralityCodein interfaceNode
-
getXYZ
public javajs.util.P3 getXYZ()- Specified by:
getXYZin interfaceNode- Specified by:
getXYZin interfaceSimpleNode- Returns:
- the position of this atom
-
getStereo
-
getPatternIndex
public int getPatternIndex() -
modelIsRawPDB
public boolean modelIsRawPDB()- Specified by:
modelIsRawPDBin interfaceNode
-
definesStereo
public boolean definesStereo()for InChI or any other system that self-defines stereochemistry.- Returns:
- false
-
getStereoAtAt
-
isStereoOpposite
- Parameters:
i2-iA-iB-- Returns:
- TRUE if opposite
-