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
19namespace RDKit {
20class 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 */
34RDKIT_FILEPARSERS_EXPORT std::vector<std::unique_ptr<RWMol>> CDXMLDataStreamToMols(
35 std::istream &inStream,
36 bool sanitize = true,
37 bool removeHs = true);
38//! \brief construct molecules from a CDXML file
39//! Note that the CDXML format is large and complex, the RDKit doesn't support
40//! full functionality, just the base ones required for molecule and
41//! reaction parsing.
42/*!
43 * \param fileName - cdxml fileName
44 * \param sanitize - toggles sanitization and stereochemistry
45 * perception of the molecule
46 * \param removeHs - toggles removal of Hs from the molecule. H removal
47 * is only done if the molecule is sanitized
48 * correctness of the contents.
49 */
50RDKIT_FILEPARSERS_EXPORT std::vector<std::unique_ptr<RWMol>> CDXMLFileToMols(
51 const std::string &filename,
52 bool sanitize = true,
53 bool removeHs = true);
54
55//! \brief construct molecules from a CDXML file
56//! Note that the CDXML format is large and complex, the RDKit doesn't support
57//! full functionality, just the base ones required for molecule and
58//! reaction parsing.
59/*!
60 * \param cdxml - string containing the mol block
61 * \param sanitize - toggles sanitization and stereochemistry
62 * perception of the molecule
63 * \param removeHs - toggles removal of Hs from the molecule. H removal
64 * is only done if the molecule is sanitized
65 * correctness of the contents.
66 */
67RDKIT_FILEPARSERS_EXPORT std::vector<std::unique_ptr<RWMol>> CDXMLToMols(
68 const std::string &cdxml,
69 bool sanitize = true,
70 bool removeHs = true);
71
72}
73#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 > > 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,...
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 > > 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,...