RDKit::SDMolSupplier Class Reference

`#include <MolSupplier.h>`

Inheritance diagram for RDKit::SDMolSupplier:

## Public Member Functions

| SDMolSupplier ()
| SDMolSupplier (const std::string &fileName, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
| SDMolSupplier (std::istream *inStream, bool takeOwnership=true, bool sanitize=true, bool removeHs=true, bool strictParsing=true)
| ~SDMolSupplier ()
void | init ()
void | reset ()
ROMol * | next ()
bool | atEnd ()
void | moveTo (unsigned int idx)
ROMol * | operator[] (unsigned int idx)
std::string | getItemText (unsigned int idx)
| returns the text block for a particular item More...
unsigned int | length ()
void | setData (const std::string &text, bool sanitize=true, bool removeHs=true)
void | setData (const std::string &text, bool sanitize, bool removeHs, bool strictParsing)
void | setStreamIndices (const std::vector< std::streampos > &locs)
Public Member Functions inherited from RDKit::ForwardSDMolSupplier
| ForwardSDMolSupplier ()
| ForwardSDMolSupplier (std::istream *inStream, bool takeOwnership=true, bool sanitize=true, bool removeHs=true, bool strictParsing=false)
virtual | ~ForwardSDMolSupplier ()
Public Member Functions inherited from RDKit::MolSupplier
| MolSupplier ()
virtual | ~MolSupplier ()

## Additional Inherited Members

Protected Member Functions inherited from RDKit::ForwardSDMolSupplier
ROMol * | _next ()
virtual void | readMolProps (ROMol *)
Protected Attributes inherited from RDKit::ForwardSDMolSupplier
bool | df_end
int | d_line
bool | df_sanitize
bool | df_removeHs
bool | df_strictParsing
Protected Attributes inherited from RDKit::MolSupplier
std::istream * | dp_inStream
bool | df_owner

## Detailed Description

Definition at line 108 of file MolSupplier.h.

## Constructor & Destructor Documentation

## SDMolSupplier() [1/3]

RDKit::SDMolSupplier::SDMolSupplier | ( |  | ) |

inline

Definition at line 122 of file MolSupplier.h.

References RDKit::MolSupplier::init(), and RDKit::MolOps::removeHs().

## SDMolSupplier() [2/3]

RDKit::SDMolSupplier::SDMolSupplier | ( | const std::string & | fileName,
|  | bool | sanitize = `true`,
|  | bool | removeHs = `true`,
|  | bool | strictParsing = `true`
| ) |  |

explicit

Parameters

  fileName | - the name of the SD file
  sanitize | - if true sanitize the molecule before returning it
  removeHs | - if true remove Hs from the molecule before returning it (triggers sanitization)
  strictParsing | - if not set, the parser is more lax about correctness of the contents.

## SDMolSupplier() [3/3]

RDKit::SDMolSupplier::SDMolSupplier | ( | std::istream * | inStream,
|  | bool | takeOwnership = `true`,
|  | bool | sanitize = `true`,
|  | bool | removeHs = `true`,
|  | bool | strictParsing = `true`
| ) |  |

explicit

## ~SDMolSupplier()

RDKit::SDMolSupplier::~SDMolSupplier | ( |  | ) |

inline

Definition at line 140 of file MolSupplier.h.

References RDKit::MolSupplier::atEnd(), RDKit::MolSupplier::init(), RDKit::MolSupplier::next(), RDKit::MolOps::removeHs(), and RDKit::MolSupplier::reset().

## Member Function Documentation

## atEnd()

bool RDKit::SDMolSupplier::atEnd | ( |  | ) |

virtual

Reimplemented from RDKit::ForwardSDMolSupplier.

## getItemText()

std::string RDKit::SDMolSupplier::getItemText | ( | unsigned int | idx | ) |

returns the text block for a particular item

Parameters

  idx | - which item to return

## init()

void RDKit::SDMolSupplier::init | ( |  | ) |

virtual

Reimplemented from RDKit::ForwardSDMolSupplier.

## length()

unsigned int RDKit::SDMolSupplier::length | ( |  | ) |

## moveTo()

void RDKit::SDMolSupplier::moveTo | ( | unsigned int | idx | ) |

## next()

ROMol* RDKit::SDMolSupplier::next | ( |  | ) |

virtual

Reimplemented from RDKit::ForwardSDMolSupplier.

## operator[]()

ROMol* RDKit::SDMolSupplier::operator[] | ( | unsigned int | idx | ) |

## reset()

void RDKit::SDMolSupplier::reset | ( |  | ) |

virtual

Reimplemented from RDKit::ForwardSDMolSupplier.

## setData() [1/2]

void RDKit::SDMolSupplier::setData | ( | const std::string & | text,
|  | bool | sanitize = `true`,
|  | bool | removeHs = `true`
| ) |  |

## setData() [2/2]

void RDKit::SDMolSupplier::setData | ( | const std::string & | text,
|  | bool | sanitize,
|  | bool | removeHs,
|  | bool | strictParsing
| ) |  |

## setStreamIndices()

void RDKit::SDMolSupplier::setStreamIndices | ( | const std::vector< std::streampos > & | locs | ) |

Resets our internal state and sets the indices of molecules in the stream. The client should be very careful about calling this method, as it's trivial to end up with a completely useless supplier.

Parameters

  locs | - the vector of stream positions.

Note that this can be used not only to make reading selected molecules from a large SD file much faster, but it can also allow subsetting an SD file or rearranging the order of the molecules.

The documentation for this class was generated from the following file:

- MolSupplier.h