RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RDKit::SDMolSupplier Class Reference

#include <MolSupplier.h>

Inheritance diagram for RDKit::SDMolSupplier:
RDKit::ForwardSDMolSupplier RDKit::MolSupplier

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 () override
 
void init () override
 
void reset () override
 
ROMolnext () override
 
bool atEnd () override
 
void moveTo (unsigned int idx)
 
ROMoloperator[] (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)
 
 ~ForwardSDMolSupplier () override
 
void init () override
 
void reset () override
 
ROMolnext () override
 
bool atEnd () override
 
void setProcessPropertyLists (bool val)
 
bool getProcessPropertyLists () const
 
bool getEOFHitOnRead () const
 
- Public Member Functions inherited from RDKit::MolSupplier
 MolSupplier ()
 
virtual ~MolSupplier ()
 
virtual void init ()=0
 
virtual void reset ()=0
 
virtual bool atEnd ()=0
 
virtual ROMolnext ()=0
 
virtual void close ()
 

Additional Inherited Members

- Protected Member Functions inherited from RDKit::ForwardSDMolSupplier
virtual void checkForEnd ()
 
ROMol_next ()
 
virtual void readMolProps (ROMol *)
 
- Protected Member Functions inherited from RDKit::MolSupplier
std::istream * openAndCheckStream (const std::string &filename)
 
- Protected Attributes inherited from RDKit::ForwardSDMolSupplier
bool df_end = false
 
int d_line = 0
 
bool df_sanitize = true
 
bool df_removeHs = true
 
bool df_strictParsing = true
 
bool df_processPropertyLists = true
 
bool df_eofHitOnRead = false
 
- Protected Attributes inherited from RDKit::MolSupplier
std::istream * dp_inStream = nullptr
 
bool df_owner = false
 

Detailed Description

Definition at line 158 of file MolSupplier.h.

Constructor & Destructor Documentation

◆ SDMolSupplier() [1/3]

RDKit::SDMolSupplier::SDMolSupplier ( )
inline

Definition at line 172 of file MolSupplier.h.

◆ 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 set to false, 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 ( )
inlineoverride

Definition at line 190 of file MolSupplier.h.

Member Function Documentation

◆ atEnd()

bool RDKit::SDMolSupplier::atEnd ( )
overridevirtual

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 ( )
overridevirtual

Reimplemented from RDKit::ForwardSDMolSupplier.

◆ length()

unsigned int RDKit::SDMolSupplier::length ( )

◆ moveTo()

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

◆ next()

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

Reimplemented from RDKit::ForwardSDMolSupplier.

◆ operator[]()

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

◆ reset()

void RDKit::SDMolSupplier::reset ( )
overridevirtual

Reimplemented from RDKit::ForwardSDMolSupplier.

◆ setData() [1/2]

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

◆ setData() [2/2]

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

◆ 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: