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 df_processPropertyLists = val;
113 return df_processPropertyLists;
117 virtual void checkForEnd();
119 virtual void readMolProps(
ROMol *);
152 explicit SDMolSupplier(
const std::string &fileName,
bool sanitize =
true,
153 bool removeHs =
true,
bool strictParsing =
true);
155 explicit SDMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
156 bool sanitize =
true,
bool removeHs =
true,
157 bool strictParsing =
true);
164 void moveTo(
unsigned int idx);
165 ROMol *operator[](
unsigned int idx);
170 std::string getItemText(
unsigned int idx);
171 unsigned int length();
172 void setData(
const std::string &text,
bool sanitize =
true,
174 void setData(
const std::string &text,
bool sanitize,
bool removeHs,
189 void setStreamIndices(
const std::vector<std::streampos> &locs);
193 void setDataCommon(
const std::string &text,
bool sanitize,
bool removeHs);
196 std::vector<std::streampos> d_molpos;
234 const std::string &delimiter =
" \t",
235 int smilesColumn = 0,
int nameColumn = 1,
236 bool titleLine =
true,
bool sanitize =
true);
239 const std::string &delimiter =
" \t",
240 int smilesColumn = 0,
int nameColumn = 1,
241 bool titleLine =
true,
bool sanitize =
true);
244 void setData(
const std::string &text,
const std::string &delimiter =
" ",
245 int smilesColumn = 0,
int nameColumn = 1,
bool titleLine =
true,
246 bool sanitize =
true);
251 void moveTo(
unsigned int idx);
252 ROMol *operator[](
unsigned int idx);
257 std::string getItemText(
unsigned int idx);
258 unsigned int length();
261 ROMol *processLine(std::string inLine);
262 void processTitleLine();
263 std::string nextLine();
264 long int skipComments();
271 std::vector<std::streampos>
273 std::vector<int> d_lineNums;
309 const std::string &nameRecord =
"",
int confId2D = -1,
310 int confId3D = 0,
bool sanitize =
true);
311 explicit TDTMolSupplier(std::istream *inStream,
bool takeOwnership =
true,
312 const std::string &nameRecord =
"",
int confId2D = -1,
313 int confId3D = 0,
bool sanitize =
true);
316 void setData(
const std::string &text,
const std::string &nameRecord =
"",
317 int confId2D = -1,
int confId3D = 0,
bool sanitize =
true);
322 void moveTo(
unsigned int idx);
323 ROMol *operator[](
unsigned int idx);
328 std::string getItemText(
unsigned int idx);
329 unsigned int length();
332 bool advanceToNextRecord();
334 ROMol *parseMol(std::string inLine);
342 std::vector<std::streampos>
345 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
#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.
void setProcessPropertyLists(bool val)
bool getProcessPropertyLists() const
virtual ~ForwardSDMolSupplier()
bool df_processPropertyLists
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