5#ifndef GEMMI_MMCIF_HPP_
6#define GEMMI_MMCIF_HPP_
22 for (
size_t i = 1;
i <
doc.blocks.size(); ++
i)
23 if (
doc.blocks[
i].has_tag(
"_atom_site.id"))
24 fail(
"2+ blocks are ok if only the first one has coordinates;\n"
25 "_atom_site in block #" + std::to_string(
i+1) +
": " +
doc.source);
46 model.
chains.emplace_back(
"");
58 if (
const std::string* name = block.
find_value(
"_chem_comp.id"))
77 if (
doc.blocks.size() == 2 &&
doc.blocks[0].name ==
"comp_list")
80 if (
doc.blocks.size() == 3 &&
doc.blocks[0].name.empty() &&
81 doc.blocks[1].name ==
"comp_list")
84 if (
doc.blocks.size() == 1 &&
85 !
doc.blocks[0].has_tag(
"_atom_site.id") &&
86 !
doc.blocks[0].has_tag(
"_cell.length_a") &&
87 doc.blocks[0].has_tag(
"_chem_comp_atom.atom_id"))
97 fail(
"Not a chem_comp format.");
struct Document that represents the CIF file (but can also be read from a different representation,...
fail(), unreachable() and __declspec/__attribute__ macros
Data structures to store macromolecular structure models.
Structure make_structure_from_chemcomp_block(const cif::Block &block, int which=7)
Model make_model_from_chemcomp_block(const cif::Block &block, ChemCompModel kind)
Structure make_structure(cif::Document &&doc, cif::Document *save_doc=nullptr)
structure from a coordinate mmCIF document
int check_chemcomp_block_number(const cif::Document &doc)
GEMMI_DLL Structure make_structure_from_block(const cif::Block &block)
structure from a coordinate mmCIF block
constexpr int operator|(ChemCompModel a, ChemCompModel b)
void fail(const std::string &msg)
GEMMI_DLL Residue make_residue_from_chemcomp_block(const cif::Block &block, ChemCompModel kind)
make_residue_from_chemcomp_block
Structure make_structure_from_chemcomp_doc(const cif::Document &doc, cif::Document *save_doc=nullptr, int which=7)
std::vector< Chain > chains
const std::string * find_value(const std::string &tag) const
bool has_any_value(const std::string &tag) const