public class MolBond extends Object implements StereoConstants, Serializable
Modifier and Type | Field and Description |
---|---|
static int |
ANY
Any bond type.
|
static int |
AROMATIC
Aromatic bond type.
|
static int |
BOLD
"Bold" attribute of the bond.
|
static double |
CCLENGTH
Default bond length.
|
static int |
CONJUGATED
Conjugation state of the bond.
|
static int |
COORDINATE
Coordinate bond flag.
|
static int |
DOUBLE_OR_AROMATIC
Double or aromatic query bond type.
|
static int |
DOWN
Single bond down flag.
|
static int |
HASHED
"Hashed" attribute of the bond.
|
static int |
HYDROGEN
Hydrogen bond type.
|
static int |
RC_CHANGE
The bond (order) has changed in the reaction.
|
static int |
RC_MAKE_AND_CHANGE
The bond is created and changed.
|
static int |
RC_MAKE_OR_BREAK
The bond is made or broken in the reaction.
|
static int |
RC_NOT_CENTER
The bond is not a reacting center.
|
static int |
RC_NOT_MODIFIED
The bond is not modified in the reaction.
|
static int |
RC_REACTING_CENTER
The bond is a reacting center.
|
static int |
RC_UNMAPPED
Unmapped bond in reacting center.
|
static int |
REACTING_CENTER_MASK
Mask for reacting center bits.
|
static int |
SETSEQ_MAX
Maximum bond set sequence number.
|
static int |
SETSEQ_OFF
Bond set sequence number offset in flags.
|
static int |
SINGLE_OR_AROMATIC
Single or aromatic query bond type.
|
static int |
SINGLE_OR_DOUBLE
Single or double query bond type.
|
static int |
STEREO_MASK
Single and double bond stereo mask.
|
static int |
STEREO1_MASK
Single bond stereo mask.
|
static int |
STEREO2_CARE
Cis/trans info of this bond is taken care of during
the SSS process if this flag is set - used only for query bonds.
|
static int |
TOPOLOGY_CHAIN
Bond is in a chain.
|
static int |
TOPOLOGY_MASK
Bond topology mask.
|
static int |
TOPOLOGY_RING
Bond is in a ring.
|
static int |
TYPE_MASK
The lowest bits of the flags that store the bond type.
|
static int |
UP
Single bond up flag.
|
static int |
WAVY
Single bond wavy flag.
|
ANTI, ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_M, CHIRALITY_MASK, CHIRALITY_P, CHIRALITY_r, CHIRALITY_R, CHIRALITY_s, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
Modifier | Constructor and Description |
---|---|
|
MolBond(MolAtom a1,
MolAtom a2)
Construct a single bond between two atoms.
|
|
MolBond(MolAtom a1,
MolAtom a2,
int f)
Construct a bond between two atoms.
|
protected |
MolBond(MolBond b)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
calcOrderFromLength()
Calculate the bond order from the atomic distances.
|
int |
calcOrderFromValence()
Calculate bond order from the types and charges of the two atoms.
|
int |
calcStereo2()
Computes the stereochemistry of the bond based on the atomic coordinates.
|
int |
calcStereo2(MolAtom atom1,
MolAtom atom4)
Computes the stereochemistry of the bond based on the atomic coordinates.
|
static int |
calcStereo2(MolAtom atom1,
MolAtom atom2,
MolAtom atom3,
MolAtom atom4)
Computes the stereochemistry of the atom sequence (scheme a1-a2=a3-a4)
based on the atomic coordinates.
|
void |
clearProperties()
Removes all properties from this bond.
|
Object |
clone()
Make a copy of this object.
|
MolBond |
cloneBond(MolAtom a1,
MolAtom a2)
Clones this bond.
|
boolean |
containsPropertyKey(String key)
Returns true if this bond has a mapping for the specified property key.
|
static double |
desiredLength(int atno1,
int atno2,
int type,
int dim)
Desired length of a bond between two atoms in Angstroms.
|
MolAtom |
getAtom1()
Gets the first endpoint.
|
MolAtom |
getAtom2()
Gets the second endpoint.
|
chemaxon.struc.BondType |
getBondType()
Gets the type of the bond.
|
MolAtom |
getCTAtom1()
Gets the first atom for cis/trans stereo calculation.
|
MolAtom |
getCTAtom4()
Gets the fourth atom for cis/trans stereo calculation.
|
double |
getDesiredLength()
Deprecated.
since 5.11, replaced by
desiredLength(int, int, int, int) . |
double |
getDesiredLength(boolean shortenHbonds)
Deprecated.
since 5.11, replaced by
desiredLength(int, int, int, int) . |
int |
getFlags()
Gets bond type (4 bits), stereo (2+2+1 bits), topology (2 bits),
bond set (5 bits) and reacting center (7 bits) information.
|
double |
getLength()
Gets the actual length of the bond.
|
protected Object |
getLock()
Gets lock object for synchronization.
|
MolAtom |
getOtherAtom(MolAtom atom)
Gets the other end of the bond.
|
MoleculeGraph |
getParent()
Gets the parent graph.
|
Object |
getProperty(String key)
Returns the property value to which the specified property key is mapped
at this bond, or null if this bond has no mapping for this property key.
|
String |
getQuerystr()
Gets the query properties.
|
int |
getSetSeq()
Gets the bond set.
|
int |
getStereo1(MolAtom o)
Gets wedge bond type relative to the specified chiral atom.
|
int |
getType()
Gets the bond type.
|
boolean |
haveEqualProperties(MolBond b)
Tests whether two bonds have the same properties.
|
boolean |
isBold()
Decides whether this bond is bold or not.
|
boolean |
isCollinear(MolAtom atom)
Returns whether atom is collinear with the bond or not.
|
boolean |
isConjugated()
Gets the conjugation state of the bond set by the conjugation modul.
|
boolean |
isCoordinate()
Tests whether the bond is coordinate.
|
boolean |
isHashed()
Decides whether this bond is hashed or not.
|
boolean |
isPositionVariation()
Decides whether this bond is a position variation bond.
|
boolean |
isQuery()
Tests whether it is query bond or has query property:
any
single or double
single or aromatic
double or aromatic
smarts bond
ring or chain topology
For more information on smarts bond and query bonds, see
The JChem Query Guide
|
boolean |
isRemovable()
Deprecated.
As of Marvin 6.2, no replacement.
Not supported feature. |
protected boolean |
overridesAtMerge(MolBond e)
Checks if this bond should override another one when two structures
are merged.
|
int |
propertyCount()
Returns the number of property (property key - property value) mappings
of this bond.
|
Set<String> |
propertyKeySet()
Returns a set view of the property keys of this bond.
|
Set<Map.Entry<String,Object>> |
propertySet()
Returns a set view of the properties (property key - property
value mappings) of this bond.
|
void |
putProperty(String key,
Object value)
Associates the specified value with the specified key at this bond.
|
Object |
removeProperty(String key)
Removes the mapping for this property key from this bond if present.
|
void |
setFlags(int f)
Sets bond type (4 bit), stereo (2+2+1 bit), topology (2 bit)
bond set (5 bit) and reacting center (7 bits) information.
|
void |
setFlags(int f,
int mask)
Sets bond type (3 bit), stereo (2+2+1 bit), and topology (2 bit)
information.
|
void |
setSetSeq(int g)
Sets the bond set.
|
void |
setStereo2Flags(MolAtom a1,
MolAtom a4,
int stereo2)
Sets double bond stereo information.
|
void |
setType(int t)
Sets bond type and does valence checking for the endpoints.
|
boolean |
stepWedge()
|
static boolean |
stepWedge(MolBond[] bs)
Flip the given bonds to the next state
ONLY 1 bond is set to chiral
starting from the last bond
|
void |
swap()
Change orientation.
|
String |
toString()
Overrides Object.toString() to ease debugging.
|
int |
transformCT(MolAtom a1,
MolAtom a4,
int f)
Transform cis/trans stereo information into the
`reference frame' of this bond.
|
public static final double CCLENGTH
public static final int ANY
public static final int TYPE_MASK
public static final int AROMATIC
public static final int SINGLE_OR_DOUBLE
public static final int SINGLE_OR_AROMATIC
public static final int DOUBLE_OR_AROMATIC
public static final int CONJUGATED
public static final int COORDINATE
public static final int HYDROGEN
public static final int UP
public static final int DOWN
public static final int WAVY
UP
,
DOWN
,
Constant Field Valuespublic static final int STEREO1_MASK
UP
,
DOWN
,
Constant Field Valuespublic static final int STEREO2_CARE
STEREO_MASK
,
Constant Field Valuespublic static final int STEREO_MASK
public static final int TOPOLOGY_RING
TOPOLOGY_MASK
,
Constant Field Valuespublic static final int TOPOLOGY_CHAIN
TOPOLOGY_MASK
,
Constant Field Valuespublic static final int TOPOLOGY_MASK
TOPOLOGY_CHAIN
,
TOPOLOGY_RING
,
Constant Field Valuespublic static final int RC_REACTING_CENTER
REACTING_CENTER_MASK
,
Constant Field Valuespublic static final int RC_MAKE_OR_BREAK
REACTING_CENTER_MASK
,
Constant Field Valuespublic static final int RC_CHANGE
REACTING_CENTER_MASK
,
Constant Field Valuespublic static final int RC_MAKE_AND_CHANGE
REACTING_CENTER_MASK
,
Constant Field Valuespublic static final int RC_NOT_CENTER
REACTING_CENTER_MASK
,
Constant Field Valuespublic static final int RC_NOT_MODIFIED
REACTING_CENTER_MASK
,
Constant Field Valuespublic static final int RC_UNMAPPED
REACTING_CENTER_MASK
,
Constant Field Valuespublic static final int REACTING_CENTER_MASK
public static final int SETSEQ_OFF
SETSEQ_MAX
,
Constant Field Valuespublic static final int SETSEQ_MAX
SETSEQ_OFF
,
Constant Field Valuespublic static final int BOLD
public static final int HASHED
public MolBond(MolAtom a1, MolAtom a2, int f)
a1
- the first atoma2
- the second atomf
- bond type and other flagsprotected MolBond(MolBond b)
b
- the original bondpublic final MoleculeGraph getParent()
public void swap()
public MolAtom getAtom1()
public MolAtom getAtom2()
public final MolAtom getOtherAtom(MolAtom atom)
atom
- one of the bond endpointsnull
if the given atom is not an endpoint for this bondpublic final double getLength()
public final int getFlags()
TYPE_MASK
,
STEREO_MASK
,
TOPOLOGY_MASK
,
SETSEQ_OFF
,
REACTING_CENTER_MASK
public void setFlags(int f)
Valence checking is omitted if you set the bond type this way, without setType.b.setFlags((b.getFlags() & ~MolBond.TYPE_MASK) | type);
f
- the flagsTYPE_MASK
,
STEREO_MASK
,
TOPOLOGY_MASK
,
SETSEQ_OFF
,
REACTING_CENTER_MASK
,
setType(int)
public void setFlags(int f, int mask)
Valence checking is omitted if you set the bond type this way, without setType.b.setFlags(type, MolBond.TYPE_MASK);
f
- new value of the specified bitsmask
- bits to setTYPE_MASK
,
STEREO_MASK
,
TOPOLOGY_MASK
,
setFlags(int)
,
setType(int)
public final int getType()
AROMATIC
,
SINGLE_OR_DOUBLE
,
SINGLE_OR_AROMATIC
,
DOUBLE_OR_AROMATIC
,
COORDINATE
,
CONJUGATED
,
ANY
public final chemaxon.struc.BondType getBondType()
public void setType(int t)
t
- the new bond typegetType()
public final int getSetSeq()
SETSEQ_MAX
public final void setSetSeq(int g)
g
- a number between 0 and SETSEQ_MAX
public final boolean isConjugated()
true
if the bond is a member of a conjugated system,
false
otherwisepublic final boolean isCoordinate()
true
if it is coordinate bond,
false
otherwisepublic final boolean isPositionVariation()
true
if this is a position variation bond,
false
otherwisepublic final boolean isBold()
true
if this bond is bold,
false
otherwiseBOLD
public final boolean isHashed()
true
if this bond is hashed,
false
otherwiseHASHED
public int calcOrderFromLength()
public final int calcOrderFromValence()
public MolBond cloneBond(MolAtom a1, MolAtom a2)
a1
- new end atom 1a2
- new end atom 2public Object clone()
@Deprecated public double getDesiredLength()
desiredLength(int, int, int, int)
.@Deprecated public double getDesiredLength(boolean shortenHbonds)
desiredLength(int, int, int, int)
.shortenHbonds
- use 1.0 as bond length for explicit H bonds in 2D.public static double desiredLength(int atno1, int atno2, int type, int dim)
atno1
- atomic number of the first atomatno2
- atomic number of the second atomtype
- bond orderdim
- space dimension, 2 or 3public final int getStereo1(MolAtom o)
o
- the chiral atomUP
,
DOWN
,
STEREO1_MASK
,
getFlags()
public final MolAtom getCTAtom1()
calcStereo2()
public final MolAtom getCTAtom4()
calcStereo2()
public void setStereo2Flags(MolAtom a1, MolAtom a4, int stereo2)
a1
- atom number 1 in scheme a1-a2=a3-a4a4
- atom number 4stereo2
- CIS/TRANS informationStereoConstants.CIS
,
StereoConstants.TRANS
,
StereoConstants.CTUNSPEC
,
StereoConstants.CTUMASK
,
calcStereo2(MolAtom, MolAtom)
public int transformCT(MolAtom a1, MolAtom a4, int f)
a1
- atom connected to atom1a4
- atom connected to atom2f
- original flagspublic int calcStereo2()
StereoConstants
,
getCTAtom1()
,
getCTAtom4()
,
calcStereo2(MolAtom, MolAtom)
public int calcStereo2(MolAtom atom1, MolAtom atom4)
atom1
- atom number 1 in scheme a1-a2=a3-a4atom4
- atom number 4StereoConstants
public static int calcStereo2(MolAtom atom1, MolAtom atom2, MolAtom atom3, MolAtom atom4)
atom1
- atom number 1 in scheme a1-a2=a3-a4atom2
- atom number 2 in scheme a1-a2=a3-a4atom3
- atom number 3 in scheme a1-a2=a3-a4atom4
- atom number 4 in scheme a1-a2=a3-a4StereoConstants
public boolean stepWedge()
public static boolean stepWedge(MolBond[] bs)
bs
- bond array which elements can be flippedtrue
if flipping can be continued,
false
after last steppublic String getQuerystr()
public boolean haveEqualProperties(MolBond b)
true
if they have the same properties,
false
otherwiseprotected boolean overridesAtMerge(MolBond e)
e
- the other bondtrue
if it overrides e, false
otherwisepublic final boolean isQuery()
true
if the bond has a query bond type or property,
false
otherwiseANY
,
SINGLE_OR_DOUBLE
,
SINGLE_OR_AROMATIC
,
DOUBLE_OR_AROMATIC
,
TOPOLOGY_MASK
,
TOPOLOGY_CHAIN
,
TOPOLOGY_RING
public boolean isCollinear(MolAtom atom)
atom
- Atom to decide about.true
if atom
and the atoms of the bond
lie on the same lineprotected final Object getLock()
public String toString()
public Set<Map.Entry<String,Object>> propertySet()
public Set<String> propertyKeySet()
public boolean containsPropertyKey(String key)
key
- the property key which is to be searched for.public Object removeProperty(String key)
key
- property key whose mapping is to be removed from the bond.public int propertyCount()
public Object getProperty(String key)
key
- the property key whose associated property value is to be
returned.public void putProperty(String key, Object value)
key
- property key with which the specified value is to be
associated.value
- property value to be associated with the specified property
key.public void clearProperties()
@Deprecated public boolean isRemovable()