NuriKit v0.1.0b2
Loading...
Searching...
No Matches
smiles.h
Go to the documentation of this file.
1//
2// Project NuriKit - Copyright 2023 SNU Compbio Lab.
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef NURI_FMT_SMILES_H_
7#define NURI_FMT_SMILES_H_
8
10#include <string>
11#include <vector>
12
13#include <absl/base/attributes.h>
15
16#include "nuri/core/molecule.h"
17#include "nuri/fmt/base.h"
18
19namespace nuri {
28extern Molecule read_smiles(const std::vector<std::string> &smi_block);
29
30class SmilesReader final: public DefaultReaderImpl<read_smiles> {
31public:
33
34 bool getnext(std::vector<std::string> &block) override;
35
36 bool bond_valid() const override { return true; }
37};
38
39class SmilesReaderFactory: public DefaultReaderFactoryImpl<SmilesReader> {
40private:
41 static const bool kRegistered ABSL_ATTRIBUTE_UNUSED;
42};
43
44extern bool write_smiles(std::string &out, const Molecule &mol,
45 bool canonical = false);
46} // namespace nuri
47
48#endif /* NURI_FMT_SMILES_H_ */
Definition base.h:238
Read-only molecule class.
Definition molecule.h:943
Definition smiles.h:39
Definition smiles.h:30
bool bond_valid() const override
Test whether the reader implementation can provide valid bond information.
Definition smiles.h:36
bool getnext(std::vector< std::string > &block) override
Advance the reader to the next molecule.
Definition crdgen.h:16
bool write_smiles(std::string &out, const Molecule &mol, bool canonical=false)
Molecule read_smiles(const std::vector< std::string > &smi_block)
Read a single SMILES string and return a molecule.