NuriKit v0.1.0b2
Loading...
Searching...
No Matches
mmcif.h
Go to the documentation of this file.
1//
2// Project NuriKit - Copyright 2025 SNU Compbio Lab.
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef NURI_FMT_MMCIF_H_
7#define NURI_FMT_MMCIF_H_
8
10#include <istream>
11#include <string>
12#include <vector>
13
14#include <absl/base/attributes.h>
16
17#include "nuri/core/molecule.h"
18#include "nuri/fmt/base.h"
19#include "nuri/fmt/cif.h"
20
21namespace nuri {
22std::vector<Molecule> mmcif_load_frame(const internal::CifFrame &frame);
23
24std::vector<Molecule> mmcif_read_next_block(CifParser &parser);
25
26class MmcifReader final: public MoleculeReader {
27public:
28 explicit MmcifReader(std::istream &is): parser_(is) { }
29
30 bool getnext(std::vector<std::string> &block) override;
31
32 Molecule parse(const std::vector<std::string> &block) const override;
33
34 bool bond_valid() const override { return false; }
35
36private:
37 CifParser parser_;
38 std::vector<Molecule> mols_;
39 int next_ = -1;
40};
41
42class MmcifReaderFactory: public DefaultReaderFactoryImpl<MmcifReader> {
43private:
44 static const bool kRegistered ABSL_ATTRIBUTE_UNUSED;
45};
46} // namespace nuri
47
48#endif /* NURI_FMT_MMCIF_H_ */
Definition cif.h:383
Definition base.h:238
Definition mmcif.h:42
MmcifReader(std::istream &is)
Definition mmcif.h:28
bool bond_valid() const override
Test whether the reader implementation can provide valid bond information.
Definition mmcif.h:34
bool getnext(std::vector< std::string > &block) override
Advance the reader to the next molecule.
Molecule parse(const std::vector< std::string > &block) const override
Parse the current block and return the molecule.
MoleculeReader()=default
Read-only molecule class.
Definition molecule.h:943
Definition crdgen.h:16
std::vector< Molecule > mmcif_read_next_block(CifParser &parser)
std::vector< Molecule > mmcif_load_frame(const internal::CifFrame &frame)