RDKit
Open-source cheminformatics and machine learning.
CDXMLParser.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 Brian P Kelley
3 // All rights reserved.
4 //
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #include <RDGeneral/export.h>
11 #ifndef RD_CDXML_FILEPARSERS_H
12 #define RD_CDXML_FILEPARSERS_H
13 
14 #include <RDGeneral/types.h>
15 #include <string>
16 #include <iostream>
17 #include <vector>
18 
19 namespace RDKit {
20 class RWMol;
21 
22 //! \brief construct molecules from a CDXML file
23 //! Note that the CDXML format is large and complex, the RDKit doesn't support
24 //! full functionality, just the base ones required for molecule and
25 //! reaction parsing.
26 /*!
27  * \param inStream - string containing the mol block
28  * \param sanitize - toggles sanitization and stereochemistry
29  * perception of the molecule
30  * \param removeHs - toggles removal of Hs from the molecule. H removal
31  * is only done if the molecule is sanitized
32  * correctness of the contents.
33  */
34 RDKIT_FILEPARSERS_EXPORT std::vector<std::unique_ptr<RWMol>>
35 CDXMLDataStreamToMols(std::istream &inStream, bool sanitize = true,
36  bool removeHs = true);
37 //! \brief construct molecules from a CDXML file
38 //! Note that the CDXML format is large and complex, the RDKit doesn't support
39 //! full functionality, just the base ones required for molecule and
40 //! reaction parsing.
41 /*!
42  * \param fileName - cdxml fileName
43  * \param sanitize - toggles sanitization and stereochemistry
44  * perception of the molecule
45  * \param removeHs - toggles removal of Hs from the molecule. H removal
46  * is only done if the molecule is sanitized
47  * correctness of the contents.
48  */
49 RDKIT_FILEPARSERS_EXPORT std::vector<std::unique_ptr<RWMol>> CDXMLFileToMols(
50  const std::string &filename, bool sanitize = true, bool removeHs = true);
51 
52 //! \brief construct molecules from a CDXML file
53 //! Note that the CDXML format is large and complex, the RDKit doesn't support
54 //! full functionality, just the base ones required for molecule and
55 //! reaction parsing.
56 /*!
57  * \param cdxml - string containing the mol block
58  * \param sanitize - toggles sanitization and stereochemistry
59  * perception of the molecule
60  * \param removeHs - toggles removal of Hs from the molecule. H removal
61  * is only done if the molecule is sanitized
62  * correctness of the contents.
63  */
64 RDKIT_FILEPARSERS_EXPORT std::vector<std::unique_ptr<RWMol>> CDXMLToMols(
65  const std::string &cdxml, bool sanitize = true, bool removeHs = true);
66 
67 } // namespace RDKit
68 #endif //␓ _RD_CDXML_FILEPARSERS_H
#define RDKIT_FILEPARSERS_EXPORT
Definition: export.h:161
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
Std stuff.
Definition: Abbreviations.h:19
RDKIT_FILEPARSERS_EXPORT std::vector< std::unique_ptr< RWMol > > CDXMLToMols(const std::string &cdxml, bool sanitize=true, bool removeHs=true)
construct molecules from a CDXML file Note that the CDXML format is large and complex,...
RDKIT_FILEPARSERS_EXPORT std::vector< std::unique_ptr< RWMol > > CDXMLDataStreamToMols(std::istream &inStream, bool sanitize=true, bool removeHs=true)
construct molecules from a CDXML file Note that the CDXML format is large and complex,...
RDKIT_FILEPARSERS_EXPORT std::vector< std::unique_ptr< RWMol > > CDXMLFileToMols(const std::string &filename, bool sanitize=true, bool removeHs=true)
construct molecules from a CDXML file Note that the CDXML format is large and complex,...