public class MDLV2000Reader
extends org.openscience.cdk.io.DefaultChemObjectReader
IAtomContainer
or IChemModel
from an MDL molfile, and a IChemFile
from a SD file, with a IChemSequence
of IChemModel
's, where each IChemModel will contain one IMolecule.
From the Atom block it reads atomic coordinates, element types and formal charges. From the Bond block it reads the bonds and the orders. Additionally, it reads 'M CHG', 'G ', 'M RAD' and 'M ISO' lines from the property block.
If all z coordinates are 0.0, then the xy coordinates are taken as 2D, otherwise the coordinates are read as 3D.
The title of the MOL file is read and can be retrieved with:
molecule.getProperty(CDKConstants.TITLE);
RGroups which are saved in the MDL molfile as R#, are renamed according to their appearance, e.g. the first R# is named R1. With PseudAtom.getLabel() "R1" is returned (instead of R#). This is introduced due to the SAR table generation procedure of Scitegics PipelinePilot.
Constructor and Description |
---|
MDLV2000Reader() |
MDLV2000Reader(java.io.InputStream in)
Constructs a new MDLReader that can read Molecule from a given
InputStream.
|
MDLV2000Reader(java.io.InputStream in,
org.openscience.cdk.io.IChemObjectReader.Mode mode) |
MDLV2000Reader(java.io.Reader in)
Constructs a new MDLReader that can read Molecule from a given Reader.
|
MDLV2000Reader(java.io.Reader in,
org.openscience.cdk.io.IChemObjectReader.Mode mode) |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(java.lang.Class<? extends org.openscience.cdk.interfaces.IChemObject> classObject) |
void |
close() |
void |
customizeJob() |
org.openscience.cdk.io.formats.IResourceFormat |
getFormat() |
<T extends org.openscience.cdk.interfaces.IChemObject> |
read(T object)
Takes an object which subclasses IChemObject, e.g.
|
void |
setReader(java.io.InputStream input) |
void |
setReader(java.io.Reader input) |
fireFrameRead, handleError, handleError, handleError, handleError, setErrorHandler, setReaderMode
addChemObjectIOListener, addSetting, addSettings, fireIOSettingQuestion, getIOSettings, getListeners, getSetting, getSetting, getSettings, hasSetting, removeChemObjectIOListener
public MDLV2000Reader()
public MDLV2000Reader(java.io.InputStream in)
in
- The InputStream to read frompublic MDLV2000Reader(java.io.InputStream in, org.openscience.cdk.io.IChemObjectReader.Mode mode)
in
- mode
- public MDLV2000Reader(java.io.Reader in)
in
- The Reader to read frompublic MDLV2000Reader(java.io.Reader in, org.openscience.cdk.io.IChemObjectReader.Mode mode)
in
- mode
- public org.openscience.cdk.io.formats.IResourceFormat getFormat()
public void setReader(java.io.Reader input) throws org.openscience.cdk.exception.CDKException
input
- org.openscience.cdk.exception.CDKException
public void setReader(java.io.InputStream input) throws org.openscience.cdk.exception.CDKException
input
- org.openscience.cdk.exception.CDKException
public boolean accepts(java.lang.Class<? extends org.openscience.cdk.interfaces.IChemObject> classObject)
classObject
- public <T extends org.openscience.cdk.interfaces.IChemObject> T read(T object) throws org.openscience.cdk.exception.CDKException
T
- object
- The object that subclasses IChemObjectorg.openscience.cdk.exception.CDKException
public void close() throws java.io.IOException
java.io.IOException
public void customizeJob()