Package org.openscience.cdk.interfaces
Interface IAtom
-
- All Superinterfaces:
Cloneable
,IAtomType
,ICDKObject
,IChemObject
,IElement
,IIsotope
- All Known Subinterfaces:
IFragmentAtom
,IPDBAtom
,IPseudoAtom
,IQueryAtom
- All Known Implementing Classes:
AliphaticAtom
,AliphaticSymbolAtom
,AnyAtom
,AromaticAtom
,AromaticSymbolAtom
,Atom
,Atom
,AtomicNumberAtom
,AtomRef
,ChiralityAtom
,DebugAtom
,DebugFragmentAtom
,DebugPDBAtom
,DebugPseudoAtom
,EnzymeResidueLocator
,ExplicitConnectionAtom
,FormalChargeAtom
,FragmentAtom
,FragmentAtom
,HybridizationNumberAtom
,HydrogenAtom
,ImplicitHCountAtom
,InverseSymbolSetQueryAtom
,LogicalOperatorAtom
,MassAtom
,NonCHHeavyAtom
,PDBAtom
,PDBAtom
,PeriodicGroupNumberAtom
,PharmacophoreAtom
,PharmacophoreQueryAtom
,PseudoAtom
,PseudoAtom
,QueryAtom
,ReactionRoleQueryAtom
,RecursiveSmartsAtom
,RingIdentifierAtom
,RingMembershipAtom
,SmallestRingAtom
,SMARTSAtom
,SymbolAndChargeQueryAtom
,SymbolChargeIDQueryAtom
,SymbolQueryAtom
,SymbolSetQueryAtom
,TotalConnectionAtom
,TotalHCountAtom
,TotalRingConnectionAtom
,TotalValencyAtom
public interface IAtom extends IAtomType
Represents the idea of an chemical atom.- Author:
- egonw
- Source code:
- main
- Belongs to CDK module:
- interfaces
- Keywords:
- atom
- Created on:
- 2005-08-24
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openscience.cdk.interfaces.IAtomType
IAtomType.Hybridization
-
-
Field Summary
-
Fields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED
-
Fields inherited from interface org.openscience.cdk.interfaces.IElement
Ac, Ag, Al, Am, Ar, As, At, Au, B, Ba, Be, Bh, Bi, Bk, Br, C, Ca, Cd, Ce, Cf, Cl, Cm, Cn, Co, Cr, Cs, Cu, Db, Ds, Dy, Er, Es, Eu, F, Fe, Fl, Fm, Fr, Ga, Gd, Ge, H, He, Hf, Hg, Ho, Hs, I, In, Ir, K, Kr, La, Li, Lr, Lu, Lv, Mc, Md, Mg, Mn, Mo, Mt, N, Na, Nb, Nd, Ne, Nh, Ni, No, Np, O, Og, Os, P, Pa, Pb, Pd, Pm, Po, Pr, Pt, Pu, Ra, Rb, Re, Rf, Rg, Rh, Rn, Ru, S, Sb, Sc, Se, Sg, Si, Sm, Sn, Sr, Ta, Tb, Tc, Te, Th, Ti, Tl, Tm, Ts, U, V, W, Wildcard, Xe, Y, Yb, Zn, Zr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Iterable<IBond>
bonds()
Returns the bonds connected to this atom.IAtom
clone()
Returns a deep clone of this IChemObject.IBond
getBond(IAtom atom)
Returns the bond connecting 'this' atom to the provided atom.int
getBondCount()
Get the number of explicit bonds connected to this atom.Double
getCharge()
Returns the partial charge of this atom.IAtomContainer
getContainer()
Access theIAtomContainer
of which this atom is a member of.javax.vecmath.Point3d
getFractionalPoint3d()
Returns a point specifying the location of this atom in a Crystal unit cell.Integer
getImplicitHydrogenCount()
Returns the implicit hydrogen count of this atom.int
getIndex()
Acces the index of an atom in the context of anIAtomContainer
.int
getMapIdx()
Access the map index for this atom.javax.vecmath.Point2d
getPoint2d()
Returns a point specifying the location of this atom in a 2D space.javax.vecmath.Point3d
getPoint3d()
Returns a point specifying the location of this atom in a 3D space.Integer
getStereoParity()
Deprecated.useIStereoElement
s for storing stereochemistrydefault Integer
getTotalHydrogenCount()
Calculates the total number of hydrogens connected to this atom.default boolean
isAromatic()
Access whether this atom has been marked as aromatic.default boolean
isInRing()
Access whether this atom has been flagged as in a ring.default Iterable<IAtom>
neighbors()
Iterable over the atoms connected to this atom (the neighbors).void
setCharge(Double charge)
Sets the partial charge of this atom.void
setFractionalPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in a Crystal unit cell.void
setImplicitHydrogenCount(Integer hydrogenCount)
Sets the implicit hydrogen count of this atom.default void
setIsAromatic(boolean arom)
Mark this atom as being aromatic.default void
setIsInRing(boolean ring)
Mark this atom as being in a ring.void
setMapIdx(int mapidx)
Set the map index for this atom.void
setPoint2d(javax.vecmath.Point2d point2d)
Sets a point specifying the location of this atom in a 2D space.void
setPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in 3D space.void
setStereoParity(Integer stereoParity)
Deprecated.useIStereoElement
s for storing stereochemistry-
Methods inherited from interface org.openscience.cdk.interfaces.IAtomType
getAtomTypeName, getBondOrderSum, getCovalentRadius, getFormalCharge, getFormalNeighbourCount, getHybridization, getMaxBondOrder, getValency, setAtomTypeName, setBondOrderSum, setCovalentRadius, setFormalCharge, setFormalNeighbourCount, setHybridization, setMaxBondOrder, setValency
-
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, clear, flags, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setProperty, toString
-
Methods inherited from interface org.openscience.cdk.interfaces.IElement
getAtomicNumber, getSymbol, setAtomicNumber, setSymbol
-
Methods inherited from interface org.openscience.cdk.interfaces.IIsotope
getExactMass, getMassNumber, getNaturalAbundance, setExactMass, setMassNumber, setNaturalAbundance
-
-
-
-
Method Detail
-
setCharge
void setCharge(Double charge)
Sets the partial charge of this atom.- Parameters:
charge
- The partial charge- See Also:
getCharge()
-
getCharge
Double getCharge()
Returns the partial charge of this atom.- Returns:
- the charge of this atom
- See Also:
setCharge(java.lang.Double)
-
setImplicitHydrogenCount
void setImplicitHydrogenCount(Integer hydrogenCount)
Sets the implicit hydrogen count of this atom.- Parameters:
hydrogenCount
- The number of hydrogen atoms bonded to this atom.- See Also:
getImplicitHydrogenCount()
-
getImplicitHydrogenCount
Integer getImplicitHydrogenCount()
Returns the implicit hydrogen count of this atom.- Returns:
- The hydrogen count of this atom.
- See Also:
setImplicitHydrogenCount(java.lang.Integer)
-
getTotalHydrogenCount
default Integer getTotalHydrogenCount()
Calculates the total number of hydrogens connected to this atom. The value is determined on demand from the implicit hydrogen count and the number of connected hydrogen atoms.
Note: some hydrogens may be bridged (e.g. B2H6) so although the total number of hydrogens in the molecule is 6, each atom has a total hydrogen count of 4.- Returns:
- the total hydrogen count or null if the implicit count is not set
-
setPoint2d
void setPoint2d(javax.vecmath.Point2d point2d)
Sets a point specifying the location of this atom in a 2D space.- Parameters:
point2d
- A point in a 2D plane- See Also:
getPoint2d()
-
setPoint3d
void setPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in 3D space.- Parameters:
point3d
- A point in a 3-dimensional space- See Also:
getPoint3d()
-
setFractionalPoint3d
void setFractionalPoint3d(javax.vecmath.Point3d point3d)
Sets a point specifying the location of this atom in a Crystal unit cell.- Parameters:
point3d
- A point in a 3d fractional unit cell space- See Also:
getFractionalPoint3d()
,Crystal
-
setStereoParity
@Deprecated void setStereoParity(Integer stereoParity)
Deprecated.useIStereoElement
s for storing stereochemistrySets the stereo parity for this atom.- Parameters:
stereoParity
- The stereo parity for this atom- See Also:
for predefined values.
,getStereoParity()
-
getPoint2d
javax.vecmath.Point2d getPoint2d()
Returns a point specifying the location of this atom in a 2D space.- Returns:
- A point in a 2D plane. Null if unset.
- See Also:
setPoint2d(javax.vecmath.Point2d)
-
getPoint3d
javax.vecmath.Point3d getPoint3d()
Returns a point specifying the location of this atom in a 3D space.- Returns:
- A point in 3-dimensional space. Null if unset.
- See Also:
setPoint3d(javax.vecmath.Point3d)
-
getFractionalPoint3d
javax.vecmath.Point3d getFractionalPoint3d()
Returns a point specifying the location of this atom in a Crystal unit cell.- Returns:
- A point in 3d fractional unit cell space. Null if unset.
- See Also:
setFractionalPoint3d(javax.vecmath.Point3d)
,for predefined values.
-
getStereoParity
@Deprecated Integer getStereoParity()
Deprecated.useIStereoElement
s for storing stereochemistryReturns the stereo parity of this atom. It uses the predefined values found in CDKConstants.- Returns:
- The stereo parity for this atom
- See Also:
CDKConstants
,setStereoParity(java.lang.Integer)
-
getContainer
IAtomContainer getContainer()
Access theIAtomContainer
of which this atom is a member of. Because atoms can be in multiple molecules this method will only work if the atom has been accessed in the context of anIAtomContainer
, for example:IAtomContainer mol = new AtomContainer(); IAtom atom = new Atom(6); atom.getContainer(); // null mol.add(atom); atom.getContainer(); // still null mol.getAtom(0).getContainer(); // not-null, returns 'mol'
- Returns:
- the atom container or null if not accessed in the context of a container
-
getIndex
int getIndex()
Acces the index of an atom in the context of anIAtomContainer
. If the index is not known, < 0 is returned.- Returns:
- atom index or < 0 if the index is not known
-
bonds
Iterable<IBond> bonds()
Returns the bonds connected to this atom. If the bonds are not known an exception is thrown. This method will only throw an exception ifgetIndex()
returns < 0 orgetContainer()
returns null.IAtom atom = ...; if (atom.getIndex() >= 0) { for (IBond bond : atom.bonds()) { } } if (atom.getContainer() != null) { for (IBond bond : atom.bonds()) { } } IAtomContainer mol = ...; // guaranteed not throw an exception for (IBond bond : mol.getAtom(i).bonds()) { }
- Returns:
- iterable of bonds
- Throws:
UnsupportedOperationException
- thrown if the bonds are not known
-
neighbors
default Iterable<IAtom> neighbors()
Iterable over the atoms connected to this atom (the neighbors). This is a convenience function which callsIBond.getOther(IAtom)
. If you need both the bond and the atom the idiom is:
This will work but is less efficient:for (IBond bond : atom.bonds()) { IAtom nbor = bond.getOther(atom); }
for (IAtom nbor : atom.neighbors()) { IAtom bond = atom.getBond(nbor); // slow! }
- Returns:
- the neighbors
-
getBondCount
int getBondCount()
Get the number of explicit bonds connected to this atom.- Returns:
- the total bond count
-
getBond
IBond getBond(IAtom atom)
Returns the bond connecting 'this' atom to the provided atom. If the atoms are not bonded, null is returned.- Parameters:
atom
- the other atom- Returns:
- the bond connecting the atoms
- Throws:
UnsupportedOperationException
- thrown if the bonds are not known
-
isAromatic
default boolean isAromatic()
Access whether this atom has been marked as aromatic. The default value is false and you must explicitly perceive aromaticity with one of the available models.- Returns:
- aromatic status
- See Also:
IChemObject.getFlag(int)
,Aromaticity
-
setIsAromatic
default void setIsAromatic(boolean arom)
Mark this atom as being aromatic.- Parameters:
arom
- aromatic status- See Also:
IChemObject.setFlag(int, boolean)
-
isInRing
default boolean isInRing()
Access whether this atom has been flagged as in a ring. The default value is false and you must explicitly find rings first.- Returns:
- ring status
- See Also:
IChemObject.getFlag(int)
,RingSearch
-
setIsInRing
default void setIsInRing(boolean ring)
Mark this atom as being in a ring.- Parameters:
ring
- ring status- See Also:
IChemObject.setFlag(int, boolean)
-
getMapIdx
int getMapIdx()
Access the map index for this atom.- Returns:
- the map index (0 if not set)
-
setMapIdx
void setMapIdx(int mapidx)
Set the map index for this atom.- Parameters:
mapidx
- the new map index
-
clone
IAtom clone() throws CloneNotSupportedException
Returns a deep clone of this IChemObject.- Specified by:
clone
in interfaceIChemObject
- Returns:
- Object the clone of this IChemObject.
- Throws:
CloneNotSupportedException
- if the IChemObject cannot be cloned
-
-