|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object chemaxon.struc.CGraph chemaxon.struc.MoleculeGraph chemaxon.struc.Molecule
Molecule class. A MoleculeGraph that may also contain S-groups.
Field Summary |
Fields inherited from class chemaxon.struc.MoleculeGraph |
DIM_MASK, flags, isMultiChiral, orix, oriy, oriz, RMCLEANUP_STEREO |
Fields inherited from class chemaxon.struc.CGraph |
btab, ctab, edgeCount, edges, fragIds, grinv, grinvCC, INITIAL_CAPACITY, nFrags, nGrinv, nodeCount, nodes, parentGraph, RMCLEANUP_ALL, RMCLEANUP_EDGES, RMCLEANUP_NONE, sssr, superGraph |
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)
Construct a molecule or fragment. |
|
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 |
addSgroupsOf(Molecule m)
Adds S-groups to this object and its parent. |
double |
bondlength()
Calculate the regular bond length for the unified structure. |
void |
clear()
Clears the molecule. |
void |
clearCalcResults()
|
void |
clearForImport(java.lang.String format)
Initializes molecule for import. |
void |
clearProperties()
Clears RDfile/SDfile properties. |
java.lang.Object |
clone()
Make an identical copy of the molecule. |
void |
clonecopy(CGraph g)
Make another molecule identical to this one. |
void |
clonelesscopy(CGraph g)
Copy to selection. |
boolean |
contractSgroups()
Contracts all S-groups. |
Molecule[] |
convertToFrags()
Converts this molecule to its disconnected fragments. |
void |
draw(java.awt.Graphics g,
java.lang.String opts)
Draws the molecule into a graphics context. |
void |
endReuse(int n)
End reusing atoms. |
boolean |
expandSgroups()
Expands all S-groups. |
boolean |
expandSgroups(int opts)
Expands all S-groups. |
protected void |
fillSelectionMolecule(SelectionMolecule s)
Adds all atoms and bonds to the specified molecule. |
Sgroup |
findContractableSgroup()
Finds an expanded residue. |
Sgroup |
findExpandableSgroup()
Finds a contracted residue. |
SelectionMolecule[] |
findFrags()
Determines the disconnected fragments and puts them into an array. |
Sgroup |
findSgroupContaining(MolAtom a)
Finds the S-group that contains the specified node. |
Sgroup |
findSgroupOf(MolAtom a)
Finds the S-group related to the specified node. |
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. |
chemaxon.marvin.util.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. |
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 n)
Gets an RDfile/SDfile property key. |
java.util.Enumeration |
getPropertyKeys()
Gets the keys for the RDfile/SDfile properties. |
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. |
long |
getStartPosition()
Gets the starting position of this molecule in the input file. |
int |
indexOf(Sgroup sg)
Gets the array index of an S-group. |
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 |
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. |
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. |
protected void |
removeNode(CNode node,
int cleanupFlags)
Removes a node and its edges. |
protected void |
removeNode(int i,
int cleanupFlags)
Remove a node and its edges. |
protected void |
removeSgroupsOf(Molecule m)
Removes S-groups from this object and its parent. |
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 |
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. |
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. |
boolean |
ungroupSgroups()
Expand and ungroup all S-groups. |
Methods inherited from class chemaxon.struc.CGraph |
add, add, addEdge0, addEdgeWithoutChangingIt, addNodeWithoutChangingIt, contains, findFrag, findFrags, fuse, fuse0, getBtab, getCtab, getEdge, getEdgeCount, getEdgeVector, getForefather, getFragCount, getFragIds, getGrinv, getGrinvCC, getLock, getNode, getNodeCount, getNodeVector, getParent, getSSSR, indexOf, indexOf, isEmpty, isRealNodeParent, pack, regenEdges, removeEdge, removeEdge, removeNode, removeNode, resetCtab, resetGrinvInParents, setEdge, setNode, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 valuepublic Molecule(Molecule p, MolAtom a)
p
- the parent structurea
- the atompublic Molecule(Molecule p, MolBond b)
p
- the parent structureb
- the bondpublic Molecule(Molecule p)
p
- the parent structurepublic Molecule()
Method Detail |
public void setDim(int d)
setDim
in class MoleculeGraph
d
- 0, 2, or 3MoleculeGraph.flags
public void clear()
clear
in class MoleculeGraph
MoleculeGraph.clearForImport(java.lang.String)
,
CGraph.nodes
public void clearForImport(java.lang.String format)
clearForImport
in class MoleculeGraph
format
- input file formatCGraph.edges
,
MoleculeGraph.orix
,
MoleculeGraph.oriy
,
MoleculeGraph.oriz
,
MoleculeGraph.flags
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()
public 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()
public java.lang.String getPropertyKey(int n)
n
- 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 nullpublic 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 CGraph
i
- the atom indexnode
- the atomprotected void removeNode(CNode node, int cleanupFlags)
removeNode
in class MoleculeGraph
node
- the nodecleanupFlags
- extra clean-up methodsCGraph.RMCLEANUP_NONE
,
CGraph.RMCLEANUP_ALL
,
CGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
protected void removeNode(int i, int cleanupFlags)
removeNode
in class MoleculeGraph
i
- 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 CGraph
edge
- 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 CGraph
i
- the edge indexcleanupFlags
- extra clean-up methodsCGraph.RMCLEANUP_NONE
,
CGraph.RMCLEANUP_ALL
,
CGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
public void removeAllEdges()
removeAllEdges
in class CGraph
public void removeAll()
removeAll
in class CGraph
public void clonecopy(CGraph g)
clonecopy
in class MoleculeGraph
g
- the target moleculepublic void clonelesscopy(CGraph g)
clonelesscopy
in class MoleculeGraph
g
- the target molecule object (the selection)public java.lang.Object clone()
clone
in class MoleculeGraph
public chemaxon.marvin.util.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 byte[] toBinFormat(java.lang.String fmt)
toFormat
method, and also with the binary image
formats (jpeg, png, ppm). When creating an image,
display
options can also be specified in the format descriptor string.
Format and options are separated by a colon, multiple options can be
separated by commas. See the possible formats and their options on the
File Formats in Marvin
page. Examples:
byte[] d1 = mol.toBinFormat("mol"); byte[] d2 = mol.toBinFormat("smiles:a-H"); // aromatize and remove H byte[] d3 = mol.toBinFormat("ppm:w300,h300,#ffff00"); byte[] d4 = mol.toBinFormat("png:w300,h300,b32,#00ffff00"); byte[] d5 = mol.toBinFormat("jpeg:w300,h300,Q95,#ffff00,spacefill");
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)
,
getImageSize(java.lang.String)
public java.lang.Object toObject(java.lang.String fmt)
import java.awt.Image; ... String s1 = (String)mol.toObject("mol"); String s2 = (String)mol.toObject("smiles:a-H"); // aromatize, remove H Image img = (Image)mol.toObject("image:w300,h300,#ffff00"); byte[] d3 = (byte[])mol.toObject("ppm:w300,h300,#ffff00"); byte[] d4 = (byte[])mol.toObject("png:w300,h300,b32,#00ffff00"); byte[] d5 = (byte[])mol.toObject("jpeg:w300,h300,Q95,#ffff00,spacefill");
fmt
- the format descriptor string
java.lang.IllegalArgumentException
- Invalid format string.
java.lang.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).toFormat(java.lang.String)
,
toBinFormat(java.lang.String)
,
getImageSize(java.lang.String)
public void draw(java.awt.Graphics g, java.lang.String opts)
g
- the graphics contextopts
- the export options
java.lang.SecurityException
- Export module cannot be loaded because of
security reasons (firewall).toObject(java.lang.String)
public MolAtom reuseAtom(int z, int i)
z
- the atomic numberi
- the atom index
public void endReuse(int n)
n
- number of atomspublic CGraph newInstance()
newInstance
in class MoleculeGraph
protected void makeItSimilar(CGraph g)
makeItSimilar
in class MoleculeGraph
g
- the molecule to changepublic Molecule getSimplifiedMolecule()
public boolean isReaction()
public boolean isSgroup()
public MolAtom[] getSgroupLigands()
public final Sgroup findExpandableSgroup()
public final Sgroup findContractableSgroup()
public final Sgroup[] getSgroupArray()
public final int getSgroupCount()
public final Sgroup getSgroup(int i)
i
- S-group indexpublic final int indexOf(Sgroup sg)
sg
- the S-grouppublic final Sgroup findSgroupOf(MolAtom a)
a
- the node
public final Sgroup findSgroupContaining(MolAtom a)
a
- the node
public void setSgroupParent(MolAtom a, Sgroup sg, boolean set)
a
- the atomsg
- the S-groupset
- set (true) or unset (false)
java.lang.IllegalArgumentException
- molecule does not contain the atomprotected final void reparentSgroups(Molecule p)
p
- the new parent
java.lang.IllegalArgumentException
- molecule does not contain the atompublic void mergeNodes(CNode that, CNode node)
mergeNodes
in class CGraph
that
- the atomnode
- the other atomprotected void addNode0(CNode node)
addNode0
in class CGraph
node
- the node referencepublic final boolean contractSgroups()
Expandable.contract(int)
,
Expandable.DEFAULT_OPTIONS
public final boolean expandSgroups(int opts)
opts
- expansion options
Expandable.expand(int)
,
Expandable.DEFAULT_OPTIONS
,
Expandable.MDL_EXPAND
public final boolean expandSgroups()
expandSgroups(int)
public final boolean ungroupSgroups()
protected final void addSgroupsOf(Molecule m)
protected final void removeSgroupsOf(Molecule m)
protected void removeAllSgroups()
protected final SelectionMolecule getGraphUnionAsSelection()
SelectionMolecule
public double bondlength()
bondlength
in class MoleculeGraph
public final Molecule[] convertToFrags()
Warning: Atoms are removed from the original molecule object to the created fragments, therefore the original molecule becomes inconsistent.
The original node order is preserved in the returned fragments. Fragment order is also determined by the original node order. The first fragment is the one containing node 0, the second fragment is the one containing the smallest indexed node not in the first fragment, etc.
public final SelectionMolecule[] findFrags()
The original node order is preserved in the returned fragments. Fragment order is also determined by the original node order. The first fragment is the one containing node 0, the second fragment is the one containing the smallest indexed node not in the first fragment, etc.
protected void fillSelectionMolecule(SelectionMolecule s)
s
- the selection moleculepublic void clearCalcResults()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |