Molecule I/O

Molecule I/O

SDFile

sdfilereader(file::IO)

Read SDFile data from input stream and return a lazy iterator which 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

function customsupplier()
    mol = try
        parse(SDFile, block)
    catch e
        throw(ErrorException("incompatible molecule found, aborting..."))
    end
    return defaultpostprocess(mol)
end

function sdfilereader(file::IO)
    return SDFileReader(eachline(file), customsupplier)
end
source
sdfilereader(path::AbstractString)

Read a SDFile and return a lazy iterator which yields molecule objects.

source
sdftomol(file::IO)

Read a SDFile mol block from the input stream and parse it into a molecule object.

source
sdftomol(path::AbstractString)

Read a SDFile and parse it into a molecule object. Single mol block files without optional information are often provided as a .mol file.

source
Base.parseMethod.
parse(::Type{SDFile}, lines)

Parse lines of a SDFile mol block data into a molecule object.

source