@PublicAPI @Beta public final class MoleculeIo extends java.lang.Object
Molecule
IO related functions.
Please note that this class is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.
Modifier and Type | Method and Description |
---|---|
static java.util.function.Function<Molecule,java.lang.String> |
molExporterToSmilesFunction()
Convert a
Molecule to SMILES . |
static java.util.function.Function<java.lang.String,Molecule> |
molImporterFromSourceFunction()
Import a
String source into a Molecule . |
static Molecule |
molImporterImport(java.lang.String source)
Import
Molecule from source String . |
static CloseableIterator<Molecule> |
molImporterIterateMolecules(java.io.InputStream is)
|
static SmilesMemoizingMoleculeIterator |
molImporterMemoizingIterator(CloseableIterator<Molecule> base,
java.util.function.Consumer<java.lang.Exception> errorHandler)
|
public static java.util.function.Function<Molecule,java.lang.String> molExporterToSmilesFunction()
Molecule
to SMILES
.
Delegate MolExporter.exportToFormat(chemaxon.struc.Molecule, java.lang.String)
with options
smiles:n
to preserve name. Please note that the current implementation contains limitations of the
representable structures. For example only a set of atoms (see 3.4.2 Aromaticity from
http://www.daylight.com/dayhtml/doc/theory/theory.smiles.html) can be part of an aromatic ring.
The implementation throws IllegalArgumentException
when SMILES conversion failed.
Function
public static java.util.function.Function<java.lang.String,Molecule> molImporterFromSourceFunction()
String
source into a Molecule
.Function
public static Molecule molImporterImport(java.lang.String source)
Molecule
from source String
.source
- SourceMolecule
java.lang.IllegalArgumentException
- when MolImporter.importMol(java.lang.String)
failedpublic static CloseableIterator<Molecule> molImporterIterateMolecules(java.io.InputStream is) throws java.io.IOException
is
- Delegated to MolImporter.MolImporter(java.io.InputStream)
java.io.IOException
- propagated from MolImporter.MolImporter(java.io.InputStream)
public static SmilesMemoizingMoleculeIterator molImporterMemoizingIterator(CloseableIterator<Molecule> base, java.util.function.Consumer<java.lang.Exception> errorHandler)
base
- Base CloseableIterator
errorHandler
- Error handler to pass to SmilesMemoizingMoleculeIterator#SmilesMemoizingMoleculeIterator(com.chemaxon.calculations.io.CloseableIterator, com.google.common.base.Function, com.chemaxon.calculations.io.Sink)
Errors are expected during the execution of SMILES conversion of iterated structures for memoization