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;
76 std::istream *dp_inStream =
nullptr;
78 bool df_owner =
false;
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();
115 virtual void checkForEnd();
117 virtual void readMolProps(
ROMol *);
120 bool df_sanitize =
true, df_removeHs =
true, df_strictParsing =
true;
121 bool df_processPropertyLists =
true;
122 bool df_eofHitOnRead =
false;
151 explicit SDMolSupplier(
const std::string &fileName,
bool sanitize =
true,
152 bool removeHs =
true,
bool strictParsing =
true);
154 explicit SDMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
155 bool sanitize =
true,
bool removeHs =
true,
156 bool strictParsing =
true);
163 void moveTo(
unsigned int idx);
164 ROMol *operator[](
unsigned int idx);
169 std::string getItemText(
unsigned int idx);
170 unsigned int length();
171 void setData(
const std::string &text,
bool sanitize =
true,
173 void setData(
const std::string &text,
bool sanitize,
bool removeHs,
188 void setStreamIndices(
const std::vector<std::streampos> &locs);
192 void setDataCommon(
const std::string &text,
bool sanitize,
bool removeHs);
195 std::vector<std::streampos> d_molpos;
233 const std::string &delimiter =
" \t",
234 int smilesColumn = 0,
int nameColumn = 1,
235 bool titleLine =
true,
bool sanitize =
true);
238 const std::string &delimiter =
" \t",
239 int smilesColumn = 0,
int nameColumn = 1,
240 bool titleLine =
true,
bool sanitize =
true);
243 void setData(
const std::string &text,
const std::string &delimiter =
" ",
244 int smilesColumn = 0,
int nameColumn = 1,
bool titleLine =
true,
245 bool sanitize =
true);
250 void moveTo(
unsigned int idx);
251 ROMol *operator[](
unsigned int idx);
256 std::string getItemText(
unsigned int idx);
257 unsigned int length();
260 ROMol *processLine(std::string inLine);
261 void processTitleLine();
262 std::string nextLine();
263 long int skipComments();
270 std::vector<std::streampos>
272 std::vector<int> d_lineNums;
274 bool df_sanitize =
true;
276 bool df_title =
true;
308 const std::string &nameRecord =
"",
int confId2D = -1,
309 int confId3D = 0,
bool sanitize =
true);
310 explicit TDTMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
311 const std::string &nameRecord =
"",
int confId2D = -1,
312 int confId3D = 0,
bool sanitize =
true);
315 void setData(
const std::string &text,
const std::string &nameRecord =
"",
316 int confId2D = -1,
int confId3D = 0,
bool sanitize =
true);
321 void moveTo(
unsigned int idx);
322 ROMol *operator[](
unsigned int idx);
327 std::string getItemText(
unsigned int idx);
328 unsigned int length();
331 bool advanceToNextRecord();
333 ROMol *parseMol(std::string inLine);
341 std::vector<std::streampos>
343 bool df_sanitize =
true;
344 std::string d_nameProp =
351 explicit PDBMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
352 bool sanitize =
true,
bool removeHs =
true,
353 unsigned int flavor = 0,
354 bool proximityBonding =
true);
355 explicit PDBMolSupplier(
const std::string &fname,
bool sanitize =
true,
356 bool removeHs =
true,
unsigned int flavor = 0,
357 bool proximityBonding =
true);
360 if (df_owner && dp_inStream)
delete dp_inStream;
364 virtual void reset();
365 virtual ROMol *next();
366 virtual bool atEnd();
372 #ifdef RDK_BUILD_COORDGEN_SUPPORT
382 MaeMolSupplier() { init(); };
384 explicit MaeMolSupplier(std::shared_ptr<std::istream> inStream,
385 bool sanitize =
true,
bool removeHs =
true);
387 explicit MaeMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
388 bool sanitize =
true,
bool removeHs =
true);
390 explicit MaeMolSupplier(
const std::string &fname,
bool sanitize =
true,
393 virtual ~MaeMolSupplier(){
398 virtual void reset();
399 virtual ROMol *next();
400 virtual bool atEnd();
403 bool df_sanitize, df_removeHs;
404 std::shared_ptr<schrodinger::mae::Reader> d_reader;
405 std::shared_ptr<schrodinger::mae::Block> d_next_struct;
406 std::shared_ptr<std::istream> dp_sInStream;
408 #endif // RDK_BUILD_COORDGEN_SUPPORT