@PublicAPI @Beta public final class MoleculeIo extends 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 Function<Molecule,String> |
molExporterToSmilesFunction()
Convert a
Molecule to SMILES. |
static Function<String,Molecule> |
molImporterFromSourceFunction()
Import a
String source into a Molecule. |
static Molecule |
molImporterImport(String source)
Import
Molecule from source String. |
static CloseableIterator<Molecule> |
molImporterIterateMolecules(InputStream is)
|
static SmilesMemoizingMoleculeIterator |
molImporterMemoizingIterator(CloseableIterator<Molecule> base,
Consumer<Exception> errorHandler)
|
public static Function<Molecule,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.
Functionpublic static Function<String,Molecule> molImporterFromSourceFunction()
String source into a Molecule.Functionpublic static Molecule molImporterImport(String source)
Molecule from source String.source - SourceMoleculeIllegalArgumentException - when MolImporter.importMol(java.lang.String) failedpublic static CloseableIterator<Molecule> molImporterIterateMolecules(InputStream is) throws IOException
is - Delegated to MolImporter.MolImporter(java.io.InputStream)IOException - propagated from MolImporter.MolImporter(java.io.InputStream)public static SmilesMemoizingMoleculeIterator molImporterMemoizingIterator(CloseableIterator<Molecule> base, Consumer<Exception> errorHandler)
base - Base CloseableIteratorerrorHandler - 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