11 #ifndef _RD_MOLSUPPLIER_H 12 #define _RD_MOLSUPPLIER_H 23 #ifdef RDK_BUILD_COORDGEN_SUPPORT 24 namespace schrodinger {
30 #endif // RDK_BUILD_COORDGEN_SUPPORT 61 virtual void init() = 0;
62 virtual void reset() = 0;
63 virtual bool atEnd() = 0;
64 virtual ROMol *next() = 0;
92 bool takeOwnership =
true,
bool sanitize =
true,
94 bool strictParsing =
false);
97 if (df_owner && dp_inStream) {
105 virtual void reset();
106 virtual ROMol *next();
107 virtual bool atEnd();
110 virtual void checkForEnd();
112 virtual void readMolProps(
ROMol *);
144 explicit SDMolSupplier(
const std::string &fileName,
bool sanitize =
true,
145 bool removeHs =
true,
bool strictParsing =
true);
147 explicit SDMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
148 bool sanitize =
true,
bool removeHs =
true,
149 bool strictParsing =
true);
156 void moveTo(
unsigned int idx);
157 ROMol *operator[](
unsigned int idx);
162 std::string getItemText(
unsigned int idx);
163 unsigned int length();
164 void setData(
const std::string &text,
bool sanitize =
true,
166 void setData(
const std::string &text,
bool sanitize,
bool removeHs,
181 void setStreamIndices(
const std::vector<std::streampos> &locs);
185 void setDataCommon(
const std::string &text,
bool sanitize,
bool removeHs);
188 std::vector<std::streampos> d_molpos;
226 const std::string &delimiter =
" \t",
227 int smilesColumn = 0,
int nameColumn = 1,
228 bool titleLine =
true,
bool sanitize =
true);
231 const std::string &delimiter =
" \t",
232 int smilesColumn = 0,
int nameColumn = 1,
233 bool titleLine =
true,
bool sanitize =
true);
236 void setData(
const std::string &text,
const std::string &delimiter =
" ",
237 int smilesColumn = 0,
int nameColumn = 1,
bool titleLine =
true,
238 bool sanitize =
true);
243 void moveTo(
unsigned int idx);
244 ROMol *operator[](
unsigned int idx);
249 std::string getItemText(
unsigned int idx);
250 unsigned int length();
253 ROMol *processLine(std::string inLine);
254 void processTitleLine();
255 std::string nextLine();
256 long int skipComments();
263 std::vector<std::streampos>
265 std::vector<int> d_lineNums;
301 const std::string &nameRecord =
"",
int confId2D = -1,
302 int confId3D = 0,
bool sanitize =
true);
303 explicit TDTMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
304 const std::string &nameRecord =
"",
int confId2D = -1,
305 int confId3D = 0,
bool sanitize =
true);
308 void setData(
const std::string &text,
const std::string &nameRecord =
"",
309 int confId2D = -1,
int confId3D = 0,
bool sanitize =
true);
314 void moveTo(
unsigned int idx);
315 ROMol *operator[](
unsigned int idx);
320 std::string getItemText(
unsigned int idx);
321 unsigned int length();
324 bool advanceToNextRecord();
326 ROMol *parseMol(std::string inLine);
334 std::vector<std::streampos>
337 std::string d_nameProp;
343 explicit PDBMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
344 bool sanitize =
true,
bool removeHs =
true,
345 unsigned int flavor = 0,
346 bool proximityBonding =
true);
347 explicit PDBMolSupplier(
const std::string &fname,
bool sanitize =
true,
348 bool removeHs =
true,
unsigned int flavor = 0,
349 bool proximityBonding =
true);
352 if (df_owner && dp_inStream)
delete dp_inStream;
356 virtual void reset();
357 virtual ROMol *next();
358 virtual bool atEnd();
364 #ifdef RDK_BUILD_COORDGEN_SUPPORT 368 MaeMolSupplier() { init(); };
369 explicit MaeMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
370 bool sanitize =
true,
bool removeHs =
true);
371 explicit MaeMolSupplier(
const std::string &fname,
bool sanitize =
true,
374 virtual ~MaeMolSupplier() {
375 if (df_owner && dp_inStream)
delete dp_inStream;
379 virtual void reset();
380 virtual ROMol *next();
381 virtual bool atEnd();
384 bool df_sanitize, df_removeHs;
385 std::shared_ptr<schrodinger::mae::Reader> d_reader;
386 std::shared_ptr<schrodinger::mae::Block> d_next_struct;
388 #endif // RDK_BUILD_COORDGEN_SUPPORT
#define RDKIT_FILEPARSERS_EXPORT
RDKIT_GRAPHMOL_EXPORT ROMol * removeHs(const ROMol &mol, bool implicitOnly=false, bool updateExplicitCount=false, bool sanitize=true)
returns a copy of a molecule with hydrogens removed
virtual ~PDBMolSupplier()
lazy file parser for TDT files
Defines the primary molecule class ROMol as well as associated typedefs.
virtual ~ForwardSDMolSupplier()
std::istream * dp_inStream
lazy file parser for Smiles tables
lazy file parser for PDB files
RDKIT_FILEPARSERS_EXPORT std::string strip(const std::string &orig)
std::vector< std::string > STR_VECT