|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.struc.CGraph
chemaxon.struc.MoleculeGraph
chemaxon.struc.Molecule
public class Molecule
Molecule class. A MoleculeGraph that may also contain S-groups.
| Field Summary | |
|---|---|
static int |
DEFAULT_UNGROUP
Do not ungroup and do not expand S-group's children. |
static int |
RECURSIVE_UNGROUP
Ungroup and expand (if possible) the child S-groups. |
static int |
RMCLEANUP_FROMSGROUPS
Remove atoms from S-groups. |
static int |
RMCLEANUP_SGROUPATOMS
Remove S-groups of removed superatoms. |
protected static int |
RMSG_DEFAULT
Remove S-group's children and remove S-group from its parent. |
protected static int |
RMSG_KEEP_CHILDREN
Do not remove S-group's children. |
protected static int |
RMSG_KEEP_MULTICENTER
Do not remove central atom of multicenter S-groups. |
protected static int |
RMSG_KEEP_PARENT
Do not remove S-group from its parent. |
| Fields inherited from class chemaxon.struc.CGraph |
|---|
btab, CACHE_REMOVE_ALL, CACHE_REMOVE_CACHEMEMORY, cacheMemory, cssr, ctab, edgeCount, edges, fragIds, grinv, grinvCC, grinvOptions, INITIAL_CAPACITY, nFrags, nGrinv, nodeCount, nodes, parentGraph, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_FIXCOMPONENT, RMCLEANUP_NONE, sssr, sssr2idx, sssrl2idx, superGraph |
| Fields inherited from interface chemaxon.struc.ReadableMolecule |
|---|
HS_S, HS_SP, HS_SP2, HS_SP3, HS_UNKNOWN |
| Fields inherited from interface chemaxon.struc.StereoConstants |
|---|
ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_MASK, CHIRALITY_R, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, TRANS |
| Constructor Summary | |
|---|---|
Molecule()
Construct a molecule. |
|
Molecule(Molecule p,
int na,
int nb)
Construct a molecule or fragment with the specified number of atoms and bonds. |
|
Molecule(Molecule p,
MolAtom a)
Construct a graph consisting of a single vertex (atom). |
|
Molecule(Molecule p,
MolBond b)
Construct a graph consisting of a single edge (bond). |
|
| Method Summary | |
|---|---|
protected void |
addNode0(CNode node)
Adds a node. |
protected void |
addSgroup(Sgroup sg,
boolean setparent)
Adds an S-group to this object and its parent. |
protected void |
addSgroupClones(Molecule origparentm,
Molecule origm,
Molecule newm)
Adds the S-groups of a child molecule clone to the new parent molecule clone. |
protected void |
addSgroupsOf(Molecule m)
Adds S-groups to this object and its parent. |
void |
aromatize(int method)
Aromatize molecule. |
double |
bondlength()
Calculate the regular bond length for the unified structure. |
boolean |
canBeReactionComponent()
Tests whether an object of this class can be a reaction component. |
void |
checkConsistency()
Checks the internal consistency of the structure. |
protected void |
checkSgroupConsistency()
Checks the internal consisitency of S-groups. |
boolean |
clean(int dim,
java.lang.String opts,
MProgressMonitor pmon)
Calculates atom coordinates. |
protected void |
cleanSgroups(int dim,
java.lang.String opts)
Clean S-groups. |
void |
clear()
Clears the molecule. |
void |
clearExtraLabels()
Clears extra atom labels. |
void |
clearForImport(java.lang.String format)
Initializes molecule for import. |
void |
clearProperties()
Clears RDfile/SDfile properties. |
java.lang.Object |
clone()
Makes an identical copy of the molecule. |
void |
clonecopy(CGraph g)
Makes another molecule identical to this one. |
void |
clonecopy(int[] iatoms,
MoleculeGraph g)
Copies the specified atoms and bonds of this graph to another one. |
protected void |
clonecopyWithoutSgroups(Molecule m)
Copies the all the contents except the S-groups into another molecule object. |
void |
clonelesscopy(CGraph g)
Copies to selection. |
Molecule |
cloneMolecule()
Makes an identical copy of the molecule. |
Molecule |
cloneMoleculeWithDocument()
Makes an identical copy of the molecule and its document. |
boolean |
contains(CNode node)
Checks if the graph contains the specified node. |
protected void |
contractExpandedSgroups()
|
boolean |
contractSgroups()
Contracts all S-groups. |
Molecule[] |
convertToFrags()
Converts this molecule to its disconnected fragments. |
int |
countExpandableContractableSgroups()
Counts the expandable and contractable S-groups. |
int |
countOrderedComponentSgroups()
Counts the ordered component S-groups. |
boolean |
dearomatize()
Dearomatize molecule. |
void |
draw(java.awt.Graphics g,
java.lang.String opts)
Deprecated. As of release 4.1.6, replaced by chemaxon.marvin.util.MPainterUtil.draw(Molecule,Graphics,String) |
void |
endReuse(int n)
End reusing atoms. |
boolean |
expandSgroups()
Expands all S-groups. |
boolean |
expandSgroups(int opts)
Expands all S-groups. |
byte[] |
exportToBinFormat(java.lang.String fmt)
Creates a binary representation of the molecule. |
java.lang.String |
exportToFormat(java.lang.String fmt)
Creates a string representation of the molecule. |
java.lang.Object |
exportToObject(java.lang.String fmt)
Creates a String, byte[] array or Image representation of the molecule. |
protected void |
fillSelectionMolecule(SelectionMolecule s)
Adds all atoms and bonds to the specified molecule. |
Sgroup[] |
findAllSgroupContaining(MolAtom a)
Finds the smallest S-groups containing the specified node. |
chemaxon.struc.sgroup.MulticenterSgroup |
findContainingMulticenterSgroup(MolAtom atom)
Gets the containing multicenter S-group of a multicenter atom. |
Sgroup |
findContractableSgroup()
Finds an expanded residue. |
Sgroup |
findExpandableSgroup()
Finds a contracted residue. |
SelectionMolecule[] |
findFrags()
Determines the disconnected fragments and puts them into an array. |
CGraph[] |
findFrags(java.lang.Class cl)
Determines the disconnected fragments and puts them into an array. |
Sgroup |
findSgroupContaining(MolAtom a)
Finds the largest S-group that contains the specified node. |
Sgroup |
findSgroupOf(MolAtom a)
Finds the smallest S-group related to the specified node. |
Sgroup |
findSmallestSgroupContaining(MolAtom a)
Finds the smallest S-group that contains the specified node. |
protected boolean |
fixSelfReferringProperty(MProp prop)
Fix a property containing reference to the molecule. |
java.lang.String |
getComment()
Gets the comment. |
long |
getEndPosition()
Gets the end position of this molecule in the input file. |
protected SelectionMolecule |
getGraphUnionAsSelection()
Gets a selection molecule containing all the atoms and bonds. |
MolImageSize |
getImageSize(java.lang.String fmt)
Gets size information of an image created with the specified format string. |
java.lang.String |
getInputFormat()
Gets the input file format. |
protected Molecule |
getMostSimplifiedMolecule()
Gets the simplified molecule object even if there is a parent document with other objects. |
java.lang.String |
getName()
Gets the molecule name. |
java.lang.String |
getProperty(java.lang.String key)
Gets an RDfile/SDfile property. |
int |
getPropertyCount()
Gets the total number of RDfile/SDfile properties. |
java.lang.String |
getPropertyKey(int i)
Gets an RDfile/SDfile property key. |
java.util.Enumeration |
getPropertyKeys()
Deprecated. as of Marvin 4.1, replaced by properties().getKeys() |
java.lang.Object |
getPropertyObject(java.lang.String key)
Gets an RDfile/SDfile property object. |
Sgroup |
getSgroup(int i)
Gets an S-group. |
Sgroup[] |
getSgroupArray()
Gets the array of S-groups. |
int |
getSgroupCount()
Gets the number of S-groups. |
MolAtom[] |
getSgroupLigands()
Gets the S-group's ligands if the structure represents an S-group. |
Molecule |
getSimplifiedMolecule()
Gets the simplified molecule object. |
Sgroup[] |
getSortedSgroups()
Gets the sorted S-groups in parent-child order. |
long |
getStartPosition()
Gets the starting position of this molecule in the input file. |
double[] |
getVisibleCoords(MolAtom ma)
Returns the coordinates of the given atom (contained in the molecule). |
int |
indexOf(Sgroup sg)
Gets the array index of an S-group. |
boolean |
isEmpty()
Tests whether the molecule is empty. |
boolean |
isExpandable(int opts)
Tests if the molecule is expandable with the specified options. |
boolean |
isGUIContracted()
Tests if the molecule has a GUI-contracted S-group or not. |
protected boolean |
isPeptideChain(Molecule mol)
|
boolean |
isReaction()
Checks if the structure represents a reaction or not. |
boolean |
isSgroup()
Checks if the structure represents an S-group or not. |
protected void |
makeBiopolymerSnake(Molecule mol)
If there is a chain with all the members being SuperatomSgroups, the method arranges them into a "snake" form to fit into the canvas (intead of being linear). |
protected void |
makeItSimilar(CGraph g)
Copies some properties of this molecule to the other one specified as argument. |
void |
mergeNodes(CNode that,
CNode node)
Merges bonds of an atom with another atom, then add the atom to the molecule. |
CGraph |
newInstance()
Creates a new Molecule object. |
SelectionMolecule |
newSelectionMolecule()
Creates a new SelectionMolecule object appropriate for storing selection from this molecule. |
boolean |
partialClean(int dim,
int[] fixed,
java.lang.String opts)
Calculates atom coordinates by using fixed atoms. |
protected void |
postClean()
Operations performed after cleaning. |
protected void |
regenFragIds()
Searches the disconnected fragments. |
void |
removeAll()
Removes all the nodes and edges. |
void |
removeAllEdges()
Removes all edges. |
protected void |
removeAllSgroups()
Removes all S-groups. |
protected void |
removeEdge(CEdge edge,
int cleanupFlags)
Removes an edge by reference. |
protected void |
removeEdge(int i,
int cleanupFlags)
Removes an edge. |
void |
removeNode(CNode node,
int cleanupFlags)
Removes a node and its edges. |
void |
removeNode(int i,
int cleanupFlags)
Remove a node and its edges. |
protected void |
removeSgroupFromList(Sgroup sg)
Removes an S-group from the sgroupVector. |
protected void |
removeSgroupsOf(Molecule m)
Removes S-groups from this object and its parent. |
protected void |
removeSgroupsOf(Molecule m,
int rmflags)
Removes S-groups that are contained in a given molecule but not contained in another molecule. |
protected void |
reparentSgroups(Molecule p)
Change parents of all S-groups in this molecule. |
static java.lang.String |
residueSymbolOf(int id)
Gets the name of a residue. |
static int |
residueTypeOf(java.lang.String name)
Gets the residue identifier for a residue name. |
MolAtom |
reuseAtom(int z,
int i)
Reuse an atom or create a new one. |
void |
setComment(java.lang.String s)
Sets the comment. |
void |
setDim(int d)
Sets the dimension. |
void |
setEndPosition(long off)
Sets the end position of this molecule in the input file. |
void |
setGUIContracted(boolean v)
Contracts some S-groups to use in GUI or expands for any other use. |
void |
setInputFormat(java.lang.String format)
Sets the input file format. |
void |
setName(java.lang.String s)
Sets the molecule name. |
protected void |
setNode0(int i,
CNode node)
Sets the node at the specified index. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets an RDfile/SDfile property. |
void |
setPropertyObject(java.lang.String key,
java.lang.Object value)
Sets an RDfile/SDfile property object. |
void |
setSgroupParent(MolAtom a,
Sgroup sg,
boolean set)
Sets or unsets an S-group as a parent of an atom. |
void |
setStartPosition(long off)
Sets the starting position of this molecule in the input file. |
void |
sortSgroupXBonds()
Sorts superatom S-group crossing bonds in attachment point number order. |
byte[] |
toBinFormat(java.lang.String fmt)
Creates a binary representation of the molecule. |
java.lang.String |
toFormat(java.lang.String fmt)
Creates a string representation of the molecule. |
java.lang.Object |
toObject(java.lang.String fmt)
Creates a String, byte[] array or Image representation of the molecule. |
void |
transform(CTransform3D t,
boolean incg)
Apply a transformation matrix to the atomic coordinates and Data Sgroup coordinates. |
boolean |
ungroupSgroup(int i)
Ungroups the specified S-group and expands it if it is an Expandable S-group. |
boolean |
ungroupSgroup(int i,
int opts)
Ungroups the specified S-group and expands it if it is an Expandable S-group. |
boolean |
ungroupSgroup(Sgroup sg)
Expand and ungroup the specified S-group. |
boolean |
ungroupSgroup(Sgroup sg,
int opts)
Expand and ungroup the specified S-group. |
boolean |
ungroupSgroups()
Expand and ungroup all S-groups. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int RMCLEANUP_SGROUPATOMS
removeNode(CNode, int),
removeNode(int, int),
CGraph.RMCLEANUP_ALL,
Constant Field Valuespublic static final int RMCLEANUP_FROMSGROUPS
removeNode(CNode, int),
removeNode(int, int),
CGraph.RMCLEANUP_ALL,
Constant Field Valuesprotected static final int RMSG_DEFAULT
protected static final int RMSG_KEEP_CHILDREN
protected static final int RMSG_KEEP_PARENT
protected static final int RMSG_KEEP_MULTICENTER
public static final int RECURSIVE_UNGROUP
public static final int DEFAULT_UNGROUP
| Constructor Detail |
|---|
public Molecule(Molecule p,
int na,
int nb)
p - the molecule that contains the created fragmentna - no reallocation needed until the number of atoms is less than
this valuenb - no reallocation needed until the number of bonds is less than
this value
public Molecule(Molecule p,
MolAtom a)
p - the parent structurea - the atom
public Molecule(Molecule p,
MolBond b)
p - the parent structureb - the bondpublic Molecule()
| Method Detail |
|---|
public void setDim(int d)
setDim in class MoleculeGraphd - 0, 2, or 3MoleculeGraph.getFlags()public void clear()
clear in class MoleculeGraphMoleculeGraph.clearForImport(java.lang.String),
CGraph.nodespublic void clearForImport(java.lang.String format)
clearForImport in class MoleculeGraphformat - input file formatCGraph.edges,
MoleculeGraph.orix,
MoleculeGraph.oriy,
MoleculeGraph.oriz,
MoleculeGraph.setFlags(int)public long getStartPosition()
public void setStartPosition(long off)
off - the starting positionpublic long getEndPosition()
public void setEndPosition(long off)
off - the end positionpublic java.lang.String getName()
getName in interface chemaxon.struc.ReadableMoleculegetName in class MoleculeGraphpublic void setName(java.lang.String s)
s - the molecule name, empty string or null
(null is equivalent to empty string)public final java.lang.String getComment()
public final void setComment(java.lang.String s)
s - the comment, empty string or null
(null is equivalent to empty string)public final java.lang.String getInputFormat()
public void setInputFormat(java.lang.String format)
format - the input formatgetInputFormat()public void clearProperties()
public int getPropertyCount()
public java.util.Enumeration getPropertyKeys()
properties().getKeys()
public java.lang.String getPropertyKey(int i)
i - property index
public java.lang.String getProperty(java.lang.String key)
key - property name
public java.lang.Object getPropertyObject(java.lang.String key)
key - property name
public void setProperty(java.lang.String key,
java.lang.String value)
key - the property namevalue - the value or null
public void setPropertyObject(java.lang.String key,
java.lang.Object value)
key - the property namevalue - the value or nullpublic static int residueTypeOf(java.lang.String name)
name - residue name
public static java.lang.String residueSymbolOf(int id)
id - the residue identifier
protected void setNode0(int i,
CNode node)
setNode0 in class MoleculeGraphi - the atom indexnode - the atom
public void removeNode(CNode node,
int cleanupFlags)
CGraph.removeNode(CNode)
instead unless you are sure what you are doing.
removeNode in class MoleculeGraphnode - the nodecleanupFlags - extra clean-up methodsCGraph.RMCLEANUP_NONE,
CGraph.RMCLEANUP_ALL,
CGraph.RMCLEANUP_EDGES,
MoleculeGraph.RMCLEANUP_STEREO
public void removeNode(int i,
int cleanupFlags)
CGraph.removeNode(CNode)
instead unless you are sure what you are doing.
removeNode in class MoleculeGraphi - the node indexcleanupFlags - extra clean-up methodsCGraph.RMCLEANUP_NONE,
CGraph.RMCLEANUP_ALL,
CGraph.RMCLEANUP_EDGES,
MoleculeGraph.RMCLEANUP_STEREO
protected void removeEdge(CEdge edge,
int cleanupFlags)
removeEdge in class CGraphedge - the edgecleanupFlags - extra clean-up methodsCGraph.RMCLEANUP_NONE,
CGraph.RMCLEANUP_ALL,
CGraph.RMCLEANUP_EDGES,
MoleculeGraph.RMCLEANUP_STEREO
protected void removeEdge(int i,
int cleanupFlags)
removeEdge in class MoleculeGraphi - the edge indexcleanupFlags - extra clean-up methodsCGraph.RMCLEANUP_NONE,
CGraph.RMCLEANUP_ALL,
CGraph.RMCLEANUP_EDGES,
MoleculeGraph.RMCLEANUP_STEREOpublic void removeAllEdges()
removeAllEdges in class CGraphpublic void removeAll()
removeAll in class CGraphpublic boolean isEmpty()
isEmpty in class CGraphtrue if the graph does not contain any nodes,
edges or non-empty S-groups, false otherwise
public boolean clean(int dim,
java.lang.String opts,
MProgressMonitor pmon)
clean in class MoleculeGraphdim - dimensionsopts - cleaning options or nullpmon - progress observer object or null
java.lang.SecurityException - cannot load module because
of a security problem (firewall)MoleculeGraph.clean(int, java.lang.String)
protected void cleanSgroups(int dim,
java.lang.String opts)
dim - dimensionsopts - cleaning options or nullprotected void contractExpandedSgroups()
protected boolean isPeptideChain(Molecule mol)
protected void postClean()
protected void makeBiopolymerSnake(Molecule mol)
public void aromatize(int method)
aromatize in class MoleculeGraphmethod - specifies the algorithm for aromatization.
java.lang.SecurityException - cannot load module because of a security
problem (firewall)MoleculeGraph.AROM_BASIC,
MoleculeGraph.AROM_GENERAL,
Document about aromatizationpublic boolean dearomatize()
dearomatize in class MoleculeGraphjava.lang.SecurityException - cannot load module because of a security
problem (firewall)public void clonecopy(CGraph g)
clonecopy in class MoleculeGraphg - the target moleculeprotected boolean fixSelfReferringProperty(MProp prop)
fixSelfReferringProperty in class MoleculeGraphprop - the propertyMoleculeGraph.clonecopy(CGraph)
protected final void addSgroupClones(Molecule origparentm,
Molecule origm,
Molecule newm)
origparentm - the original parent moleculeorigm - the original child moleculenewm - the new child molecule (clone of the original)
public void clonecopy(int[] iatoms,
MoleculeGraph g)
clonecopy in class MoleculeGraphiatoms - array of node indices to copy or nullg - the target graphprotected void clonecopyWithoutSgroups(Molecule m)
m - the target moleculepublic void clonelesscopy(CGraph g)
clonelesscopy in class MoleculeGraphg - the target molecule object (the selection)public Molecule cloneMoleculeWithDocument()
public Molecule cloneMolecule()
public final java.lang.Object clone()
clone in class MoleculeGraphpublic MolImageSize getImageSize(java.lang.String fmt)
MolImageSize g1 = mol.getImageSize("image:scale24");
// (g1.width, g2.width) is the bounding box size for an image created
// with scaling factor 24
MolImageSize g2 = mol.getImageSize("image:w100h100");
// g2.scale is the maximum scaling factor for 100x100 image
fmt - format string that contains the image export options
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of
security reasons (firewall).toBinFormat(java.lang.String),
toObject(java.lang.String)public final java.lang.String toFormat(java.lang.String fmt)
s1 = mol.toFormat("mol");
s2 = mol.toFormat("smiles:a-H"); // aromatize and remove Hydrogens
fmt - the format descriptor string
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of
security reasons (firewall).toObject(java.lang.String)
public final java.lang.String exportToFormat(java.lang.String fmt)
throws MolExportException
toFormat(String), the only difference is that
export exceptions are not converted to
IllegalArgumentException.
fmt - the format descriptor string
MolExportException - Export error
java.lang.IllegalArgumentException - Invalid format string.
java.lang.SecurityException - Export module cannot be loaded because of
security reasons (firewall).toFormat(String)public final byte[] toBinFormat(java.lang.String fmt)
toFormat method, and also with the binary image
formats (jpeg, msbmp, png, ppm). When creating an image,
display
options can also be specified in the format descriptor