Molecule I/O

SDFile reader

MolecularGraph.rxntoreactionMethod
rxntoreaction(::Type{T}, io::IO) -> T
rxntoreaction(io::IO) -> Reaction{SDFMolGraph}
rxntoreaction(::Type{T}, path::AbstractString) -> T
rxntoreaction(path::AbstractString) -> Reaction{SDFMolGraph}

Read a RXN file and parse it into a reaction object with the given type. The given argument should be a file input stream or a file path.

source
MolecularGraph.sdfilereaderMethod
sdfilereader(file::IO)
sdfilereader(path::AbstractString)

Read SDFile data from input stream (or a file path as a string) and return a lazy iterator that yields molecule objects.

sdfilereader does not stop and raise errors when an erroneous or incompatible SDFile block is read but produces an error message and yields an empty molecule. If this behavior is not desirable, you can use the customized supplier function instead of default supplier nohaltsupplier

source
MolecularGraph.sdfilescannerMethod
sdfilescanner(file::IO)
sdfilescanner(path::AbstractString)

Read SDFile data from input stream (or a file path as a string) and return a lazy iterator that yields metadata.

source
MolecularGraph.sdftomolMethod
sdftomol(::Type{T}, io::IO) -> T
sdftomol(io::IO) -> SDFMolGraph
sdftomol(::Type{T}, path::AbstractString) -> T
sdftomol(path::AbstractString) -> SDFMolGraph

Read a SDFile(.sdf or .mol) and parse it into a molecule object with the given type. The given argument should be a file input stream or a file path.

source

SDFile writer

MolecularGraph.sdfilewriterMethod
sdfilewriter(io::IO, mols)
sdfilewriter(filename::AbstractString, mols)

Write molecule data to the output stream as a SDFile format file.

source

SMILES/SMARTS reader

MolecularGraph.smilestomolMethod
smilestomol(smiles::AbstractString) -> GraphMol{SmilesAtom,SmilesBond}

Parse SMILES string into GraphMol object.

The syntax of SMILES in this library follows both Daylight SMILES and OpenSMILES.

References

  1. OpenSMILES Specification http://opensmiles.org/spec/open-smiles.html
  2. Daylight Tutorials https://www.daylight.com/dayhtml_tutorials/index.html
source