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 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 &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::shared_ptr< RWMolgetShared (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)
 
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 &params=MolFileParserParams())
 
 ~ForwardSDMolSupplier () override
 
std::shared_ptr< RWMolnextShared ()
 
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
 

Detailed Description

Definition at line 356 of file MolSupplier.h.

Member Typedef Documentation

◆ iterator

◆ reverse_iterator

Definition at line 368 of file MolSupplier.h.

Constructor & Destructor Documentation

◆ SDMolSupplier() [1/3]

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

Definition at line 370 of file MolSupplier.h.

References init().

◆ 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 389 of file MolSupplier.h.

References RDKit::v2::FileParsers::MolSupplier::close().

Member Function Documentation

◆ atEnd()

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

◆ begin()

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

Definition at line 421 of file MolSupplier.h.

Referenced by rend().

◆ end()

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

Definition at line 422 of file MolSupplier.h.

References length().

Referenced by rbegin().

◆ getCaching()

bool RDKit::v2::FileParsers::SDMolSupplier::getCaching ( ) const
inline

Definition at line 427 of file MolSupplier.h.

◆ 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

◆ getShared()

std::shared_ptr< RWMol > RDKit::v2::FileParsers::SDMolSupplier::getShared ( unsigned int idx)

!

returns a shared pointer to the molecule at the given index.

◆ init()

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

◆ length()

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

Referenced by end().

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

◆ rbegin()

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

Definition at line 423 of file MolSupplier.h.

References end().

◆ rend()

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

Definition at line 424 of file MolSupplier.h.

References begin().

◆ reset()

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

◆ setCaching()

void RDKit::v2::FileParsers::SDMolSupplier::setCaching ( bool val)
inline

Definition at line 426 of file MolSupplier.h.

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