5#ifndef GEMMI_CHEMCOMP_XYZ_HPP_
6#define GEMMI_CHEMCOMP_XYZ_HPP_
31 xyz_tags = {{
"model_Cartn_x",
"model_Cartn_y",
"model_Cartn_z"}};
34 xyz_tags = {{
"pdbx_model_Cartn_x_ideal",
35 "pdbx_model_Cartn_y_ideal",
36 "pdbx_model_Cartn_z_ideal"}};
42 const_cast<cif::Block&
>(block).find_values(
"_chem_comp_atom.comp_id");
43 if (col && col.
length() > 0)
48 {
"atom_id",
"type_symbol",
"?charge",
52 for (
auto row : table) {
76 model.
chains.emplace_back(
"");
77 model.
chains[0].residues.push_back(
89 if (
const std::string* name = block.
find_value(
"_chem_comp.id"))
97 if (block.
has_any_value(
"_chem_comp_atom.pdbx_model_Cartn_x_ideal"))
109 if (
doc.blocks.size() == 2 &&
doc.blocks[0].name ==
"comp_list")
112 if (
doc.blocks.size() == 3 &&
doc.blocks[0].name.empty() &&
113 doc.blocks[1].name ==
"comp_list")
116 if (
doc.blocks.size() == 1 &&
117 !
doc.blocks[0].has_tag(
"_atom_site.id") &&
118 !
doc.blocks[0].has_tag(
"_cell.length_a") &&
119 doc.blocks[0].has_tag(
"_chem_comp_atom.atom_id"))
127 fail(
"Not a chem_comp format.");
double as_number(const std::string &s, double nan=NAN)
Model make_model_from_chemcomp_block(const cif::Block &block, ChemCompModel kind)
Structure make_structure_from_chemcomp_block(const cif::Block &block)
int check_chemcomp_block_number(const cif::Document &doc)
Structure make_structure_from_chemcomp_doc(const cif::Document &doc)
bool starts_with(const std::string &str, const std::string &prefix)
Residue make_residue_from_chemcomp_block(const cif::Block &block, ChemCompModel kind)
void fail(const std::string &msg)
Represents atom site in macromolecular structure (~100 bytes).
std::vector< Chain > chains
Coordinates in Angstroms - orthogonal (Cartesian) coordinates.
std::vector< Atom > atoms
const std::string * find_value(const std::string &tag) const
bool has_any_value(const std::string &tag) const