Class MolAtom

java.lang.Object
chemaxon.struc.MolAtom
All Implemented Interfaces:
StereoConstants, Serializable
Direct Known Subclasses:
SgroupAtom

@PublicApi public class MolAtom extends Object implements StereoConstants, Serializable
Atom object in a molecule.

Besides chemical attributes (like atomic number, charge, mass number, radical etc.), an atom object can also contain arbitrary general properties (key-value pairs). See putProperty(String, Object), getProperty(String), and related methods. Furthermore, atoms can have additional properties to represent query features in structure search context.

See Also:
  • Field Details

    • LONELY_H

      public static final int LONELY_H
      Include lonely Hydrogen atom(s). It is not possible to convert these Hydrogen atom to implicit one, so in this case the Hydrogen atom simply is removed.
      Since:
      Marvin 3.1
      See Also:
    • ISOTOPE_H

      public static final int ISOTOPE_H
      Include Hydrogen isotope(s).
      Since:
      Marvin 3.1
      See Also:
    • CHARGED_H

      public static final int CHARGED_H
      Include charged Hydrogen atom(s).
      Since:
      Marvin 3.1
      See Also:
    • RADICAL_H

      public static final int RADICAL_H
      Include radical Hydrogen atom(s).
      Since:
      Marvin 3.1
      See Also:
    • MAPPED_H

      public static final int MAPPED_H
      Mapped Hydrogen atom(s).
      Since:
      Marvin 3.1
      See Also:
    • WEDGED_H

      public static final int WEDGED_H
      Hydrogen atom(s) with wedge bonds.
      Since:
      Marvin 4.0
      See Also:
    • HCONNECTED_H

      public static final int HCONNECTED_H
      Hydrogen atom(s) connected to another hydrogen only.
      Since:
      Marvin 4.0
      See Also:
    • CTSPECIFIC_H

      @Deprecated public static final int CTSPECIFIC_H
      Deprecated.
      As of Marvin 5.11
      Graph invariants are checked by default when calculating CIS/TRANS stereo, so this option is out of use.
      Hydrogen atom connecting alone to one side of a double bond with specified CIS or TRANS stereo information. The removal of this atom would abolish the stereo information at the neighboring double bond.
      Since:
      Marvin 5.0
      See Also:
    • POLYMERENDGROUP_H

      public static final int POLYMERENDGROUP_H
      Hydrogen atom which have a neighbor that is in an Sgroup (not DataSgroup or SuperatomSgroup) and the H is not in the same sgroup should be kept. The removal of this atom would spoil the sgroup meaning in case of polymers.
      Since:
      Marvin 5.2.3 09/06/2009
      See Also:
    • SGROUPEND_H

      public static final int SGROUPEND_H
      Hydrogen atom which have a neighbor that is in a SuperatomSgroup. and the H is not in the same sgroup should be kept. The removal of this atom would result in sgroup attachment point.
      Since:
      Marvin 5.8.1 01/25/2012
      See Also:
    • VALENCEERROR_H

      public static final int VALENCEERROR_H
      Hydrogen atom(s) connected to an atom which have valence error. The removal of this atom would result in loss of implicit Hydrogen atom count after valenceCheck call. (ValenceCheck modifies the implicit Hydrogen atom count to chemically valid value.)
      Since:
      Marvin 5.9.1 03/12/2012
      See Also:
    • SGROUP_H

      public static final int SGROUP_H
      Hydrogen atom which is the only atom in an Sgroup.
      Since:
      Marvin 5.10 05/11/2012
      See Also:
    • BRIDGEHEAD_H

      public static final int BRIDGEHEAD_H
      Hydrogen atom which is connected to a bridgehead atom.
      Since:
      Marvin 5.11 08/01/2012
      See Also:
    • HBONDED_H

      public static final int HBONDED_H
      Hydrogen atom wtih a MolBond.HYDROGEN bond on it.
      Since:
      Marvin 6.1 15/07/2013
      See Also:
    • OMIT_POSTCLEAN

      public static final int OMIT_POSTCLEAN
      Omit arranging process after the hydrogen addition.
      See Also:
    • METALCONNECTED_H

      public static final int METALCONNECTED_H
      Hydrogen atom(s) connected to metal.
      Since:
      Marvin 16.1.25
      See Also:
    • ALL_H

      public static final int ALL_H
      Include any Hydrogen atom.
      Since:
      Marvin 4.1.3, 11/09/2006
      See Also:
    • ELEMENT_COUNT

      public static final int ELEMENT_COUNT
      Number of elements in the periodic table
      See Also:
    • EMPTY

      public static final int EMPTY
      Empty atom type. Useful for bond drawing.
      See Also:
    • LIST

      public static final int LIST
      "Atomic number" of the inclusive atom list.
      See Also:
    • NOTLIST

      public static final int NOTLIST
      "Atomic number" of the exclusive atom list.
      See Also:
    • LP

      public static final int LP
      "Atomic number" of the lone pair.
      See Also:
    • ANY

      public static final int ANY
      "Atomic number" of the any atom A. Represents any atom except hydrogen.
      See Also:
    • HETERO

      public static final int HETERO
      "Atomic number" of the hetero any atom Q.
      See Also:
    • STAR

      public static final int STAR
      "Atomic number" of the star atom. Star atoms represent unknown or unspecified end groups. For more information on star atoms, see
      See Also:
    • RGROUP

      public static final int RGROUP
      "Atomic number" of the R-group query "atom".
      See Also:
    • SGROUP

      public static final int SGROUP
      "Atomic number" of an Sgroup.
      See Also:
    • PSEUDO

      public static final int PSEUDO
      "Atomic number" of a pseudoatom. The atom type string of a pseudo atom can be obtained by the getAliasstr() method.
      Since:
      Marvin 3.5, 07/22/2004
      See Also:
    • MULTICENTER

      public static final int MULTICENTER
      "Atomic number" of a central atom of a MulticenterSgroup.
      Since:
      Marvin 5.0, 01/05/2007
      See Also:
    • RGROUP_ATTACHMENT

      public static final int RGROUP_ATTACHMENT
      "Atomic number" of an ordered R-group attachment point.
      Since:
      Marvin 5.4, 20/07/2010
      See Also:
    • ATOM_TYPE_MAX

      public static final int ATOM_TYPE_MAX
      Maximum atom number.
      See Also:
    • ATOM_TYPE_COUNT

      public static final int ATOM_TYPE_COUNT
      Number of atom types in the elements array
      See Also:
    • HS_UNKNOWN

      public static final int HS_UNKNOWN
      Unknown hybridization state.
      See Also:
    • HS_S

      public static final int HS_S
      S hybridization state. Line configuration.
      See Also:
    • HS_SP

      public static final int HS_SP
      SP hybridization state.
      See Also:
    • HS_SP2

      public static final int HS_SP2
      SP2 hybridization state. Planar configuration.
      See Also:
    • HS_SP3

      public static final int HS_SP3
      SP3 hybridization state. Tetrahedral configuration.
      See Also:
    • RGROUP_MAX

      public static final int RGROUP_MAX
      Maximum R-group number (32767).
      See Also:
    • RAD_OFF

      public static final int RAD_OFF
      Radical value offset in flags.
      Since:
      Marvin 3.0
      See Also:
    • RAD_MASK

      public static final int RAD_MASK
      Radical value bits in flags.
      Since:
      Marvin 3.0
      See Also:
    • RAD_COUNT_MASK

      public static final int RAD_COUNT_MASK
      Radical's free electron count bits in flags for valid radical values.
      Since:
      Marvin 3.0
      See Also:
    • RAD1

      public static final int RAD1
      Monovalent radical center.
      Since:
      Marvin 3.0
      See Also:
    • RAD2

      public static final int RAD2
      Divalent radical center.
      Since:
      Marvin 3.0
      See Also:
    • RAD2_SINGLET

      public static final int RAD2_SINGLET
      Divalent radical center with singlet electronic configuration.
      Since:
      Marvin 3.0
      See Also:
    • RAD2_TRIPLET

      public static final int RAD2_TRIPLET
      Divalent radical center with triplet electronic configuration.
      Since:
      Marvin 3.0
      See Also:
    • RAD3

      public static final int RAD3
      Trivalent radical center.
      Since:
      Marvin 3.0
      See Also:
    • RAD3_DOUBLET

      public static final int RAD3_DOUBLET
      Trivalent radical center with doublet electronic configuration.
      Since:
      Marvin 4.0.2, 08/22/2005
      See Also:
    • RAD3_QUARTET

      public static final int RAD3_QUARTET
      Trivalent radical center with quartet electronic configuration.
      Since:
      Marvin 4.0.2, 08/22/2005
      See Also:
    • RAD4

      public static final int RAD4
      Invalid value for radical center for students.
      Since:
      Marvin 5.8
      See Also:
    • AAMAP_MAX

      public static final int AAMAP_MAX
      Maximum atom-atom mapping number.
      See Also:
    • AAMAP_OFF

      public static final int AAMAP_OFF
      Atom map offset in flags.
      See Also:
    • AAMAP_MASK

      public static final int AAMAP_MASK
      Atom map mask in flags.
      See Also:
    • SETSEQ_MAX

      public static final int SETSEQ_MAX
      Maximum atom set sequence number is currently 63.
      Since:
      Marvin 3.0
      See Also:
    • RESTYPE_MAX

      public static final int RESTYPE_MAX
      Maximum residue type is currently 63.
      Since:
      Marvin 3.0
      See Also:
    • RESSEQ_MAX

      public static final int RESSEQ_MAX
      Maximum residue sequence number is currently 8191.
      Since:
      Marvin 3.0
      See Also:
    • RXNSTEREO_NONE

      public static final int RXNSTEREO_NONE
      The stereo configuration of the atom is not considered during the reaction.
      Since:
      Marvin 3.0
      See Also:
    • RXNSTEREO_INVERSION

      public static final int RXNSTEREO_INVERSION
      The stereo configuration of the atom is inverted during the reaction.
      Since:
      Marvin 3.0
      See Also:
    • RXNSTEREO_RETENTION

      public static final int RXNSTEREO_RETENTION
      The stereo configuration of the atom is retained during the reaction.
      Since:
      Marvin 3.0
      See Also:
    • UNSPECIFIED_AROMATICITY

      public static final int UNSPECIFIED_AROMATICITY
      Atom aromaticity is not specified explicitly.
      Since:
      Marvin 3.3
      See Also:
    • AROMATIC

      public static final int AROMATIC
      Aromatic query atom.
      Since:
      Marvin 3.3
      See Also:
    • ALIPHATIC

      public static final int ALIPHATIC
      Aliphatic query atom.
      Since:
      Marvin 3.3
      See Also:
    • AROMATIC_OR_ALIPHATIC

      public static final int AROMATIC_OR_ALIPHATIC
      Aromatic or aliphatic query atom.
      Since:
      Marvin 3.3
      See Also:
    • ATTACH_NONE

      public static final int ATTACH_NONE
      There is no S-group attachment point setting on this atom.
      Since:
      Marvin 5.11
      See Also:
    • ATTACH1

      public static final int ATTACH1
      S-group attachment point on first site.
      Since:
      Marvin 3.1
      See Also:
    • ATTACH2

      public static final int ATTACH2
      S-group attachment point on second site.
      Since:
      Marvin 3.1
      See Also:
    • ATTACH_BOTH

      public static final int ATTACH_BOTH
      S-group attachment point on first and second site.
      Since:
      Marvin 3.1
      See Also:
    • ATTACH_UNKNOWN

      public static final int ATTACH_UNKNOWN
      S-group attachment point information
      See Also:
    • SMARTS_H_DAYLIGHT_COMP_MODE

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public static final int SMARTS_H_DAYLIGHT_COMP_MODE
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used anymore, will be removed in future releases.
      Option flag to express daylight-type smarts atom parsing of H. ("H" is only considered H atom in this special case: [<isotope>H<charge><map>].
      Since:
      Marvin 3.5
      See Also:
    • SMARTS_H_MARVIN_COMP_MODE

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public static final int SMARTS_H_MARVIN_COMP_MODE
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used anymore, will be removed in future releases.
      Option flag to express marvin-pre-3.5-type smarts atom parsing of H. ("H" is considered H atom when no atom type expression is preceding it in the atom expression.)
      Since:
      Marvin 3.5
      See Also:
    • LDIR_RIGHT

      public static final int LDIR_RIGHT
      Implicit Hydrogen(s) are right to element symbol.
      Since:
      Marvin 4.0, 02/16/2005
      See Also:
    • LDIR_LEFT

      public static final int LDIR_LEFT
      Implicit Hydrogen(s) are left to element symbol.
      Since:
      Marvin 4.0, 02/16/2005
      See Also:
    • LDIR_ABOVE

      public static final int LDIR_ABOVE
      Implicit Hydrogen(s) are above the element symbol.
      Since:
      Marvin 4.0, 02/16/2005
      See Also:
    • LDIR_BELOW

      public static final int LDIR_BELOW
      Implicit Hydrogen(s) are below the element symbol.
      Since:
      Marvin 4.0, 02/16/2005
      See Also:
    • SYM_SQBRACKETS

      public static final int SYM_SQBRACKETS
      Atom symbol is shown in square brackets if this flag is set.
      Since:
      Marvin 4.0, 05/10/2005
      See Also:
    • SYM_IMPLH

      public static final int SYM_IMPLH
      Atom symbol string contains implicit H count is shown flag is set.
      Since:
      Marvin 4.0, 05/10/2005
      See Also:
    • SYM_EXPLH

      public static final int SYM_EXPLH
      Atom symbol string contains explicit H count if this flag is set.
      Since:
      Marvin 4.0, 05/10/2005
      See Also:
    • SYM_NEUTRAL

      public static final int SYM_NEUTRAL
      Atom symbol string does not contain the charge if this flag is set.
      Since:
      Marvin 4.0, 05/10/2005
      See Also:
    • SYM_SMARTS

      public static final int SYM_SMARTS
      Atom symbol string for SMILES export. Forces SMARTS query string. Only meaningful if SYM_SQBRACKETS is also set.
      Since:
      Marvin 4.0, 05/10/2005
      See Also:
    • SYM_MOLEX

      public static final int SYM_MOLEX
      Atom symbol string for Molfile export. SMARTS string with A/a property shown always. Only meaningful if SYM_SQBRACKETS is also set.
      Since:
      Marvin 4.0, 05/10/2005
      See Also:
    • SYM_CX

      public static final int SYM_CX
      Atom symbol string for CxSMILES export. CxSMILES string may contain aromatic boron atom which is written as 'b'. Only meaningful if SYM_SQBRACKETS is also set.
      Since:
      Marvin 5.2.1, 09/03/2009
      See Also:
    • VALENCE_CHECKED

      public static final int VALENCE_CHECKED
      Valence checked if this flag is set.
      See Also:
    • VALENCE_ERROR

      public static final int VALENCE_ERROR
      The atom has valence error if this flag is set.
      See Also:
    • FIX_CHARGE

      public static final int FIX_CHARGE
      Valence checking will replace radicals with charges if this flag is set.
      See Also:
    • SELECTED

      public static final int SELECTED
      The atom is selected if this flag is set.
      See Also:
    • bondCount

      protected transient int bondCount
      Number of bonds.
    • theBonds

      protected transient MolBond[] theBonds
      The bonds.
    • xCoordinate

      protected transient double xCoordinate
      X coordinate.
    • yCoordinate

      protected transient double yCoordinate
      Y coordinate.
    • zCoordinate

      protected transient double zCoordinate
      Z coordinate.
  • Constructor Details

    • MolAtom

      public MolAtom(int zZ, double x, double y, double z)
      Construct an atom. Given atomic number is not checked for speed consideration. Use checkAtno(int) to check whether the atomic number is valid.
      Parameters:
      zZ - the atomic number
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      See Also:
    • MolAtom

      public MolAtom(double x, double y)
      Construct a carbon atom at the specified location.
      Parameters:
      x - the x coordinate
      y - the y coordinate
    • MolAtom

      public MolAtom(int z)
      Construct an atom of the specified type at the origin. Given atomic number is not checked for speed consideration. Use checkAtno(int) to check whether the atomic number is valid.
      Parameters:
      z - the atomic number
      See Also:
  • Method Details

    • getParent

      public final MoleculeGraph getParent()
      Return the molecule graph that contains this atom.
      Returns:
      the parent graph
    • indexOf

      public int indexOf(MolBond bond)
      Returns the index of the specified bond in this atom. This method uses MolBond.equals() for the bond comparison.
      Parameters:
      bond - bond reference
      Returns:
      the bond index
      See Also:
    • indexOfReferenced

      protected final int indexOfReferenced(MolBond bond)
      Returns the index of the referenced bond in this atom. This method uses == for the bond comparison!
      Returns:
      the index of the referenced bond in this atom
    • getLigands

      public final MolAtom[] getLigands()
      Returns the atoms connected to this atom by a bond.
      Returns:
      the array of connected (ligand) atoms
      Since:
      Marvin 5.3.3
      See Also:
    • getLigand

      public final MolAtom getLigand(int i)
      Gets the i-th ligand of this atom.
      Parameters:
      i - bond index
      Returns:
      the atom at the other end of the bond
      Since:
      Marvin 2.6
    • getLigandIndex

      public final int getLigandIndex(MolAtom atom)
      Returns the index of the specified ligand in this atom.
      Parameters:
      atom - the other atom
      Returns:
      the connecting ligand index or -1 if not connected.
      Since:
      Marvin 4.0 12/22/2004
      See Also:
    • getBondTo

      public final MolBond getBondTo(MolAtom other)
      Finds the bond that connects this atom to another atom.
      Parameters:
      other - the other atom
      Returns:
      the connecting bond or null
      Since:
      Marvin 5.3, 04/30/2009
      See Also:
    • isBoundTo

      public final boolean isBoundTo(MolAtom other)
      Checks if this MolAtom is connected to another one or not.
      Parameters:
      other - the other atom
      Returns:
      true if the two atomss are connected with a bond, false otherwise
      See Also:
    • sringsize

      public final int sringsize()
      Calculate the size of smallest ring containing this atom. Coordinative bonds are used in ring traversal but Hydrogen bonds are not.
      Returns:
      the smallest ring size or Integer.MAX_VALUE if this atom is not in ring
    • getLock

      protected final Object getLock()
      Get lock object for synchronization.
      Returns:
      reference to the top parent graph
    • setAtom1

      protected static void setAtom1(MolBond bond, MolAtom newAtom)
      Sets the first atom of a bond. Used from derived classes.
    • setAtom2

      protected static void setAtom2(MolBond bond, MolAtom newAtom)
      Sets the second atom of a bond. Used from derived classes.
    • haveSimilarBonds

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public boolean haveSimilarBonds(MolAtom a)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Deprecated for removal, no replacement.
      Checks if two atoms have similar bonds. Two atoms have similar bonds if for each bond bi of the first atom, there is a corresponding bond bj of the other atom with "equal properties".
      Returns:
      true if they have similar bonds, false otherwise
      Since:
      Marvin 5.3, 04/30/2009
    • getBondCount

      public final int getBondCount()
      Gets the number of bonds/ligands.
      Returns:
      the number of bonds
      Since:
      Marvin 3.0
    • getBond

      public final MolBond getBond(int i)
      Gets the i-th bond.
      Parameters:
      i - bond index
      Returns:
      the bond object
      Since:
      Marvin 3.0
    • getRealBondCount

      public final int getRealBondCount()
      Gets the number of bonds connected to "real" atoms. An LP node is not a real atom.
      Returns:
      the number of bonds
      Since:
      Marvin 3.5
    • set

      public void set(MolAtom atom)
      Set all atom properties except the coordinates.
      Parameters:
      atom - the source atom
      Since:
      Marvin 4.1, 01/01/2006
    • getX

      public double getX()
      Gets the X coordinate.
      Returns:
      the x coordinate in Angstroms
    • setX

      public void setX(double x)
      Sets the X coordinate.
      Parameters:
      x - the x coordinate in Angstroms
    • getY

      public double getY()
      Gets the Y coordinate.
      Returns:
      the y coordinate in Angstroms
    • setY

      public void setY(double y)
      Sets the Y coordinate.
      Parameters:
      y - the y coordinate in Angstroms
    • getZ

      public double getZ()
      Gets the Z coordinate.
      Returns:
      the z coordinate in Angstroms
    • setZ

      public void setZ(double z)
      Sets the Z coordinate.
      Parameters:
      z - the z coordinate in Angstroms
    • setXY

      public void setXY(double x, double y)
      Sets the x and y coordinates.
      Parameters:
      x - the x coordinate in Angstroms
      y - the y coordinate in Angstroms
    • setXYZ

      public void setXYZ(double x, double y, double z)
      Sets the coordinates.
      Parameters:
      x - the x coordinate in Angstroms
      y - the y coordinate in Angstroms
      z - the z coordinate in Angstroms
    • getLocation

      public final Point3D getLocation()
      Gets the coordinates.
      Returns:
      the location
    • getLocation

      public final void getLocation(Point3D p)
      Gets the coordinates.
      Parameters:
      p - object that will store the location
    • setLocation

      public void setLocation(Point3D p)
      Sets the coordinates.
      Parameters:
      p - the location
    • transform

      public void transform(Transform3D t, boolean incg)
      Apply a transformation matrix to the coordinates.
      Parameters:
      t - the transformation matrix
      incg - graph invariants are changed (true) or not (false)
      Since:
      Marvin 4.0.2, 10/26/2005
    • getSymbol

      public String getSymbol()
      Gets the element symbol. The symbol is the same as the MDL codename for special atom types: "L" for LIST and NOTLIST. For pseudo atoms, the atom alias string is returned in TeX-like format for subscripts and superscripts.
      Returns:
      the symbol
    • getAtno

      public final int getAtno()
      Gets the atomic number.
      Returns:
      the atomic number
    • setAtno

      public void setAtno(int z)
      Sets the atomic number. Given atomic number is not checked for speed consideration. Use checkAtno(int) to check whether the atomic number is valid.
      Parameters:
      z - the atomic number
      See Also:
    • checkAtno

      public static boolean checkAtno(int z)
      Check if the given atomic number is positive and less then atomic type maximum value.
      Parameters:
      z - atomic number
      Returns:
      true if the given number is valid.
      See Also:
    • getMassno

      public int getMassno()
      Gets the mass number. In the case of an element it returns 0, because it is a mix of isotopes having different mass numbers.
      Returns:
      the mass number, or zero if not specified
    • setMassno

      public void setMassno(int a)
      Sets the mass number.
      Parameters:
      a - the mass number or zero
    • setForSpecIsotopeSymbol

      @Deprecated public void setForSpecIsotopeSymbol(String sym)
      Deprecated.
      as of Marvin 6.3. use setSpecIsotopeSymbolPreferred(boolean) and setMassno(int) instead.
      Sets the special atom symbol and the atomic weight for deuterium or tricium. No operation for other element types.
      Parameters:
      sym - the atom symbol
      Since:
      Marvin 4.1, 11/05/2005
    • getMass

      public double getMass()
      Gets the atomic weight.
      Returns:
      the atomic weight
    • isMappable

      public boolean isMappable()
      Checks if this atom it a mappable. Since Marvin 5.0 all atoms except Lone Electron Pairs are mappeble.
      Returns:
      true if map index can be assigned to the atom false if atom is a lone pair
      Since:
      Marvin 3.4, 06/23/2004
    • getRelativeNegativity

      public int getRelativeNegativity()
      Check negativity compared to the neighbors.
      Returns:
      -1 if the atom is more electronegative than its neighbors, 1 if the neighbors are more electronegative, 0 if it has negative and positive neighbors also or or the neighbors have the same e.n. as the atom
    • setIsValenceCheckNeeded

      protected void setIsValenceCheckNeeded(boolean isValenceCheckNeeded)
      Sets the boolean value if isValenceCheckNeeded.
      Since:
      6.0.1.
    • getImplicitHCount

      public int getImplicitHCount(boolean runVCIfNeeded)
      Gets the implicit Hydrogen count of the atom. If there has been some valence changing modification since the latest valence check call then with calling the method with true parameter it will perform valence checking on this atom.
      Returns:
      the implicit hydrogen count or the number of query hydrogens
      Since:
      Marvin 6.0.1. 2013.06.12.
    • getImplicitHcount

      public int getImplicitHcount()
      Gets the number of implicit hydrogens attached. This information may not be accurate if some manipulation has been made on the molecule. In this case, use valenceCheck() before this method or call getImplicitHCount(boolean) instead. The result is always a non-negative number.
      Returns:
      the implicit hydrogen count or the number of query hydrogens
      See Also:
    • setImplicitHcount

      public void setImplicitHcount(int h)
      Sets the number of implicit hydrogens. Also removes the "H" query property.
      Parameters:
      h - the number of implicit hydrogens
      Throws:
      IllegalArgumentException - negative h value specified
    • getNonQueryImplicitHcount

      public int getNonQueryImplicitHcount()
      Gets the number of implicit hydrogens attached.
      Returns:
      the implicit hydrogen count, not including the query H count.
    • setNonQueryImplicitHcount

      public void setNonQueryImplicitHcount(int h)
      Sets the number of non-query implicit hydrogens attached.
      Parameters:
      h - the implicit hydrogen count, not including the query H count.
      Since:
      Marvin 3.5.9, 07/12/2005
    • getCharge

      public int getCharge()
      Returns the formal charge of the atom.
      Returns:
      the formal charge as a signed integer, the default value is zero
    • hasCharge

      public boolean hasCharge()
      Returns true if this atom has a non-zero formal charge.
      Returns:
      true if the atom has non-zero charge
    • setCharge

      public void setCharge(int q)
      Sets the charge. This function does not call valence checking to set implicit Hydrogen count due to charge change.
      Parameters:
      q - the charge
    • getColumn

      public static int getColumn(int z)
      The column or group of an element in the periodic table.
      Parameters:
      z - atomic number (protons)
      Returns:
      column of the given atom (0 for unknown)
      Since:
      Marvin 4.1
    • getRadicalValue

      public Radical getRadicalValue()
      Gets the radical value of the atom.
      Returns:
      the enum value of the radical
      See Also:
    • setRadicalValue

      public void setRadicalValue(Radical radical)
      Sets the radical value of the atom.
      Parameters:
      radical - the new radical value
      Since:
      Marvin 6.2. 2013/11/07
      See Also:
    • getRadicalCount

      public int getRadicalCount()
      Gets the number of free electrons.
      Returns:
      the number of free electrons
      Since:
      Marvin 3.0
      See Also:
    • getRow

      public static int getRow(int z)
      The row or or period of an element in the periodic table.
      Parameters:
      z - atomic number (protons)
      Returns:
      column of the atom (0 for unknown types)
      Since:
      Marvin 4.1
    • getValencePropMinMax

      public int[] getValencePropMinMax()
      Gets the minimum and maximum possible values of the valence property.
      Returns:
      two-element array containing the minimum and maximum values
      Since:
      Marvin 4.1, 03/23/2006
    • getValenceProp

      public int getValenceProp()
      Gets the valence property.
      Returns:
      the valence or -1 if not set
      Since:
      Marvin 3.5, 09/04/2004
    • setValenceProp

      public void setValenceProp(int v)
      Sets the valence property.
      Parameters:
      v - the valence or -1 to unset
      Since:
      Marvin 3.5, 09/04/2004
    • incValenceProp

      public int incValenceProp()
      Increments the value of the valence property.
      Returns:
      the new value
      Since:
      Marvin 4.1, 03/23/2006
    • decValenceProp

      public int decValenceProp()
      Decrements the value of the valence property.
      Returns:
      the new value
      Since:
      Marvin 4.1, 03/23/2006
    • getValence

      public int getValence()
      Gets the valence. If valence is set as a property, returns that. Otherwise the valence is the sum of bond orders plus the number of implicit hydrogens or query hydrogen atoms.
      Returns:
      the valence
    • getExplicitHcount

      public int getExplicitHcount()
      Gets number of hydrogen connections.
      Returns:
      the number of H connections
    • hasQProps

      public boolean hasQProps()
      Returns true if this atom has query properties.
      Returns:
      true if it has query properties, false otherwise
      See Also:
    • getQProp

      public Object getQProp(String name)
      Gets a query property.
      • "H": number of hydrogen substituents
      • "h": number of implicit hydrogen substituents
      • "X": number of connections (including hydrogens)
      • "D": number of non-hydrogen substituents (H isotopes are included) - identical to "s" except for "s*"
      • "s": number of non-hydrogen substituents (H isotopes are included): -1 = off, -2 = s*, 0 = s0, 1 = s1, etc.
      • "R": number of rings - [R] (ring atom) is represented by value 256
      • "r": smallest ring size - [r] (ring atom) is represented by value 256
      • "rb": ring bond count: -1 = off, -2 = rb*, 0 = rb0, 1 = rb1, etc.
      • "a": deprecated, use getQueryAromaticity() instead
      • "u": unsaturated atom: 1 = on
      • "c": component number
      For more information about these properties, see The JChem Query Guide
      Parameters:
      name - the property name
      Returns:
      the value of the property or null if not set
    • getQPropAsInt

      public int getQPropAsInt(String name)
      Gets a query property as an integer.
      • "H": number of hydrogen substituents
      • "h": number of implicit hydrogen substituents
      • "X": number of connections (including hydrogens)
      • "D": number of non-hydrogen substituents (H isotopes are included) - identical to "s" except for "s*"
      • "s": number of non-hydrogen substituents (H isotopes are included): -1 = off, -2 = s*, 0 = s0, 1 = s1, etc.
      • "R": number of rings - [R] (ring atom) is represented by value 256
      • "r": smallest ring size - [r] (ring atom) is represented by value 256
      • "rb": ring bond count: -1 = off, -2 = rb*, 0 = rb0, 1 = rb1, etc.
      • "a": deprecated, use getQueryAromaticity() instead
      • "u": unsaturated atom: 1 = on
      • "c": component number
      For more information about these properties, see The JChem Query Guide
      Parameters:
      name - the property name
      Returns:
      the value of the property or -1 if not set
      See Also:
    • getQPropMinMax

      public int[] getQPropMinMax(String name)
      Gets the minimum and maximum possible values of a query property.
      Parameters:
      name - the query property abbreviation
      Returns:
      two-element array containing the minimum and the maximum value
      Since:
      Marvin 4.1, 03/22/2006
    • incQProp

      public int incQProp(String name)
      Increments the value of a query property.
      Parameters:
      name - the query property abbreviation
      Returns:
      the new value
      Since:
      Marvin 4.1, 03/22/2006
    • decQProp

      public int decQProp(String name)
      Decrements the value of a query property.
      Parameters:
      name - the query property abbreviation
      Returns:
      the new value
      Since:
      Marvin 4.1, 03/22/2006
    • setQProp

      public void setQProp(String name, Object v)
      Sets a query property.
      • "H": number of hydrogen substituents
      • "h": number of implicit hydrogen substituents
      • "X": number of connections (including hydrogens)
      • "D": number of non-hydrogen substituents (H isotopes are included) - identical to "s" except for "s*"
      • "s": number of non-hydrogen substituents (H isotopes are included): -1 = off, -2 = s*, 0 = s0, 1 = s1, etc.
      • "R": number of rings - [R] (ring atom) is represented by value 256
      • "r": smallest ring size - [r] (ring atom) is represented by value 256
      • "rb": ring bond count: -1 = off, -2 = rb*, 0 = rb0, 1 = rb1, etc.
      • "a": deprecated, use getQueryAromaticity() instead
      • "u": unsaturated atom: 1 = on
      • "c": component number
      For more information about these properties, see The JChem Query Guide
      Parameters:
      name - the property name
      v - the value
      See Also:
    • setQProp

      public void setQProp(String name, int v)
      Sets a query property as an integer.
      • "H": number of hydrogen substituents
      • "h": number of implicit hydrogen substituents
      • "X": number of connections (including hydrogens)
      • "D": number of non-hydrogen substituents (H isotopes are included) - identical to "s" except for "s*"
      • "s": number of non-hydrogen substituents (H isotopes are included): -1 = off, -2 = s*, 0 = s0, 1 = s1, etc.
      • "R": number of rings - [R] (ring atom) is represented by value 256
      • "r": smallest ring size - [r] (ring atom) is represented by value 256
      • "rb": ring bond count: -1 = off, -2 = rb*, 0 = rb0, 1 = rb1, etc.
      • "a": deprecated, use getQueryAromaticity() instead
      • "u": unsaturated atom: 1 = on
      • "c": component number
      For more information about these properties, see The JChem Query Guide
      Parameters:
      name - the property name
      v - the value or -1
    • clearQProps

      public void clearQProps()
      Clears query props.
      Since:
      Marvin 3.4
    • getQPropNames

      public String[] getQPropNames()
      Gets the names of query properties with non-null values.
      Since:
      Marvin 4.1, 03/21/2006
    • getQPropNameSet

      public Set<String> getQPropNameSet()
      Gets the names of query properties with non-null values, or null if no query properties are set.
      Since:
      Marvin 4.1, 05/10/2006
    • getQueryAromaticity

      public int getQueryAromaticity()
      Gets the aromatic/aliphatic query property.
      Returns:
      UNSPECIFIED_AROMATICITY, AROMATIC, ALIPHATIC or AROMATIC_OR_ALIPHATIC
      Since:
      Marvin 3.3
    • setQueryAromaticity

      public void setQueryAromaticity(int x)
      Sets the aromatic/aliphatic query property.
      Parameters:
      x - UNSPECIFIED_AROMATICITY, AROMATIC, ALIPHATIC or AROMATIC_OR_ALIPHATIC
      Since:
      Marvin 3.3
    • incQueryAromaticity

      public int incQueryAromaticity()
      Increments the value of the query aromaticity property.
      Returns:
      the new value
      Since:
      Marvin 4.1, 03/23/2006
    • getRgroup

      public int getRgroup()
      Gets the R-group ID.
      Returns:
      R-group number, between 0 and RGROUP_MAX
    • setRgroup

      public void setRgroup(int r)
      Sets the R-group ID.
      Parameters:
      r - R-group number, between 0 and RGROUP_MAX
    • getAttach

      @Deprecated public int getAttach()
      Deprecated.
      as of Marvin 6.0 replaced by SuperatomSgroup.getAttachmentPointOrders(MolAtom).
      If the atom takes place in a Superatom S-group then it's attachment point orders can be reached through the Superatom S-group.
      Gets the S-group attachment point information.
      Returns:
      ATTACH_NONE (not an S-group attachment point), ATTACH1 (first), ATTACH2 (second), ATTACH_BOTH (both), or ATTACH_UNKNOWN if the attachment information can not be specified. This last one basicly happens when the atom takes place in a newly built SuperatomSgroup and has more than two attachment points.
    • getAttachFromExtraAtomProp

      public int getAttachFromExtraAtomProp()
      Gets the attachment information stored in the extra atom properties
      Returns:
      the attachment point information
    • setAttach

      @Deprecated public void setAttach(int a)
      Sets the S-group attachment point information.
      Parameters:
      a - ATTACH_NONE (not an S-group attachment point), ATTACH1 (first), ATTACH2 (second) or ATTACH_BOTH (both)
    • setAttach

      @Deprecated public void setAttach(int newOrder, Sgroup sg)
      Sets the S-group attachment point information for an S-group attachment atom.
      Parameters:
      newOrder - ATTACH_NONE (not an S-group attachment point), ATTACH1 (first), ATTACH2 (second) or ATTACH_BOTH (both)
      sg - the parent S-group or null
      Since:
      Marvin 3.5, 10/11/2004
    • setAttachParentSgroup

      public final void setAttachParentSgroup(Sgroup sgroup)
      Sets the attach parent s-group information to the extra atom properties
    • getAttachParentSgroup

      public Sgroup getAttachParentSgroup()
      Gets the smallest containing sgroup which can have the attachment point information of this atom.
      Returns:
      the parent sgroup or null if the atom is not in an sgroup
      Since:
      Marvin 3.5, 10/11/2004
    • getHybridizationState

      public int getHybridizationState()
      Gets the hybridization state. The hybridization state value is not updated automatically when a molecule is loaded or modified. This ensures that the hybridization state set by setHybridizationState(int) is not overwritten accidentally. \br To calculate and set the hybridization state for this and all other atoms in a moecule call MoleculeGraph.calcHybridization().
      Returns:
      the hybridization state
      See Also:
    • setHybridizationState

      public void setHybridizationState(int h)
      Sets the hybridization state.
      Parameters:
      h - the hybridization state
      See Also:
    • getAtomMap

      public int getAtomMap()
      Gets the atom-atom mapping number.
      Returns:
      the map value (positive integer) or 0
    • setAtomMap

      public void setAtomMap(int map)
      Sets the atom-atom mapping number.
      Parameters:
      map - the map value (positive integer) or 0
      See Also:
    • getSetSeq

      public int getSetSeq()
      Gets the atom set sequence number.
      Returns:
      a number between 0 and SETSEQ_MAX
      See Also:
    • setSetSeq

      public void setSetSeq(int id)
      Sets the atom set sequence number.
      Parameters:
      id - a number between 0 and SETSEQ_MAX
      See Also:
    • setExtraLabelSetSeq

      public void setExtraLabelSetSeq(int id)
    • getExtraLabelSetSeq

      public int getExtraLabelSetSeq()
    • residueTypeOf

      public static int residueTypeOf(String name)
      Gets the residue identifier for a residue name.
      Parameters:
      name - residue name
      Returns:
      the residue type
      Since:
      Marvin 3.1.4
    • residueSymbolOf

      public static String residueSymbolOf(int id)
      Gets the name of a residue.
      Parameters:
      id - the residue identifier
      Returns:
      the residue symbol
      Since:
      Marvin 3.1.4
    • getResidueType

      public int getResidueType()
      Gets the residue type.
      Returns:
      the residue type
      See Also:
    • setResidueType

      public void setResidueType(int t)
      Sets the residue type.
      Parameters:
      t - the residue type
      See Also:
    • getResidueSeq

      public int getResidueSeq()
      Gets the residue sequence number.
      Returns:
      the residue sequence number
      See Also:
    • setResidueSeq

      public void setResidueSeq(int n)
      Sets the residue sequence number.
      Parameters:
      n - the residue sequence number
      See Also:
    • getResidueAtomId

      public int getResidueAtomId()
      Gets the residue atom identifier. Atoms in amino acids and nucleic acids are identified uniquely by the atom symbol and the residue atom identifier.
      Returns:
      the residue atom identifier
      Since:
      Marvin 3.1.3
    • setResidueAtomId

      public void setResidueAtomId(int id)
      Sets the residue atom identifier.
      Parameters:
      id - the residue atom identifier
      Since:
      Marvin 3.1.3
    • getMinRepetitions

      public int getMinRepetitions()
      Gets the minimum number of repetitions for a link node.
      Returns:
      the minimum number of repetitions
      Since:
      Marvin 3.5, 07/22/2004
    • setMinRepetitions

      public void setMinRepetitions(int r)
      Sets the minimum number of repetitions for a link node.
      Parameters:
      r - the minimum number of repetitions
      Since:
      Marvin 3.5, 07/22/2004
    • getMaxRepetitions

      public int getMaxRepetitions()
      Gets the maximum number of repetitions for a link atom.
      Returns:
      the maximum number of repetitions
      Since:
      Marvin 3.5, 07/22/2004
    • setMaxRepetitions

      public void setMaxRepetitions(int r)
      Sets the maximum number of repetitions for a link atom.
      Parameters:
      r - the maximum number of repetitions
      Since:
      Marvin 3.5, 07/22/2004
    • getLinkNodeOuterAtom

      public int getLinkNodeOuterAtom(int idx)
      Gets the index of one of the link node's outer neighbor atoms. (Outer: not repeating.)
      Parameters:
      idx - Which outer atom (0 or 1)
      Returns:
      The specified outer atom index (as used with getLigand()) or -1 if not set.
      Since:
      Marvin 4.0 12/22/2004
      See Also:
    • setLinkNodeOuterAtom

      public void setLinkNodeOuterAtom(int idx, int outer)
      Sets one of the link node's outer neighbor atoms. (Outer: not repeating.)
      Parameters:
      idx - Which outer atom (0 or 1)
      outer - The outer neighbor atom index (as used with getLigand()) or -1 if clearing.
      Since:
      Marvin 4.0 12/22/2004
      See Also:
    • isLinkNode

      public boolean isLinkNode()
      The atom is a link node if the maximum number of repetitions is nonzero.
      Returns:
      if the maximum number of repetitions is nonzero
      Since:
      Marvin 3.5, 07/22/2004
    • bondweights

      public void bondweights(double[] w, Transform3D t)
      Calculates the average of the bond unit vectors pointing out of this atom. The result is not a unit vector.
      Parameters:
      w - 3-element array that will contain the resulting vector
      t - the rotation matrix
    • getAtomSymbol

      public String getAtomSymbol(int opts, int aflags, int[] lcenter, Transform3D preTransform)
      Gets the string representation of the atom symbol.
      Parameters:
      opts - combination of SYM_* flags
      aflags - atom flags
      lcenter - if not null, then its first two element (index 0-1) will be set to the index and the length of the element symbol substring in the returned string, the element at index 2 will be set to +1 if the H label is above, -1 if below the element symbol or 0 otherwise
      preTransform - viewing transformation
      Returns:
      the string representation
      Since:
      Marvin 3.0
      See Also:
    • getQueryLabel

      public String getQueryLabel()
      Gets the string representation of the query atom
      Returns:
      the string representation
      Since:
      Marvin 3.0
    • getPreferredLabelDir

      public int getPreferredLabelDir(Transform3D pretr, int h)
      Gets the preferred direction for an additional label.
      Parameters:
      pretr - viewing transformation
      h - hydrogen count for hydrogen label display, 0 otherwise
      Returns:
      LDIR_RIGHT, LDIR_LEFT, LDIR_ABOVE or LDIR_BELOW
      Since:
      4.0, 02/16/2005
    • isQuery

      public final boolean isQuery()
      Tests whether it is a query atom. (Has a query atom type or query property or query string):
      • link node atom
      • any atom
      • heteroatom
      • list atom
      • not list atom
      • rgroup atom
      • known query properties: H,X,R,r,a,s,u,h,D,c,rb
      For a meaning of the above properties, see The JChem Query Guide
      Returns:
      true if it is a query atom, false otherwise
      See Also:
    • isQProp

      public boolean isQProp()
      For internal use only. Tests whether this object represents a query property.
      Returns:
      true if it is a query property, false otherwise
      Since:
      Marvin 3.0, 11/08/2002
    • isImplicitizableH

      public boolean isImplicitizableH(int f)
      Tests whether the hydrogen atom is implicitizable or not. Only bound (to non-Hydrogen atom and with no H-bond), non-isotope, neutral, non-radical, non-mapped, non-CIS/TRANS important H atoms are implicitizable by default (0 argument). If the argument is nonzero, then the return value can be true for lonely, isotope, charged, radical, mapped or CIS/TRANS Important H atoms also.
      Parameters:
      f - flags specifying special H atom types to include
      Returns:
      true if the hydrogen is implicitizable, false otherwise
      Since:
      Marvin 3.1
      See Also:
    • isPseudo

      public boolean isPseudo()
      Tests whether the atom is a pseudo atom. To create a pseudo atom, set atom number (setAtno(int)) to PSEUDO and set the pseudo atom type string by setAliasstr(String).
      Returns:
      true if the atom is a pseudo atom, false otherwise
      Since:
      Marvin 3.3
      See Also:
    • isRgroup

      public boolean isRgroup()
      Tests whether the atom is an R-group atom. Returns true when getAtno()) returns RGROUP.
      Returns:
      true if the atom is an R-group atom, false otherwise
      See Also:
    • isRgroupAttachment

      public boolean isRgroupAttachment()
      Tests whether the atom is an R-group attachment point. Returns true when getAtno()) returns RGROUP_ATTACHMENT.
      Returns:
      true if the atom is an R-group attachment point, false otherwise
      See Also:
    • isGeneric

      public boolean isGeneric()
      Tests whether the atom is a generic atom. To create a generic atom, set atom number (setAtno(int)) to PSEUDO and set the pseudo atom type string by setAliasstr(String) to one of the following:
      • "AH" : Any atom including H
      • "QH" : Any atom except C
      • "M" : Any metal
      • "MH" : Any metal or H
      • "X" : Any halogen
      • "XH" : Any halogen or H
      .
      Returns:
      true if the atom is a generic atom, false otherwise
      Since:
      Marvin 5.0
      See Also:
    • hasWedgedBond

      public final boolean hasWedgedBond()
      Tests whether the atom has a wedged bond.
      Returns:
      true if it has a wedged bond, false otherwise
      Since:
      4.0
    • hasAromaticBond

      public final boolean hasAromaticBond()
      Tests whether the atom has aromatic bonds.
      Returns:
      true if it has aromatic bonds, false otherwise
    • hasQueryBonds

      public final boolean hasQueryBonds()
      Tests whether the atom has query bonds (e.g. "any" or "single or double" bond).
      Returns:
      true if it has query bonds, false otherwise
    • setQueryString

      public final void setQueryString(String queryString)
      Assigns the query string to this atom.
      Parameters:
      queryString - the query properties string to be assigned.
      See Also:
    • getQueryString

      public String getQueryString()
      Returns the query string assigned to this atom.
      Returns:
      the query string
      See Also:
    • setAliasstr

      public void setAliasstr(String s)
      Sets the alias string or pseudo atom type string for pseudo atoms.
      Parameters:
      s - the alias
      See Also:
    • getAliasstr

      public String getAliasstr()
      Gets the alias string or pseudo atom type string for pseudo atoms.
      Returns:
      the alias
      See Also:
    • setExtraLabel

      public void setExtraLabel(String s)
      Sets the extra atom label (also called atom value): "label" or "label1|label2". In general, any user label can be set by this method.
      Parameters:
      s - the atom label
    • setExtraLabelColor

      public void setExtraLabelColor(long rgbs)
      Sets the extra label color(s): lower 32 bits and upper 32 bits as (alpha<<24 + red<<16 + green<<8 + blue).
      Parameters:
      rgbs - the color(s)
      See Also:
    • setExtraLabelColor

      public void setExtraLabelColor(int rgb1, int rgb2)
      Sets the extra label colors: lower 32 bits and upper 32 bits as (alpha<<24 + red<<16 + green<<8 + blue).
      Parameters:
      rgb1 - the lower 32 bits
      rgb2 - the upper 32 bits
      Since:
      Marvin 5.1.2
      See Also:
    • getExtraLabel

      public String getExtraLabel()
      Gets the label string (also called atom value): "result" or "result1|result2".
      Returns:
      the label
    • getExtraLabelColor

      public long getExtraLabelColor()
      Gets the extra label color(s): lower 32 bits and upper 32 bits as (alpha<<24 + red<<16 + green<<8 + blue).
      Returns:
      the label color(s)
    • getExtraLabelColor

      public int getExtraLabelColor(int i)
      Gets the extra label color: (alpha<<24 + red<<16 + green<<8 + blue).
      Parameters:
      i - is the result index (0 or 1)
      Returns:
      the label color
    • getExtraLabelColor

      public static int getExtraLabelColor(long rgbs, int i)
      Gets extra label color from composed color value.
      Parameters:
      rgbs - the composed color value
      i - is the result index (0 for first color, 1 for second color)
      Returns:
      the label color
      Since:
      Marvin 5.1.2
      See Also:
    • clearExtraLabel

      public void clearExtraLabel()
      Clears the extra label.
    • getList

      public int[] getList()
      Gets the atom list.
      Returns:
      the list
    • setList

      public void setList(int[] l, int n)
      Sets the list elements.
      Parameters:
      l - the list
      n - number of elements to set
    • setList

      public void setList(int[] l)
      Sets the list elements.
      Parameters:
      l - the list
    • getReactionStereo

      public int getReactionStereo()
      Gets the reaction stereo property describing how the stereo configuration of the atom changes during the reaction.
      Returns:
      the reaction stereo property
      See Also:
    • setReactionStereo

      public void setReactionStereo(int r)
      Sets the reaction stereo property describing how the stereo configuration of the atom changes during the reaction.
      Parameters:
      r - the reaction stereo property
      Since:
      Marvin 3.0
      See Also:
    • clear

      public void clear()
      Clear query properties, charge, and hcount.
    • clone

      public MolAtom clone()
      Clones the atom.

      These are not cloned:
      • Bonds: their references do not change.
      • Parent molecule: will be set to null.
      • MDocument: Although the atomset information is cloned, when the cloned atom is taken to another MDocument, the format (color, font type) will be lost.
      Overrides:
      clone in class Object
      Returns:
      the clone
    • toString

      public String toString()
      Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object
      Since:
      3.5.2, 12/16/2004
    • insideLabel

      public boolean insideLabel(double x, double y)
      Tests whether the specified point is inside the atom label.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      Returns:
      true if inside, false if outside
    • numOf

      @Deprecated public static int numOf(String e)
      Deprecated.
      As of Marvin 5.9, replaced by a similar method PeriodicTable.findAtomicNumber(String).
      The recommended method does not work for symbol that does not represent a chemical element (e.g. R-atom, any atom), as this method should not have worked on them either.
      Gets the atomic number of an element.
      Parameters:
      e - the element name
      Returns:
      the atomic number or zero if not found
    • getAtomicNumber

      @Deprecated public static int getAtomicNumber(String element)
      Deprecated.
      As of Marvin 5.9, replaced by a similar method PeriodicTable.findAtomicNumber(String).
      The recommended method does not work for symbol not representing a chemical element (e.g. R-atom, any atom), as this method should not have worked on them either.
      Gets the atomic number of an element.
      Parameters:
      element - the element name
      Returns:
      the atomic number
      Throws:
      IllegalArgumentException - if element does not correspond to a chemical element.
    • symbolOf

      public static String symbolOf(int z)
      Gets the element symbol for the specified atomic number. The symbol is the same as the MDL codename for special atom types: "L" for LIST and NOTLIST.
      Parameters:
      z - the atomic number
      Returns:
      the symbol
    • symbolOf

      public static String symbolOf(int z, int a)
      Gets the special element symbol for the specified atomic and mass numbers. For Hydrogen, it can return "D" or "T" for the isotopes. Otherwise, the symbol is the same as the MDL codename for special atom types: "L" for LIST and NOTLIST.
      Parameters:
      z - the atomic number
      a - the mass number
      Returns:
      the symbol
      Since:
      Marvin 5.0, 10/12/2007
    • nameOf

      public static String nameOf(int z)
      Gets the name of the specified element.
      Parameters:
      z - the atomic number
      Returns:
      the name
    • electronegOf

      public static int electronegOf(int z)
      Gets 10 times the electronegativity value for the specified element.
      Parameters:
      z - the atomic number
      Returns:
      the electronegativity
    • numoxstatesOf

      public static int numoxstatesOf(int z)
      Gets the number of oxidation states for the specified element.
      Parameters:
      z - the atomic number
      Returns:
      the number of states
    • oxstateOf

      public static int oxstateOf(int z, int k)
      Gets the oxidation states.
      Parameters:
      z - the atomic number
      k - the oxidation state index
      Returns:
      the oxidation state
    • maxAbsOxStateOf

      public static int maxAbsOxStateOf(int z)
      Gets the oxidation state that has the maximum absolute value
      Parameters:
      z - the atomic number
      Returns:
      absolute value of the oxidation state
      Since:
      Marvin 4.1
    • negOxOf

      public static int negOxOf(int z)
      Gets the negative oxidation number.
      Parameters:
      z - the atomic number
      Returns:
      the negative oxidation number
      Since:
      Marvin 2.7
    • posOxOf

      public static int posOxOf(int z)
      Gets the smallest positive oxidation number.
      Parameters:
      z - the atomic number
      Returns:
      the smallest positive oxidation number
      Since:
      Marvin 2.7
    • ionChargeOf

      public static int ionChargeOf(int z)
      Gets the ion charge.
      Parameters:
      z - the atomic number
      Returns:
      the charge
      Since:
      Marvin 2.7
    • covalentRadiusOf

      public static double covalentRadiusOf(int z, int t)
      Gets the covalent radius in C-C bond length units.
      Parameters:
      z - the atomic number
      t - the bond type (1, 2, 3)
      Returns:
      the covalent radius
      Since:
      Marvin 2.7
    • naturalWeightOf

      public static double naturalWeightOf(int z)
      Gets the natural weight of the element. WARNING: This method does not return the exact value.
      Parameters:
      z - the atomic number
      Returns:
      the weight
    • isotopeType

      public static int isotopeType(int z, int a)
      Gets the type of an isotope.
      Parameters:
      z - atomic number
      a - mass number
      Returns:
      0 if nonexistent, 1 if non-naturally occurring, 2 if naturally occurring
    • twicesumbonds

      public int twicesumbonds(boolean countH, boolean all2)
      Calculates the total number of bonding electrons, excluding implicit hydrogens. The number of electrons is 2 for single bond, 4 for double and 6 for triple. For other bond types, the following values are used: 3 for AROMATIC in most cases. 2 for AROMATIC for the following atoms:
      • N, P and C- with 3 aromatic bonds
      • N, P, C+ and C- with 2 aromatic bonds and an implicit H
      • O, S ,Se ,Te with 2 aromatic bonds
      2 for ANY and SINGLE_OR_AROMATIC, 3 for SINGLE_OR_DOUBLE, 4 for DOUBLE_OR_AROMATIC.
      Parameters:
      countH - bonds to explicit hydrogen atoms are counted if true, not counted if false
      all2 - use the value 2 for each bond (independently of type) if true
      Returns:
      the sum of bond values
    • qpropCheck

      public void qpropCheck()
      Query property checking.
    • valenceCheck

      public void valenceCheck()
      Valence checking. During this check implicit hydrogens are calculated and the valence error flag is set in case of error. If in parent molecule the valence check is disabled than the check is not performed. The same applies if valence check is disabled for aromatic Nitrogen-like atoms and this atom is this kind of atom.
      See Also:
    • setCorners

      public void setCorners(double xnw, double ynw, double xse, double yse)
      Used internally by MolPainter.
      Parameters:
      xnw - north-west corner x
      ynw - north-west corner y
      xse - south-east corner x
      yse - south-east corner y
    • moveCorners

      public void moveCorners(double diffx, double diffy)
      Translates the coordinates of the atom label.
      Parameters:
      diffx - translates the x values of the corners by this value.
      diffy - translates the y values of the corners by this value.
    • getFlags

      public int getFlags()
      Gets flags. Flags contain the parity (3 bits), chirality (R/S, 2 bits), atomStereo (2 bits), hybridization state (3 bits), radical (4 bit), valenceChecked (1 bit), valenceError (1 bit), explicitCharge (1 bit), selected (1 bit) and atom map (10 bits) fields.
      Returns:
      the flags
      See Also:
    • setFlags

      public void setFlags(int f)
      Sets the flags.
      Parameters:
      f - new flags
    • setFlags

      public void setFlags(int f, int mask)
      Sets the flags.
      Parameters:
      f - new flags
      mask - bits to set in flags
    • isSelected

      public boolean isSelected()
      Tests whether this atom is selected.
      Returns:
      true if selected, false otherwise
      Since:
      Marvin 2.9.12
    • setSelected

      public void setSelected(boolean sel)
      Selects or unselects this atom.
      Parameters:
      sel - true to select, false to unselect
      Since:
      Marvin 2.9.12
    • hasValenceError

      public boolean hasValenceError()
      Returns previously set valence error. Valence error can be detected by valenceCheck() method.
      Returns:
      true in case of error, false otherwise
      Since:
      Marvin 2.9.12
      See Also:
    • setValenceError

      public void setValenceError(boolean v)
      Sets or clears the valence error flag.
      Parameters:
      v - true to set, false to unset
      Since:
      Marvin 2.9.12
    • getStereoCare

      public boolean getStereoCare()
      Reports double bond stereo care information on the connected bonds.
      Returns:
      True if there is -at least- one bond with stereo care box on, false else.
      See Also:
    • getStereoGroupType

      public int getStereoGroupType()
      Gets the stereochemical group type for the enhanced stereo representation. (Type is one of NONE, ABS, OR, AND.)
      Returns:
      the stereochemical group type for the enhanced stereo representation.
      Since:
      Marvin 3.1.4
      See Also:
    • setStereoGroupType

      public void setStereoGroupType(int t)
      Sets the stereochemical group type for enhanced stereo representation.
      Parameters:
      t - the stereochemical group type
      Since:
      Marvin 3.1.4
      See Also:
    • getStereoGroupNumber

      public int getStereoGroupNumber()
      Gets the stereochemical group number for AND and OR groups of the enhanced stereo representation.
      Returns:
      the stereochemical group number (positive integer)
      Since:
      Marvin 3.1.4
      See Also:
    • setStereoGroupNumber

      public void setStereoGroupNumber(int n)
      Sets the stereochemical group number for AND and OR groups of the enhanced stereo representation.
      Parameters:
      n - the stereochemical group number (positive integer)
      Since:
      Marvin 3.1.4
      See Also:
    • isSpecIsotopeSymbolUsed

      public boolean isSpecIsotopeSymbolUsed()
      Tests whether special symbol is used. The special symbols are D and T for Hydrogen isotopes.
      Returns:
      true if special symbol is used, false otherwise
      Since:
      Marvin 4.1, 11/05/2005
    • isSpecIsotopeSymbolPreferred

      public boolean isSpecIsotopeSymbolPreferred()
      Tests whether special symbol is used. The special symbols are D and T for Hydrogen isotopes.
      Returns:
      true if special symbol is used, false otherwise
      Since:
      Marvin 4.1, 11/05/2005
    • setSpecIsotopeSymbolPreferred

      public void setSpecIsotopeSymbolPreferred(boolean v)
      Sets special isotope symbol usage preference. The special symbols are D and T for Hydrogen isotopes.
      Parameters:
      v - true if special symbol is used, false otherwise
      Since:
      Marvin 4.1, 11/05/2005
    • add

      protected boolean add(MolBond b)
      Add a bond if it had not been already added. Also runs valence checking if charge and implicit hydogens were previously set this way.
      Parameters:
      b - the bond to add
      Returns:
      true if valence check needed
    • pack

      public void pack()
      Reduce memory usage.
    • removeAllBonds

      protected void removeAllBonds()
      Removes all bonds.
    • removeAllBonds

      protected void removeAllBonds(boolean clearFromAttachmentPoints)
      Removes all bonds.
    • removeBond

      protected void removeBond(MolBond bond)
      Removes a bond by reference.
      Parameters:
      bond - bond reference to remove
    • removeBond

      protected void removeBond(MolBond bond, boolean clearFromAttachmentPoints)
      Removes a bond by reference.
      Parameters:
      bond - bond reference to remove
    • removeBond

      protected void removeBond(int i)
      Removes a bond. Also runs valence checking if charge and implicit hydogens were previously set this way.
      Parameters:
      i - bond index
    • removeBond

      protected void removeBond(int i, boolean clearFromAttachmentPoints)
      Removes a bond. Also runs valence checking if charge and implicit hydogens were previously set this way.
      Parameters:
      i - bond index
    • paritySign

      public static int paritySign(int a, int b, int c, int d)
      Calculates the sign of the parity for the specified indexes.
      Parameters:
      a - first atom index
      b - second atom index
      c - third atom index
      d - fourth atom index
      Returns:
      +1, -1, or 0 (if two or more indexes equal)
    • isSameParityClass

      public static boolean isSameParityClass(int i1, int i2, int i3, int i4, int j1, int j2, int j3, int j4)
      Calculates if chirality centers in the structure and the query belong to the same parity class. i1, ..., i4 are indexes of neighbors in the structure. j1, ..., j4 are indexes of corresponding neighbors in the query. In the case of explicit H the index has to be set to Integer.MAX_VALUE. In the case of implicit H i4 (or j4) has to be set to Integer.MAX_VALUE.
      See Also:
    • isTerminalAtom

      public boolean isTerminalAtom()
      Determines whether it is a terminal atom or not.
      Returns:
      True if terminal atom, else false.
      Since:
      Marvin 3.4
    • haveEqualProperties

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2026) public boolean haveEqualProperties(MolAtom a)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Deprecated for removal, no replacement.
      Tests if two atoms have the same properties. Atom coordinates, the "selected" property and the number of implicit hydrogens are not taken into account.
      Returns:
      true if they have the same properties, false otherwise
      Since:
      Marvin 3.4.1, 07/06/2004
    • countAllAtoms

      protected int countAllAtoms()
      Counts all atoms represented by this atom.
      Returns:
      1
      Since:
      Marvin 3.0
    • getLonePairCount

      public int getLonePairCount()
      Returns the automatically calculated lone pair count of this atom.
      Returns:
      the number of the calculated lone pairs if the atom is part of a MoleculeGaph -1 otherwise
      Since:
      Marvin 5.1.5
    • getElectronProp

      public int getElectronProp()
      Returns the number of lone pairs on this atom.
      Returns:
      the number of lone pairs
      • a value between 0 and 4: this has the meaning that the atom has this number of lone pairs. For example: after calling setElectronProperty(3), 3 lone pairs will belong to the atom.
      • The number of lone pairs is not set when the returned value is less then 0.
    • setElectronProp

      public void setElectronProp(int eProp)
      Sets the number of lone pairs.
      Parameters:
      eProp - the number of lone pairs
    • storeTemporaryObject

      public void storeTemporaryObject(String key, Object val)
      Stores an object temporarily. The stored object is not cloned and not serialized. This method may be used to store lone pair coordinates when drawing them. Then the electron flow arrow can start from a stored point.
      Parameters:
      key - key to the object
      val - the object
      Since:
      Marvin 5.3, 09/13/2009
    • getTemporaryObject

      public Object getTemporaryObject(String key)
      Gets a temporary object.
      Parameters:
      key - key to the object
      Returns:
      the object
      Since:
      Marvin 5.3, 09/13/2009
    • setLinkNodeDefaultOuters

      public void setLinkNodeDefaultOuters()
      Sets link node outer atoms to default values, if they are not set yet. Does not check if it is a valid link node configuration.
      Since:
      Marvin 4.0 12/27/2004
      See Also:
    • isAmbiguousStereo

      public boolean isAmbiguousStereo()
      Check if the atom has ambiguous stereo wedge configuration. If the molecule is 2D and the atom has one hashed or bold bond (starting from this atom, indicating one configuration) and one squiggly bond (starting also from this atom, indicating two configuration) than the atom has ambiguous stereo configuration. Or if the molecule is 2D and the atom parity cannot be determined from the given wedges. Or if the molecule is in 3D but the atom has wedge or hash neighbors.
      Returns:
      true if the atom stereo configuration is ambiguous, else false.
      Since:
      Marvin 4.1 01/06/2006
      See Also:
    • isAromaticSMILESSubset

      public static boolean isAromaticSMILESSubset(int atno)
      Is the atom can be aromatic according to the daylight specification: Only atoms on the following list can be considered aromatic: C, N, O, P, S, As, Se, and * (wildcard).
      Parameters:
      atno - atomic number
      Returns:
      true if the atom is the member of the aromatic subset.
      Since:
      Marvin 5.2 11/06/2008
    • propertySet

      public Set<Map.Entry<String,Object>> propertySet()
      Returns a collection view of the properties (property key - property value mappings) of this atom. Each element in the returned collection is a Map.Entry. Changes to the properties are reflected in the collection, and vice-versa. The collection supports element removal, which removes the corresponding property from this, via the Iterator.remove, Collection.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.
      Returns:
      a collection view of the properties of this atom.
      Since:
      Marvin 5.4
    • propertyKeySet

      public Set<String> propertyKeySet()
      Returns a set view of the property keys of this atom. Changes to the properties of this atom are reflected in the set, and vice-versa. The set supports element removal, which removes the corresponding property from this atom, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.
      Returns:
      set view of the property keys of this atom.
      Since:
      Marvin 5.4
    • containsPropertyKey

      public boolean containsPropertyKey(String key)
      Returns true if this atom has a mapping for the specified property key.
      Parameters:
      key - the property key which is to be searched for.
      Returns:
      true if this map contains a mapping for the specified property key.
      Since:
      Marvin 5.4
    • removeProperty

      public Object removeProperty(String key)
      Removes the mapping for this property key from this atom if present.
      Parameters:
      key - property key whose mapping is to be removed from the atom.
      Returns:
      previous property value associated with specified property key, or null if there was no mapping for property key. A null return can also indicate that the property mapping previously associated null with the specified property key.
      Since:
      Marvin 5.4
    • propertyCount

      public int propertyCount()
      Returns the number of property (property key - property value) mappings of this atom.
      Returns:
      the number of property mappings of this atom.
      Since:
      Marvin 5.4
    • getProperty

      public Object getProperty(String key)
      Returns the property value to which the specified property key is mapped at this atom, or null if this atom has no mapping for this property key. A return value of null does not necessarily indicate that the atom has no mapping for the property key; it is also possible that the atom explicitly maps the property key to null. The containsKey method may be used to distinguish these two cases.
      Parameters:
      key - the property key whose associated property value is to be returned.
      Returns:
      the property value to which this atom maps the specified property key, or null if the atom has no mapping for this property key.
      Since:
      Marvin 5.4
    • putProperty

      public void putProperty(String key, Object value)
      Associates the specified value with the specified key at this atom. If this atom previously had a mapping for this property key, the old property value is replaced.
      Parameters:
      key - property key with which the specified value is to be associated
      value - property value to be associated with the specified property key.
      Since:
      Marvin 5.4
    • clearProperties

      public void clearProperties()
      Removes all properties from this atom.
      Since:
      Marvin 5.4
    • getTag

      public String getTag()
      Gets the tag of the atom. It is an arbitrary string label that is attached to the atom until explicitly removed (set to null) or changed. It is null by default when an atom is created.

      Molecule import and export can use these tags to identify atoms, but other operations might not ensure that atom tags remain unique within a molecule structure.

      Returns:
      the tag (can be null)
    • setTag

      public void setTag(String tag)
      Sets the tag of the atom. It is an arbitrary string label that is attached to the atom until explicitly removed (set to null) or changed.
      Parameters:
      tag - the tag (label) to set, can be null
    • setRgroupAttachmentPointOrder

      public void setRgroupAttachmentPointOrder(int order)
      Sets the attachment point order of an R-group attachment point.
      Parameters:
      order - the attachment point order to set
      Since:
      Marvin 5.4
      See Also:
    • getRgroupAttachmentPointOrder

      public int getRgroupAttachmentPointOrder()
      Gets the attachment point order of an R-group attachment point.
      Returns:
      the attachment point order
      Since:
      Marvin 5.4
      See Also:
    • addRgroupAttachmentPoint

      public MolAtom addRgroupAttachmentPoint(int order, int bondtype)
      Attaches a new R-group attachment point to this atom by a bond of a specified type. The new R-group attachment point and the new bond are added to the parent molecule of this atom. The atom must have a parent.
      Parameters:
      order - the order of the R-group attachment point, order should be greater than 0.
      bondtype - the type of the new bond to add
      Returns:
      the added R-group attachment point or null if the atom has no parent.
      Since:
      Marvin 5.4
      See Also:
    • insertBond

      protected void insertBond(int i, MolBond bond)
      Inserts a bond at a specified index.
      Parameters:
      i - the index where to insert the bond
      bond - the bond reference to insert
      Since:
      Marvin 5.4, 08/21/2010
    • getLigandOrder

      public int getLigandOrder(MolAtom ligand)
      Gets the order of a specified ligand.
      Parameters:
      ligand - the ligand
      Returns:
      the order of the ligand
      Since:
      Marvin 5.4, 08/21/2010
    • setLigandOrder

      public boolean setLigandOrder(int order, MolAtom ligand)
      Sets the order of a specified ligand.
      Parameters:
      order - the order to set, order should be greater than 0.
      ligand - the ligand to set the order on
      Returns:
      true if the order is successfully set, false otherwise when the ligand is not an existing ligand of this atom or the order is bigger than the number of ligands.
      Since:
      Marvin 5.4, 08/21/2010
    • getBicycloStereo

      public BicycloStereoDescriptor[] getBicycloStereo()
      Gets the previously stored bicyclo stereo information of this atom.
      Returns:
      the array of bicyclo stereo descriptors. Returns null if this atom has no stereo descriptor.
      Since:
      Marvin 5.5, 03/23/2011
    • setBicycloStereo

      public void setBicycloStereo(BicycloStereoDescriptor[] descriptors)
      Registers the bicyclo stereo information for this atom.
      Parameters:
      descriptors - the array of bicyclo stereo descriptors
      Since:
      Marvin 5.5, 03/23/2011
    • getBondArray

      public MolBond[] getBondArray()
      Gets the bonds connected to this atom.
      Returns:
      the array of bonds.
      Since:
      Marvin 6.0.1., 04/29/2013
    • setChargeAngle

      public void setChargeAngle(double angle)
      Sets the charge angle for the atom. This method is to be called when charge position is explicitly specified. Angle is in radian and positive in I-II and negative in III-IV quadrants. It is rounded to the closest multiply of PI/12 (15 degrees).
      Parameters:
      angle - the charge angle to be set, Double.NaN can be used to reset this property
    • getChargeAngle

      public double getChargeAngle()
      Returns the charge angle of the atom or Double.NaN if it is not specified explicitly.
      Returns:
      the charge angle if it is set, Double.NaN otherwise
    • isChargeAngleSet

      public boolean isChargeAngleSet()
      Returns true if the charge angle is specified explicitly for the atom.
      Returns:
      true if the charge angle is set
    • isPlainHydrogen

      public boolean isPlainHydrogen()
      Returns true if the atom is plain Hydrogen (H or 1H).
      Returns:
      true if the atom is plain Hydrogen (H or 1H)
    • ligands

      public final List<MolAtom> ligands()
      Provides an unmodifiable list view of the ligands of the atom. It is a dynamic view, which follows every change of the molecule structure. However, you must not add or remove atoms or bonds during iteration. (This is not checked currently.)
      Returns:
      a dynamic list view of the ligand atoms
    • bonds

      public final List<MolBond> bonds()
      Provides an unmodifiable list view of the connected bonds of the atom. It is a dynamic view, which follows every change of the molecule structure. However, you must not add or remove atoms or bonds during iteration. (This is not checked currently.)
      Returns:
      a dynamic list view of the connected bonds