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

#include <MolSupplier.h>

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

Public Member Functions

 SDMolSupplier ()
 
 SDMolSupplier (const std::string &fileName, const MolFileParserParams &params=MolFileParserParams())
 
 SDMolSupplier (std::istream *inStream, bool takeOwnership=true, const MolFileParserParams &params=MolFileParserParams())
 
 ~SDMolSupplier () override
 
void init () override
 
void reset () override
 
std::unique_ptr< RWMolnext () override
 
bool atEnd () override
 
void moveTo (unsigned int idx)
 
std::unique_ptr< RWMoloperator[] (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 &params)
 
void setStreamIndices (const std::vector< std::streampos > &locs)
 
- Public Member Functions inherited from RDKit::v2::FileParsers::ForwardSDMolSupplier
 ForwardSDMolSupplier ()
 
 ForwardSDMolSupplier (std::istream *inStream, bool takeOwnership=true, const MolFileParserParams &params=MolFileParserParams())
 
 ~ForwardSDMolSupplier () override
 
void setProcessPropertyLists (bool val)
 
bool getProcessPropertyLists () const
 
bool getEOFHitOnRead () const
 
- 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
 

Detailed Description

Definition at line 159 of file MolSupplier.h.

Constructor & Destructor Documentation

◆ SDMolSupplier() [1/3]

RDKit::v2::FileParsers::SDMolSupplier::SDMolSupplier ( )
inline

Definition at line 173 of file MolSupplier.h.

◆ SDMolSupplier() [2/3]

RDKit::v2::FileParsers::SDMolSupplier::SDMolSupplier ( const std::string &  fileName,
const MolFileParserParams params = MolFileParserParams() 
)
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::v2::FileParsers::SDMolSupplier::SDMolSupplier ( std::istream *  inStream,
bool  takeOwnership = true,
const MolFileParserParams params = MolFileParserParams() 
)
explicit

◆ ~SDMolSupplier()

RDKit::v2::FileParsers::SDMolSupplier::~SDMolSupplier ( )
inlineoverride

Definition at line 192 of file MolSupplier.h.

Member Function Documentation

◆ atEnd()

bool RDKit::v2::FileParsers::SDMolSupplier::atEnd ( )
overridevirtual

◆ getItemText()

std::string RDKit::v2::FileParsers::SDMolSupplier::getItemText ( unsigned int  idx)

returns the text block for a particular item

Parameters
idx- which item to return

◆ init()

void RDKit::v2::FileParsers::SDMolSupplier::init ( )
overridevirtual

◆ length()

unsigned int RDKit::v2::FileParsers::SDMolSupplier::length ( )

◆ moveTo()

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

◆ next()

std::unique_ptr< RWMol > RDKit::v2::FileParsers::SDMolSupplier::next ( )
overridevirtual

◆ operator[]()

std::unique_ptr< RWMol > RDKit::v2::FileParsers::SDMolSupplier::operator[] ( unsigned int  idx)

◆ reset()

void RDKit::v2::FileParsers::SDMolSupplier::reset ( )
overridevirtual

◆ setData() [1/2]

void RDKit::v2::FileParsers::SDMolSupplier::setData ( const std::string &  text)

◆ setData() [2/2]

void RDKit::v2::FileParsers::SDMolSupplier::setData ( const std::string &  text,
const MolFileParserParams params 
)

◆ setStreamIndices()

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.

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: