7#ifndef GEMMI_ASSEMBLY_HPP_
8#define GEMMI_ASSEMBLY_HPP_
35 static const char symbols[] = {
36 'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
37 'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
38 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
39 'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
40 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'
44 std::string name(1,
'A');
45 for (
char symbol : symbols) {
51 for (
char symbol1 : symbols) {
53 for (
char symbol2 : symbols) {
59 fail(
"run out of 1- and 2-letter chain names");
63 std::string name = base;
64 name += std::to_string(n);
66 name.resize(base.size());
67 name += std::to_string(++n);
95 std::vector<Assembly::Operator> operators(cell.
images.size() + 1);
97 for (
size_t i = 1; i != operators.size(); ++i) {
101 assembly.
generators.push_back({{
"(all)"}, {}, operators});
109 bool keep_spacegroup=
false,
double merge_dist=0.2);
118 double max_dist=0.2,
bool compare_serial=
true);
Logger - a tiny utility for passing messages through a callback.
Data structures to store macromolecular structure models.
GEMMI_DLL Model make_assembly(const Assembly &assembly, const Model &model, HowToNameCopiedChain how, const Logger &logging)
GEMMI_DLL Model expand_ncs_model(const Model &model, const std::vector< NcsOp > &ncs, HowToNameCopiedChain how)
GEMMI_DLL void merge_atoms_in_expanded_model(Model &model, const UnitCell &cell, double max_dist=0.2, bool compare_serial=true)
Searches and merges overlapping equivalent atoms from different chains.
GEMMI_DLL void shorten_chain_names(Structure &st)
GEMMI_DLL void transform_to_assembly(Structure &st, const std::string &assembly_name, HowToNameCopiedChain how, const Logger &logging, bool keep_spacegroup=false, double merge_dist=0.2)
If called with assembly_name="unit_cell" changes structure to unit cell (P1).
bool in_vector(const T &x, const std::vector< T > &v)
GEMMI_DLL void expand_ncs(Structure &st, HowToNameCopiedChain how, double merge_dist=0.2)
GEMMI_DLL void split_chains_by_segments(Model &model, HowToNameCopiedChain how)
HowToNameCopiedChain::Dup adds segment name to chain name.
void fail(const std::string &msg)
void ensure_unique_chain_name(const Model &model, Chain &chain)
Assembly pseudo_assembly_for_unit_cell(const UnitCell &cell)
std::vector< Gen > generators
std::string make_name_with_numeric_postfix(const std::string &base, int n)
std::string make_new_name(const std::string &old, int n)
std::string make_short_name(const std::string &preferred)
ChainNameGenerator(HowToNameCopiedChain how_)
ChainNameGenerator(const Model &model, HowToNameCopiedChain how_)
std::vector< std::string > used_names
bool try_add(const std::string &name)
Passes messages (including warnings/errors) to a callback function.
std::vector< Chain > chains
std::vector< FTransform > images
Utilities. Mostly for working with strings and vectors.