RDKit: RDKit::SDMolSupplier Class Reference

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
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

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

Definition at line 122 of file MolSupplier.h.

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

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.

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

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

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

Reimplemented from RDKit::ForwardSDMolSupplier.

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

returns the text block for a particular item

Parameters

  idx | - which item to return

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

Reimplemented from RDKit::ForwardSDMolSupplier.

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

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

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

Reimplemented from RDKit::ForwardSDMolSupplier.

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

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

Reimplemented from RDKit::ForwardSDMolSupplier.

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

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

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