![]() |
RDKit
Open-source cheminformatics and machine learning.
|
#include <MolSupplier.h>
Public Types | |
| using | iterator = RandomAccessSupplierIter<SDMolSupplier> |
| using | reverse_iterator = std::reverse_iterator<iterator> |
| Public Types inherited from RDKit::v2::FileParsers::ForwardSDMolSupplier | |
| using | iterator = ForwardSupplierIter<ForwardSDMolSupplier> |
Public Member Functions | |
| SDMolSupplier () | |
| SDMolSupplier (const std::string &fileName, const MolFileParserParams ¶ms=MolFileParserParams()) | |
| SDMolSupplier (std::istream *inStream, bool takeOwnership=true, const MolFileParserParams ¶ms=MolFileParserParams()) | |
| ~SDMolSupplier () override | |
| void | init () override |
| void | reset () override |
| std::unique_ptr< RWMol > | next () override |
| bool | atEnd () override |
| void | moveTo (unsigned int idx) |
| std::unique_ptr< RWMol > | operator[] (unsigned int idx) |
| std::shared_ptr< RWMol > | getShared (unsigned int idx) |
| ! | |
| std::string | getItemText (unsigned int idx) |
| returns the text block for a particular item | |
| unsigned int | length () |
| void | setData (const std::string &text) |
| void | setData (const std::string &text, const MolFileParserParams ¶ms) |
| void | setStreamIndices (const std::vector< std::streampos > &locs) |
| iterator | begin () |
| iterator | end () |
| reverse_iterator | rbegin () |
| reverse_iterator | rend () |
| void | setCaching (bool val) |
| bool | getCaching () const |
| Public Member Functions inherited from RDKit::v2::FileParsers::ForwardSDMolSupplier | |
| ForwardSDMolSupplier () | |
| ForwardSDMolSupplier (std::istream *inStream, bool takeOwnership=true, const MolFileParserParams ¶ms=MolFileParserParams()) | |
| ~ForwardSDMolSupplier () override | |
| std::shared_ptr< RWMol > | nextShared () |
| void | setProcessPropertyLists (bool val) |
| bool | getProcessPropertyLists () const |
| bool | getEOFHitOnRead () const |
| iterator | begin () |
| iterator | end () |
| Public Member Functions inherited from RDKit::v2::FileParsers::MolSupplier | |
| MolSupplier () | |
| virtual | ~MolSupplier () |
| virtual void | close () |
Additional Inherited Members | |
| Protected Member Functions inherited from RDKit::v2::FileParsers::ForwardSDMolSupplier | |
| std::unique_ptr< RWMol > | _next () |
| virtual void | readMolProps (ROMol &) |
| Protected Member Functions inherited from RDKit::v2::FileParsers::MolSupplier | |
| std::istream * | openAndCheckStream (const std::string &filename) |
| Protected Attributes inherited from RDKit::v2::FileParsers::ForwardSDMolSupplier | |
| bool | df_end = false |
| int | d_line = 0 |
| MolFileParserParams | d_params |
| bool | df_processPropertyLists = true |
| bool | df_eofHitOnRead = false |
| Protected Attributes inherited from RDKit::v2::FileParsers::MolSupplier | |
| std::istream * | dp_inStream = nullptr |
| bool | df_owner = false |
Definition at line 356 of file MolSupplier.h.
Definition at line 367 of file MolSupplier.h.
| using RDKit::v2::FileParsers::SDMolSupplier::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 368 of file MolSupplier.h.
|
inline |
Definition at line 370 of file MolSupplier.h.
References init().
|
explicit |
| 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 set to false, the parser is more lax about correctness of the contents. |
|
explicit |
|
inlineoverride |
Definition at line 389 of file MolSupplier.h.
References RDKit::v2::FileParsers::MolSupplier::close().
|
overridevirtual |
Reimplemented from RDKit::v2::FileParsers::ForwardSDMolSupplier.
|
inline |
Definition at line 421 of file MolSupplier.h.
Referenced by rend().
|
inline |
|
inline |
Definition at line 427 of file MolSupplier.h.
| std::string RDKit::v2::FileParsers::SDMolSupplier::getItemText | ( | unsigned int | idx | ) |
returns the text block for a particular item
| idx | - which item to return |
| std::shared_ptr< RWMol > RDKit::v2::FileParsers::SDMolSupplier::getShared | ( | unsigned int | idx | ) |
!
returns a shared pointer to the molecule at the given index.
|
overridevirtual |
Reimplemented from RDKit::v2::FileParsers::ForwardSDMolSupplier.
Referenced by SDMolSupplier().
| unsigned int RDKit::v2::FileParsers::SDMolSupplier::length | ( | ) |
Referenced by end().
| void RDKit::v2::FileParsers::SDMolSupplier::moveTo | ( | unsigned int | idx | ) |
|
overridevirtual |
Reimplemented from RDKit::v2::FileParsers::ForwardSDMolSupplier.
| std::unique_ptr< RWMol > RDKit::v2::FileParsers::SDMolSupplier::operator[] | ( | unsigned int | idx | ) |
|
inline |
Definition at line 423 of file MolSupplier.h.
References end().
|
inline |
Definition at line 424 of file MolSupplier.h.
References begin().
|
overridevirtual |
Reimplemented from RDKit::v2::FileParsers::ForwardSDMolSupplier.
|
inline |
Definition at line 426 of file MolSupplier.h.
| void RDKit::v2::FileParsers::SDMolSupplier::setData | ( | const std::string & | text | ) |
| void RDKit::v2::FileParsers::SDMolSupplier::setData | ( | const std::string & | text, |
| const MolFileParserParams & | params ) |
| void RDKit::v2::FileParsers::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.
| 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.