|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.struc.MoleculeGraph
chemaxon.struc.Molecule
public class Molecule
Molecule class. A MoleculeGraph that may also contain S-groups.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class chemaxon.struc.MoleculeGraph |
---|
MoleculeGraph.ValenceCheckState |
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 interface chemaxon.struc.StereoConstants |
---|
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 |
Constructor Summary | |
---|---|
Molecule()
Construct a 2 dimensional 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 molecule consisting of a single atom (node). |
|
Molecule(Molecule p,
MolBond b)
Construct a molecule consisting of a single bond (edge). |
Method Summary | |
---|---|
protected void |
addAtom0(MolAtom node)
Adds an atom. |
protected void |
addAtomToFragment(MolAtom atom)
Adds an atom to a fragment. |
protected void |
addBond0(MolBond bond)
Adds a bond. |
void |
addSgroup(Sgroup sg,
boolean setparent)
Adds an S-group to this object. |
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)
Aromatizes molecule. |
void |
aromatize(int method,
boolean checkAmbiguity)
Aromatizes 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()
Deprecated. |
protected void |
checkSgroupConsistency()
Checks the internal consisitency of S-groups. |
void |
clear()
Clears the molecule. |
void |
clearExtraLabels()
Clears extra atom labels. |
void |
clearForImport(java.lang.String format)
Initializes molecule for import. |
void |
clearObjects()
|
void |
clearProperties()
Clears RDfile/SDfile properties. |
java.lang.Object |
clone()
Makes an identical copy of the molecule. |
void |
clonecopy(int[] iatoms,
MoleculeGraph g)
Copies the specified atoms and bonds of this molecule to another one. |
void |
clonecopy(MoleculeGraph g)
Makes another molecule identical to this one. |
protected void |
clonecopyWithoutSgroups(Molecule m)
Copies the all the contents except the S-groups into another molecule object. |
void |
clonelesscopy(MoleculeGraph 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(MolAtom atom)
Checks if the molecule graph contains the specified atom. |
boolean |
contractSgroups()
Contracts all S-groups. |
Molecule[] |
convertToFrags()
Converts this molecule to its disconnected fragments, expanding all S-groups and keeping disconnected Multicenter S-groups in the same fragment, but ungroupping and separating fragments in all other types of S-groups. |
int |
countExpandableContractableSgroups()
Counts the expandable and contractable S-groups. |
int |
countOrderedComponentSgroups()
Counts the ordered component S-groups. |
protected chemaxon.struc.gearch.MoleculeGraphGearch |
createGearch()
|
boolean |
dearomatize()
Dearomatize molecule. |
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)
Deprecated. As of release 5.7, replaced by MolExporter.exportToBinFormat(Molecule, String) |
java.lang.String |
exportToFormat(java.lang.String fmt)
Deprecated. As of release 5.7, replaced by MolExporter.exportToFormat(Molecule, String) |
java.lang.Object |
exportToObject(java.lang.String fmt)
Deprecated. As of release 5.7, replaced by MolExporter.exportToObject(Molecule, String) |
protected void |
fillSelectionMolecule(SelectionMolecule s)
Adds all atoms and bonds to the specified molecule. |
Sgroup[] |
findAllSgroupContaining(MolAtom a)
Finds all smallest S-groups containing the specified atom. |
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. |
Sgroup |
findSgroupContaining(MolAtom a)
Finds the largest S-group that contains the specified atom. |
Sgroup |
findSgroupOf(MolAtom a)
Finds the smallest S-group related to the specified atom. |
Sgroup |
findSmallestSgroupContaining(MolAtom a)
Finds the smallest S-group that contains the specified atom. |
protected boolean |
fixSelfReferringProperty(MProp prop)
Fix a property containing reference to the molecule. |
java.util.List<MObject> |
getAllObjects()
|
java.lang.String |
getComment()
Gets the comment. |
long |
getEndPosition()
Gets the end position of this molecule in the input file. |
int |
getFreeAttachmentPoints(java.lang.Integer atom)
Calculates the available attachment point value for an atom based on the possible attachment point value and occupied attachment point value. |
int |
getFreeAttachmentPoints(MolAtom atom)
|
protected SelectionMolecule |
getGraphUnionAsSelection()
Gets a selection molecule containing all the atoms and bonds. |
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 that was set by setName(String) . |
int |
getObjectCount()
|
java.lang.String |
getProperty(java.lang.String key)
Deprecated. as of Marvin 5.7 replaced by MPropHandler.convertToString(MProp, String) ,
the following usage will give the same results:
String property = MPropHandler.convertToString(mol.properties(), key); |
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[] |
getRootSgroups()
Gets root s-groups (groups that are not embedded into another s-group). |
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). |
protected boolean |
implicitizeHydrogens0(int f,
MolAtom[] atoms,
boolean check)
Deprecated. as of Marvin 5.7 replaced by Hydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean) |
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. |
boolean |
isMolecule()
Checks if the object is an instance of Molecule or not. |
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(MoleculeGraph g)
Copies some properties of this molecule to the other one specified as argument. |
void |
mergeAtoms(MolAtom that,
MolAtom node)
Merges bonds of an atom with another atom, then adds the atom to the molecule. |
void |
mergeFrags()
Deprecated. since 5.6, it was used by an internal method, not intended for public usage. |
MoleculeGraph |
newInstance()
Creates a new Molecule object. |
SelectionMolecule |
newSelectionMolecule()
Creates a new SelectionMolecule object appropriate for storing selection from this molecule. |
void |
removeAll()
Removes all the atoms and bonds. |
void |
removeAllBonds()
Removes all bonds. |
protected void |
removeAllSgroups()
Removes all S-groups. |
void |
removeAtom(int i,
int cleanupFlags)
Removes an atom and its bonds by index. |
void |
removeAtom(MolAtom atom,
int cleanupFlags)
Removes an atom and its bonds by reference. |
protected void |
removeBond(int i,
int cleanupFlags)
Removes a bond by index. |
protected void |
removeBond(MolBond bond,
int cleanupFlags)
Removes a bond by reference. |
void |
removeObject(MObject mo)
|
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. |
void |
replaceSgroup(Sgroup sgroup,
Sgroup newSgroup)
Replaces an S-group with a new sgroup in the 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 |
selectAllObjects(boolean s)
|
protected void |
setAtom0(int i,
MolAtom node)
Sets the atom at the specified index. |
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 |
setGUIContracted(boolean v,
int opts)
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. |
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)
Deprecated. As of release 5.7, replaced by MolExporter.exportToBinFormat(Molecule, String) |
java.lang.String |
toFormat(java.lang.String fmt)
Deprecated. As of release 5.7, replaced by MolExporter.exportToFormat(Molecule, String) |
java.lang.Object |
toObject(java.lang.String fmt)
Deprecated. As of release 5.7, replaced by MolExporter.exportToObject(Molecule, String) |
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)
Ungroups the specified S-group and expands it if it is an Expandable S-group. |
boolean |
ungroupSgroup(Sgroup sg,
int opts)
Expand and ungroup the specified S-group. |
boolean |
ungroupSgroups()
Expand and ungroup all S-groups. |
boolean |
ungroupSgroups(int type)
Ungroups all S-groups of a specified type in this molecule. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int RMCLEANUP_SGROUPATOMS
removeAtom(MolAtom, int)
,
removeAtom(int, int)
,
MoleculeGraph.RMCLEANUP_ALL
,
Constant Field Valuespublic static final int RMCLEANUP_FROMSGROUPS
removeAtom(MolAtom, int)
,
removeAtom(int, int)
,
MoleculeGraph.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 valuepublic Molecule(Molecule p, MolAtom a)
p
- the parent structurea
- the atompublic Molecule(Molecule p, MolBond b)
p
- the parent structureb
- the bondpublic Molecule()
Method Detail |
---|
public void setDim(int d)
setDim
in class MoleculeGraph
d
- 0, 2, or 3MoleculeGraph.getFlags()
public void clear()
clear
in class MoleculeGraph
MoleculeGraph.clearForImport(java.lang.String)
,
MoleculeGraph.theAtoms
public void clearForImport(java.lang.String format)
clearForImport
in class MoleculeGraph
format
- input file formatMoleculeGraph.theBonds
,
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()
setName(String)
.
getName
in interface Incomplecule
getName
in class MoleculeGraph
public void setName(java.lang.String s)
s
- the molecule name, empty string or null
(null is equivalent to empty string)public java.lang.String getComment()
public 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
@Deprecated public java.lang.String getProperty(java.lang.String key)
MPropHandler.convertToString(MProp, String)
,
the following usage will give the same results:
String property = MPropHandler.convertToString(mol.properties(), 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 setAtom0(int i, MolAtom node)
setAtom0
in class MoleculeGraph
i
- the atom indexnode
- the atompublic void removeAtom(MolAtom atom, int cleanupFlags)
MoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.
removeAtom
in class MoleculeGraph
atom
- the atomcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
,
RMCLEANUP_FROMSGROUPS
public void removeAtom(int i, int cleanupFlags)
MoleculeGraph.removeAtom(MolAtom)
instead unless you are sure what you are doing.
removeAtom
in class MoleculeGraph
i
- the atom indexcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
,
RMCLEANUP_FROMSGROUPS
protected void removeBond(MolBond bond, int cleanupFlags)
removeBond
in class MoleculeGraph
bond
- the bondcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
protected void removeBond(int i, int cleanupFlags)
removeBond
in class MoleculeGraph
i
- the bond indexcleanupFlags
- extra clean-up methodsMoleculeGraph.RMCLEANUP_NONE
,
MoleculeGraph.RMCLEANUP_ALL
,
MoleculeGraph.RMCLEANUP_EDGES
,
MoleculeGraph.RMCLEANUP_STEREO
public void removeAllBonds()
removeAllBonds
in class MoleculeGraph
public void removeAll()
removeAll
in class MoleculeGraph
public boolean isEmpty()
isEmpty
in class MoleculeGraph
true
if the molecule graph does not contain any atoms,
bonds or non-empty S-groups, false
otherwisepublic void aromatize(int method)
aromatize
in class MoleculeGraph
method
- Specifies the algorithm for aromatization.
java.lang.SecurityException
- cannot load module because of a security
problem (firewall)MoleculeGraph.AROM_BASIC
,
MoleculeGraph.AROM_GENERAL
,
MoleculeGraph.AROM_LOOSE
,
Document about aromatizationpublic void aromatize(int method, boolean checkAmbiguity)
aromatize
in class MoleculeGraph
method
- Specifies the algorithm for aromatization.checkAmbiguity
- Specifies whether ANY bonds should be considered
during aromatization.
java.lang.SecurityException
- cannot load module because of a security
problem (firewall)MoleculeGraph.AROM_BASIC
,
MoleculeGraph.AROM_GENERAL
,
MoleculeGraph.AROM_LOOSE
,
Document about aromatizationpublic boolean dearomatize()
dearomatize
in class MoleculeGraph
java.lang.SecurityException
- cannot load module because of a security
problem (firewall)public void clonecopy(MoleculeGraph g)
clonecopy
in class MoleculeGraph
g
- the target moleculeprotected boolean fixSelfReferringProperty(MProp prop)
fixSelfReferringProperty
in class MoleculeGraph
prop
- the propertyMoleculeGraph.clonecopy(MoleculeGraph)
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 MoleculeGraph
iatoms
- array of atom indices to copy or null
g
- the target molecule graphprotected void clonecopyWithoutSgroups(Molecule m)
m
- the target moleculepublic void clonelesscopy(MoleculeGraph g)
clonelesscopy
in class MoleculeGraph
g
- the target molecule object (the selection)public Molecule cloneMoleculeWithDocument()
public Molecule cloneMolecule()
public final java.lang.Object clone()
clone
in class MoleculeGraph
@Deprecated public final java.lang.String toFormat(java.lang.String fmt)
MolExporter.exportToFormat(Molecule, String)
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)
@Deprecated public final java.lang.String exportToFormat(java.lang.String fmt) throws MolExportException
MolExporter.exportToFormat(Molecule, String)
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)
@Deprecated public final byte[] toBinFormat(java.lang.String fmt)
MolExporter.exportToBinFormat(Molecule, String)
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 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)
@Deprecated public final byte[] exportToBinFormat(java.lang.String fmt) throws MolExportException
MolExporter.exportToBinFormat(Molecule, String)
toBinFormat(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).toBinFormat(String)
@Deprecated public java.lang.Object toObject(java.lang.String fmt)
MolExporter.exportToObject(Molecule, String)
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)
@Deprecated public java.lang.Object exportToObject(java.lang.String fmt) throws MolExportException
MolExporter.exportToObject(Molecule, String)
toObject(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).toObject(String)
public MolAtom reuseAtom(int z, int i)
z
- the atomic numberi
- the atom index
public void endReuse(int n)
n
- number of atomspublic MoleculeGraph newInstance()
newInstance
in class MoleculeGraph
public SelectionMolecule newSelectionMolecule()
protected void makeItSimilar(MoleculeGraph g)
makeItSimilar
in class MoleculeGraph
g
- the molecule to changepublic final Molecule getSimplifiedMolecule()
this
usually. In case of RgMolecule
, it returns the simply modified
root structure if there are no R-groups present.
It can simplify the molecule only if there is no parent document
containing other objects.
protected Molecule getMostSimplifiedMolecule()
this
usually.
In case of RgMolecule
, it returns the root structure if there
are no R-groups present.
this
in the default implementationpublic boolean isMolecule()
x.isMolecule()
is equivalent to x instanceof Molecule
,
only faster.
isMolecule
in class MoleculeGraph
public boolean isReaction()
public boolean canBeReactionComponent()
true
true
if it can be a reactant, product or agent,
false
if adding it to an RxnMolecule
is not
supportedpublic boolean isSgroup()
public MolAtom[] getSgroupLigands()
public final Sgroup findExpandableSgroup()
public final Sgroup findContractableSgroup()
public final Sgroup[] getSgroupArray()
Warning! Expansion or contraction of an S-group in this array may invalidate other array elements. Examples:
public final int getSgroupCount()
public final int countExpandableContractableSgroups()
public final int countOrderedComponentSgroups()
public final Sgroup getSgroup(int i)
i
- S-group indexpublic final Sgroup[] getSortedSgroups()
Warning! Expansion or contraction of an S-group in this array may invalidate other array elements. Examples:
public final Sgroup[] getRootSgroups()
public void sortSgroupXBonds()
public final int indexOf(Sgroup sg)
sg
- the S-grouppublic final Sgroup findSgroupOf(MolAtom a)
a
- the atom
public final Sgroup findSgroupContaining(MolAtom a)
a
- the atom
public final Sgroup findSmallestSgroupContaining(MolAtom a)
a
- the atom
public Sgroup[] findAllSgroupContaining(MolAtom a)
a
- the atom
public boolean contains(MolAtom atom)
contains
in class MoleculeGraph
atom
- the atom
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 mergeAtoms(MolAtom that, MolAtom node)
mergeAtoms
in class MoleculeGraph
that
- the atomnode
- the other atomprotected void addAtom0(MolAtom node)
addAtom0
in class MoleculeGraph
node
- the atom referenceprotected void addAtomToFragment(MolAtom atom)
addAtomToFragment
in class MoleculeGraph
atom
- the atom referenceprotected void addBond0(MolBond bond)
addBond0
in class MoleculeGraph
bond
- the bond referencepublic final boolean contractSgroups()
public final boolean expandSgroups()
expandSgroups(int)
public final boolean expandSgroups(int opts)
opts
- expansion options
Expandable.expand(int)
,
Expandable.DEFAULT_OPTIONS
,
Expandable.MDL_EXPAND
,
Expandable.REVERSIBLE_EXPAND
public final boolean isExpandable(int opts)
opts
- expansion options
Expandable.DEFAULT_OPTIONS
,
Expandable.REVERSIBLE_EXPAND
public final void setGUIContracted(boolean v)
v
- true in case of GUI usage, false for other casespublic final void setGUIContracted(boolean v, int opts)
v
- true in case of GUI usage, false for other casesopts
- option for updating coordinatesExpandable.COORDS_UPDATE
public final boolean isGUIContracted()
public final boolean ungroupSgroup(Sgroup sg)
sg
- the S-group
RECURSIVE_UNGROUP
,
ungroupSgroup(int)
public final boolean ungroupSgroup(Sgroup sg, int opts)
sg
- the S-groupopts
- option to specify the ungroup type
RECURSIVE_UNGROUP
,
DEFAULT_UNGROUP
,
ungroupSgroup(int, int)
public final boolean ungroupSgroup(int i)
i
- the S-group index
ungroupSgroup(chemaxon.struc.Sgroup)
,
RECURSIVE_UNGROUP
public final boolean ungroupSgroups(int type)
type
- the S-group type that specifies which S-groups to ungroup.
ungroupSgroup(Sgroup sg)
public final boolean ungroupSgroup(int i, int opts)
i
- the S-group indexopts
- option to specify the ungroup type
RECURSIVE_UNGROUP
,
DEFAULT_UNGROUP
,
ungroupSgroup(chemaxon.struc.Sgroup)
public final boolean ungroupSgroups()
protected final void addSgroupsOf(Molecule m)
protected final void removeSgroupsOf(Molecule m, int rmflags)
m
- the molecule whose S-groups are to removermflags
- removal flagsRMSG_DEFAULT
,
RMSG_KEEP_CHILDREN
,
RMSG_KEEP_PARENT
protected final void removeSgroupsOf(Molecule m)
protected void removeAllSgroups()
protected void removeSgroupFromList(Sgroup sg)
public void addSgroup(Sgroup sg, boolean setparent)
sg
- the S-group to add.setparent
- if true then the parent of the S-group is set to this molecule
and the S-group is removed from the old parent molecule.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 atom order is preserved in the returned fragments. Fragment order is also determined by the original atom order. The first fragment is the one containing atom 0, the second fragment is the one containing the smallest indexed atom not in the first fragment, etc.
MoleculeGraph.findFrags(Class, int)
public final SelectionMolecule[] findFrags()
The original atom order is preserved in the returned fragments. Fragment order is also determined by the original atom order. The first fragment is the one containing atom 0, the second fragment is the one containing the smallest indexed atom not in the first fragment, etc.
protected void fillSelectionMolecule(SelectionMolecule s)
s
- the selection moleculepublic void clearExtraLabels()
public void checkConsistency()
checkConsistency
in class MoleculeGraph
java.lang.RuntimeException
- if inconsistency foundprotected void checkSgroupConsistency()
java.lang.RuntimeException
- if inconsistency foundpublic double[] getVisibleCoords(MolAtom ma)
getVisibleCoords
in class MoleculeGraph
ma
- The atom to be queried.
public void transform(CTransform3D t, boolean incg)
transform
in class MoleculeGraph
t
- the transformation matrixincg
- graph invariants are changed (true) or not (false)public chemaxon.struc.sgroup.MulticenterSgroup findContainingMulticenterSgroup(MolAtom atom)
atom
- the multicenter atom.
MulticenterSgroup
,
MolAtom.MULTICENTER
protected chemaxon.struc.gearch.MoleculeGraphGearch createGearch()
createGearch
in class MoleculeGraph
public void clearObjects()
clearObjects
in interface chemaxon.struc.MObjectContainer
public int getObjectCount()
getObjectCount
in interface chemaxon.struc.MObjectContainer
public void removeObject(MObject mo)
removeObject
in interface chemaxon.struc.MObjectContainer
public void selectAllObjects(boolean s)
selectAllObjects
in interface chemaxon.struc.MObjectContainer
public java.util.List<MObject> getAllObjects()
getAllObjects
in interface chemaxon.struc.MObjectContainer
public void replaceSgroup(Sgroup sgroup, Sgroup newSgroup)
sgroup
- the sgroup to replacenewSgroup
- the sgroup to replace withprotected boolean implicitizeHydrogens0(int f, MolAtom[] atoms, boolean check)
Hydrogenize.convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean)
implicitizeHydrogens0
in class MoleculeGraph
@Deprecated public void mergeFrags()
mergeFrags
in class MoleculeGraph
public int getFreeAttachmentPoints(java.lang.Integer atom)
atom
- the atom to calculate the available attachment point value for
public int getFreeAttachmentPoints(MolAtom atom)
MoleculeGraph
getFreeAttachmentPoints
in interface chemaxon.core.calculations.valencecheck.MoleculeWithValence<MolAtom>
getFreeAttachmentPoints
in class MoleculeGraph
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |