31 #include "cif++/pdb/tls.hpp" 61 return chainID == rhs.
chainID and
62 seqNr == rhs.
seqNr and
63 iCode == rhs.
iCode and
71 std::string indent(indentLevel * 2,
' ');
73 auto i = selected.begin();
77 while (
i != selected.end())
79 auto b = find_if(
i, selected.end(), [](
auto s) ->
bool 80 {
return s.selected; });
81 if (
b == selected.end())
85 std::cout << indent <<
"PDB:" << std::endl;
88 auto e = find_if(
b, selected.end(), [
b](
auto s) ->
bool 89 {
return s.chainID !=
b->chainID
or not s.selected; });
91 std::cout << indent <<
" >> " <<
b->chainID <<
' ' <<
b->seqNr <<
':' << (e - 1)->
seqNr << std::endl;
98 std::cout << indent <<
"mmCIF:" << std::endl;
100 i = selected.begin();
101 while (
i != selected.end())
103 auto b = find_if(
i, selected.end(), [](
auto s) ->
bool 104 {
return s.selected; });
105 if (
b == selected.end())
108 auto e = find_if(
b, selected.end(), [
b](
auto s) ->
bool 109 {
return s.asymID !=
b->asymID
or not s.selected; });
111 std::string
asymID =
b->asymID;
112 int from =
b->seqID, to = from;
114 for (
auto j =
b + 1;
j != e; ++
j)
116 if (
j->seqID == to + 1)
118 else if (
j->seqID != to)
121 std::cout << indent <<
" >> " << asymID << std::endl;
123 std::cout << indent <<
" >> " << asymID <<
' ' << from <<
':' << to << std::endl;
125 from = to =
b->seqID;
130 std::cout << indent <<
" >> " << asymID << std::endl;
132 std::cout << indent <<
" >> " << asymID <<
' ' << from <<
':' << to << std::endl;
139 if (isatty(STDOUT_FILENO))
140 std::cout << indent << cif::coloured(
"Empty selection") << std::endl;
142 std::cout << indent <<
"Empty selection" << std::endl;
146 std::vector<std::tuple<std::string, int, int>> tls_selection::get_ranges(cif::datablock &db,
bool pdbNamespace)
const 151 for (
auto r : db[
"pdbx_poly_seq_scheme"])
159 cif::tie(chain, seqNr, iCode, name, asymID, seqID) = r.get(
"pdb_strand_id",
"pdb_seq_num",
"pdb_ins_code",
"pdb_mon_id",
"asym_id",
"seq_id");
162 cif::tie(chain, seqNr, name) = r.get(
"asym_id",
"seq_id",
"mon_id");
170 if (iCode.length() > 1)
171 throw std::runtime_error(
"invalid iCode");
173 selected.push_back({ chain, stoi(seqNr), iCode[0],
name,
false,
asymID, seqID });
177 for (
auto r : db[
"pdbx_nonpoly_scheme"])
183 cif::tie(chain, seqNr, iCode, name, asymID) = r.get(
"pdb_strand_id",
"pdb_seq_num",
"pdb_ins_code",
"pdb_mon_id",
"asym_id");
189 cif::tie(chain, name) = r.get(
"asym_id",
"mon_id");
197 if (iCode.length() > 1)
198 throw std::runtime_error(
"invalid iCode");
204 for (
auto r : db[
"pdbx_branch_scheme"])
210 cif::tie(chain, seqNr, iCode, name, asymID) = r.get(
"auth_asym_id",
"pdb_seq_num",
"pdb_ins_code",
"pdb_mon_id",
"asym_id");
216 cif::tie(chain, name) = r.get(
"asym_id",
"mon_id");
221 if (iCode.length() > 1)
222 throw std::runtime_error(
"invalid iCode");
230 stable_sort(selected.begin(), selected.end(), [](
auto &
a,
auto &
b) ->
bool 232 int d =
a.chainID.compare(
b.chainID);
234 d =
a.seqNr -
b.seqNr;
237 collect_residues(db, selected);
239 std::vector<std::tuple<std::string, int, int>> result;
243 auto i = selected.begin();
245 while (
i != selected.end())
247 auto b = find_if(
i, selected.end(), [](
auto s) ->
bool 248 {
return s.selected; });
249 if (
b == selected.end())
252 auto e = find_if(
b, selected.end(), [
b](
auto s) ->
bool 253 {
return s.chainID !=
b->chainID
or not s.selected; });
258 result.push_back(std::make_tuple(
b->chainID,
b->seqNr,
b->seqNr));
259 for (
auto j =
b + 1;
j != e; ++
j)
261 if (
j->seqNr == std::get<2>(result.back()) + 1)
262 std::get<2>(result.back()) =
j->seqNr;
263 else if (
j->seqNr != std::get<2>(result.back()))
264 result.push_back(std::make_tuple(
b->chainID,
j->seqNr,
j->seqNr));
272 auto i = selected.begin();
274 while (
i != selected.end())
276 auto b = find_if(
i, selected.end(), [](
auto s) ->
bool 277 {
return s.selected; });
278 if (
b == selected.end())
281 auto e = find_if(
b, selected.end(), [
b](
auto s) ->
bool 282 {
return s.asymID !=
b->asymID
or not s.selected; });
287 result.push_back(std::make_tuple(
b->asymID,
b->seqID,
b->seqID));
288 for (
auto j =
b + 1;
j != e; ++
j)
290 if (
j->seqID == std::get<2>(result.back()) + 1)
291 std::get<2>(result.back()) =
j->seqID;
292 else if (
j->seqID != std::get<2>(result.back()))
293 result.push_back(std::make_tuple(
b->asymID,
j->seqID,
j->seqID));
300 for (
auto &&[
name, i1, i2] : result)
312 : selection(selection.release())
316 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 318 selection->collect_residues(db, residues, indentLevel + 1);
320 for (
auto &r : residues)
321 r.selected = not r.selected;
325 std::cout << std::string(indentLevel * 2,
' ') <<
"NOT" << std::endl;
337 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 339 for (
auto &r : residues)
344 std::cout << std::string(indentLevel * 2,
' ') <<
"ALL" << std::endl;
357 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 359 bool allChains = m_chain ==
"*";
361 for (
auto &r : residues)
362 r.selected = allChains
or r.chainID == m_chain;
366 std::cout << std::string(indentLevel * 2,
' ') <<
"CHAIN " << m_chain << std::endl;
382 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 384 for (
auto &r : residues)
385 r.selected = r.seqNr == m_seq_nr and r.iCode == m_icode;
389 std::cout << std::string(indentLevel * 2,
' ') <<
"ResID " << m_seq_nr << (m_icode ? std::string{ m_icode } :
"") << std::endl;
406 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 408 for (
auto &r : residues)
416 std::cout << std::string(indentLevel * 2,
' ') <<
"Range " << m_first <<
':' << m_last << std::endl;
429 , m_icode_first(icodeFirst)
430 , m_icode_last(icodeLast)
434 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 437 std::set<std::string> chains;
438 for (
auto &r : residues)
439 chains.insert(r.chainID);
441 for (std::string chain : chains)
443 auto f = find_if(residues.begin(), residues.end(),
444 [
this,chain](
auto r) ->
bool 446 return r.chainID == chain and r.seqNr == m_first and r.iCode == m_icode_first;
449 auto l = find_if(residues.begin(), residues.end(),
450 [
this,chain](
auto r) ->
bool 452 return r.chainID == chain and r.seqNr == m_last and r.iCode == m_icode_last;
455 if (
f != residues.end() and l != residues.end() and
f <= l)
466 std::cout << std::string(indentLevel * 2,
' ') <<
"Through " << m_first <<
':' << m_last << std::endl;
489 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 492 for_each(
a.begin(),
a.end(), [](
auto &r)
493 { r.selected =
false; });
496 for_each(b.begin(), b.end(), [](
auto &r)
497 { r.selected =
false; });
499 lhs->collect_residues(db,
a, indentLevel + 1);
500 rhs->collect_residues(db, b, indentLevel + 1);
502 for (
auto ai =
a.begin(), bi = b.begin(), ri = residues.begin(); ri != residues.end(); ++ai, ++bi, ++ri)
503 ri->selected = ai->selected
or bi->selected;
507 std::cout << std::string(indentLevel * 2,
' ') <<
"Union" << std::endl;
512 std::unique_ptr<tls_selection>
lhs;
513 std::unique_ptr<tls_selection>
rhs;
530 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 533 for_each(
a.begin(),
a.end(), [](
auto &r)
534 { r.selected =
false; });
537 for_each(b.begin(), b.end(), [](
auto &r)
538 { r.selected =
false; });
540 lhs->collect_residues(db,
a, indentLevel + 1);
541 rhs->collect_residues(db, b, indentLevel + 1);
543 for (
auto ai =
a.begin(), bi = b.begin(), ri = residues.begin(); ri != residues.end(); ++ai, ++bi, ++ri)
544 ri->selected = ai->selected and bi->selected;
548 std::cout << std::string(indentLevel * 2,
' ') <<
"Intersection" << std::endl;
553 std::unique_ptr<tls_selection>
lhs;
554 std::unique_ptr<tls_selection>
rhs;
565 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 567 for (
auto &r : residues)
568 r.selected = r.name == m_name;
572 std::cout << std::string(indentLevel * 2,
' ') <<
"Name " << m_name << std::endl;
588 void collect_residues(cif::datablock &db, std::vector<tls_residue> &residues,
size_t indentLevel)
const override 595 for (
auto &r : residues)
596 r.selected =
iequals(r.name, m_element);
600 std::cout << std::string(indentLevel * 2,
' ') <<
"Element " << m_element << std::endl;
614 : m_selection(selection)
615 , m_p(m_selection.begin())
616 , m_end(m_selection.end())
620 virtual std::unique_ptr<tls_selection> Parse() = 0;
623 virtual int get_next_token() = 0;
624 virtual void match(
int token);
625 virtual std::string
to_string(
int token) = 0;
628 std::string::iterator
m_p, m_end;
635 if (m_lookahead == token)
636 m_lookahead = get_next_token();
639 std::string expected;
643 expected = { char(token) };
646 if (m_lookahead >= 256)
647 found =
to_string(m_lookahead) +
" (" + m_token +
')';
649 found = { char(m_lookahead) };
651 throw std::runtime_error(
"Expected " + expected +
" but found " + found);
663 m_lookahead = get_next_token();
666 virtual std::unique_ptr<tls_selection> Parse();
669 std::unique_ptr<tls_selection> ParseAtomSelection();
670 std::unique_ptr<tls_selection> ParseTerm();
671 std::unique_ptr<tls_selection> ParseFactor();
696 virtual int get_next_token();
697 virtual std::string
to_string(
int token);
700 std::string m_value_s;
704 int TLSSelectionParserImplPhenix::get_next_token()
706 int result = pt_NONE;
717 int state = st_START;
731 case st_START: state = start = st_RESID;
break;
732 case st_RESID: state = start = st_NUM;
break;
733 case st_NUM: state = start = st_IDENT;
break;
734 case st_IDENT: state = start = st_QUOTED;
break;
735 case st_QUOTED: state = start = st_DQUOTED;
break;
736 case st_DQUOTED: state = start = st_OTHER;
break;
748 while (result == pt_NONE)
762 else if (isspace(ch))
774 state = st_RESID + 1;
775 else if (isdigit(ch))
777 m_value_i = (ch -
'0');
778 state = st_RESID + 2;
787 m_value_i = -(ch -
'0');
788 state = st_RESID + 2;
796 m_value_i = 10 * m_value_i + (m_value_i < 0 ? -1 : 1) * (ch -
'0');
797 else if (isalpha(ch))
800 state = st_RESID + 3;
821 else if (isdigit(ch))
823 m_value_i = ch -
'0';
833 m_value_i = -(ch -
'0');
842 m_value_i = 10 * m_value_i + (m_value_i < 0 ? -1 : 1) * (ch -
'0');
843 else if (not isalpha(ch))
858 state = st_IDENT + 1;
865 if (isalnum(ch)
or ch ==
'\'')
880 state = st_QUOTED + 1;
890 throw std::runtime_error(
"Unexpected end of selection, missing quote character?");
901 state = st_DQUOTED + 1;
911 throw std::runtime_error(
"Unexpected end of selection, missing quote character?");
923 if (result == pt_IDENT)
925 if (
iequals(m_value_s,
"CHAIN"))
926 result = pt_KW_CHAIN;
927 else if (
iequals(m_value_s,
"ALL"))
929 else if (
iequals(m_value_s,
"AND"))
931 else if (
iequals(m_value_s,
"OR"))
933 else if (
iequals(m_value_s,
"NOT"))
935 else if (
iequals(m_value_s,
"RESSEQ"))
936 result = pt_KW_RESSEQ;
938 result = pt_KW_RESID;
939 else if (
iequals(m_value_s,
"RESNAME"))
940 result = pt_KW_RESNAME;
941 else if (
iequals(m_value_s,
"ELEMENT"))
942 result = pt_KW_ELEMENT;
943 else if (
iequals(m_value_s,
"PDB"))
945 else if (
iequals(m_value_s,
"ENTRY"))
946 result = pt_KW_ENTRY;
947 else if (
iequals(m_value_s,
"THROUGH"))
948 result = pt_KW_THROUGH;
954 std::string TLSSelectionParserImplPhenix::to_string(
int token)
958 case pt_IDENT:
return "identifier";
959 case pt_STRING:
return "std::string";
960 case pt_NUMBER:
return "number";
961 case pt_RESID:
return "resid";
962 case pt_EOLN:
return "end of line";
964 case pt_KW_ALL:
return "ALL";
965 case pt_KW_CHAIN:
return "CHAIN";
966 case pt_KW_RESSEQ:
return "RESSEQ";
967 case pt_KW_RESID:
return "RESID";
968 case pt_KW_RESNAME:
return "RESNAME";
969 case pt_KW_ELEMENT:
return "ELEMENT";
970 case pt_KW_AND:
return "AND";
971 case pt_KW_OR:
return "OR";
972 case pt_KW_NOT:
return "NOT";
973 case pt_KW_PDB:
return "PDB";
974 case pt_KW_ENTRY:
return "ENTRY";
975 case pt_KW_THROUGH:
return "THROUGH";
977 default:
return "character";
983 if (m_lookahead == pt_KW_PDB)
988 throw std::runtime_error(
"Unimplemented PDB ENTRY specification");
991 std::unique_ptr<tls_selection> result = ParseAtomSelection();
993 bool extraParenthesis =
false;
995 if (m_lookahead ==
')')
997 extraParenthesis =
true;
998 m_lookahead = get_next_token();
1003 if (extraParenthesis)
1004 std::cerr <<
"WARNING: too many closing parenthesis in TLS selection statement" << std::endl;
1009 std::unique_ptr<tls_selection> TLSSelectionParserImplPhenix::ParseAtomSelection()
1011 std::unique_ptr<tls_selection> result = ParseTerm();
1013 while (m_lookahead == pt_KW_OR)
1022 std::unique_ptr<tls_selection> TLSSelectionParserImplPhenix::ParseTerm()
1024 std::unique_ptr<tls_selection> result = ParseFactor();
1026 while (m_lookahead == pt_KW_AND)
1035 std::unique_ptr<tls_selection> TLSSelectionParserImplPhenix::ParseFactor()
1037 std::unique_ptr<tls_selection> result;
1039 switch (m_lookahead)
1043 result = ParseAtomSelection();
1044 if (m_lookahead == pt_EOLN)
1045 std::cerr <<
"WARNING: missing closing parenthesis in TLS selection statement" << std::endl;
1059 std::string
chainID = m_value_s;
1060 if (m_lookahead == pt_NUMBER)
1066 match(m_lookahead == pt_STRING ? pt_STRING : pt_IDENT);
1074 match(pt_KW_RESNAME);
1075 std::string
name = m_value_s;
1083 match(pt_KW_ELEMENT);
1084 std::string element = m_value_s;
1092 match(pt_KW_RESSEQ);
1094 int from = m_value_i;
1098 if (m_lookahead ==
':')
1114 char icode_from = 0, icode_to = 0;
1115 bool through =
false;
1117 from = to = m_value_i;
1119 if (m_lookahead == pt_NUMBER)
1123 icode_from = m_icode;
1127 if (m_lookahead ==
':' or m_lookahead == pt_KW_THROUGH
or m_lookahead ==
'-')
1129 through = m_lookahead == pt_KW_THROUGH;
1134 if (m_lookahead == pt_NUMBER)
1147 std::cerr <<
"Warning, ignoring insertion codes" << std::endl;
1164 throw std::runtime_error(
"Unexpected token " +
to_string(m_lookahead) +
" (" + m_token +
')');
1177 virtual std::unique_ptr<tls_selection> Parse();
1188 virtual int get_next_token();
1189 virtual std::string
to_string(
int token);
1191 std::unique_ptr<tls_selection> ParseGroup();
1192 std::tuple<std::string, int> ParseAtom();
1194 std::unique_ptr<tls_selection> ParseOldGroup();
1198 bool m_parsing_old_style =
false;
1220 bool negative =
false;
1233 else if (isspace(ch))
1235 else if (isdigit(ch))
1240 else if (isalpha(ch))
1301 case bt_EOLN:
return "end of line";
1305 return "unknown token";
1311 std::unique_ptr<tls_selection> result;
1313 auto add = [&result](
const std::string &chainID,
int from,
int to)
1319 if (result ==
nullptr)
1320 result.reset(s.release());
1336 int seqNr2 = seqNr1;
1348 if (chain1 != chain2)
1350 std::cerr <<
"Warning, ranges over multiple chains detected" << std::endl;
1362 if (result ==
nullptr)
1363 result.reset(s.release());
1371 if (not chain1.empty())
1372 add(chain1, seqNr1, seqNr2);
1375 add(chain1, seqNr1, seqNr1);
1408 std::cerr <<
"Warning: ignoring atom ID '" << atom <<
"' in TLS selection" << std::endl;
1414 return std::make_tuple(chain, seqNr);
1419 std::unique_ptr<tls_selection> result =
ParseGroup();
1435 virtual std::unique_ptr<tls_selection>
Parse();
1438 std::unique_ptr<tls_selection> ParseAtomSelection();
1439 std::unique_ptr<tls_selection> ParseTerm();
1440 std::unique_ptr<tls_selection> ParseFactor();
1442 std::unique_ptr<tls_selection> ParseResid();
1443 std::unique_ptr<tls_selection> ParseChainResid();
1470 virtual std::string
to_string(
int token);
1477 int TLSSelectionParserImplBusterOld::get_next_token()
1479 int result = pt_NONE;
1496 bool negative =
false;
1498 while (result == pt_NONE)
1509 else if (isspace(ch))
1511 else if (isdigit(ch))
1516 else if (isalpha(ch))
1525 else if (ch ==
'\'')
1527 state = st_QUOTED_1;
1550 else if (ch ==
'-' or ch ==
':')
1571 m_value_r[1] = 10 * m_value_r[1] + (ch -
'0');
1572 else if (m_value_r[1] != 0)
1591 else if (isdigit(ch))
1594 state = st_CHAINRESID;
1610 else if (isdigit(ch))
1615 result = pt_CHAINRESID;
1638 state = st_QUOTED_2;
1646 throw std::runtime_error(
"Unexpected end of selection, missing quote character?");
1653 if (result == pt_IDENT)
1656 result = pt_KW_CHAIN;
1666 result = pt_KW_RESSEQ;
1668 result = pt_KW_RESID;
1670 result = pt_KW_RESNAME;
1674 result = pt_KW_ENTRY;
1676 result = pt_KW_THROUGH;
1682 std::string TLSSelectionParserImplBusterOld::to_string(
int token)
1686 case pt_IDENT:
return "identifier (" +
m_value_s +
')';
1687 case pt_STRING:
return "std::string (" +
m_value_s +
')';
1689 case pt_RANGE:
return "range (" +
to_string(m_value_r[0]) +
':' +
to_string(m_value_r[1]) +
')';
1690 case pt_EOLN:
return "end of line";
1692 case pt_KW_ALL:
return "ALL";
1693 case pt_KW_CHAIN:
return "CHAIN";
1694 case pt_KW_RESSEQ:
return "RESSEQ";
1695 case pt_KW_RESID:
return "RESID";
1696 case pt_KW_RESNAME:
return "RESNAME";
1697 case pt_KW_ELEMENT:
return "ELEMENT";
1698 case pt_KW_AND:
return "AND";
1699 case pt_KW_OR:
return "OR";
1700 case pt_KW_NOT:
return "NOT";
1701 case pt_KW_PDB:
return "PDB";
1702 case pt_KW_ENTRY:
return "ENTRY";
1703 case pt_KW_THROUGH:
return "THROUGH";
1706 return "unknown token";
1717 throw std::runtime_error(
"Unimplemented PDB ENTRY specification");
1720 std::unique_ptr<tls_selection> result = ParseAtomSelection();
1727 std::unique_ptr<tls_selection> TLSSelectionParserImplBusterOld::ParseAtomSelection()
1729 std::unique_ptr<tls_selection> result = ParseTerm();
1740 std::unique_ptr<tls_selection> TLSSelectionParserImplBusterOld::ParseTerm()
1742 std::unique_ptr<tls_selection> result = ParseFactor();
1753 std::unique_ptr<tls_selection> TLSSelectionParserImplBusterOld::ParseFactor()
1755 std::unique_ptr<tls_selection> result;
1761 result = ParseAtomSelection();
1789 match(pt_KW_RESNAME);
1797 match(pt_KW_RESSEQ);
1798 result = ParseResid();
1803 result = ParseResid();
1812 result = ParseChainResid();
1822 std::unique_ptr<tls_selection> TLSSelectionParserImplBusterOld::ParseResid()
1824 std::unique_ptr<tls_selection> result;
1832 from = m_value_r[0];
1855 result.reset(range.release());
1869 std::unique_ptr<tls_selection> TLSSelectionParserImplBusterOld::ParseChainResid()
1871 std::unique_ptr<tls_selection> result;
1880 match(pt_CHAINRESID);
1888 throw std::runtime_error(
"Cannot have two different chainIDs in a range selection");
1890 match(pt_CHAINRESID);
1900 result.reset(range.release());
1919 virtual std::unique_ptr<tls_selection>
Parse(
const std::string &selection)
const = 0;
1923 template <
typename IMPL>
1927 virtual std::unique_ptr<tls_selection>
Parse(
const std::string &selection)
const 1929 std::unique_ptr<tls_selection> result;
1936 catch (
const std::exception &ex)
1938 std::cerr <<
"ParseError: " << ex.what() << std::endl;
1953 std::unique_ptr<tls_selection> result;
1957 result = buster.
Parse(selection);
1962 std::cerr <<
"Falling back to old BUSTER" << std::endl;
1963 result = busterOld.
Parse(selection);
1969 std::cerr <<
"Falling back to PHENIX" << std::endl;
1970 result = phenix.
Parse(selection);
1975 result = phenix.
Parse(selection);
1980 std::cerr <<
"Falling back to BUSTER" << std::endl;
1981 result = buster.
Parse(selection);
1987 std::cerr <<
"Falling back to old BUSTER" << std::endl;
1988 result = busterOld.
Parse(selection);
1994 std::cerr <<
"No known program specified, trying PHENIX" << std::endl;
1996 result = phenix.
Parse(selection);
2001 std::cerr <<
"Falling back to BUSTER" << std::endl;
2002 result = buster.
Parse(selection);
2008 std::cerr <<
"Falling back to old BUSTER" << std::endl;
2009 result = busterOld.
Parse(selection);
std::unique_ptr< tls_selection > lhs
void min(Image< double > &op1, const Image< double > &op2)
virtual std::unique_ptr< tls_selection > Parse()
tls_selection_chain(const std::string &chainID)
virtual std::string to_string(int token)
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
bool icontains(std::string_view s, std::string_view q)
tls_selection_union(std::unique_ptr< tls_selection > &lhs, std::unique_ptr< tls_selection > &rhs)
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
std::unique_ptr< tls_selection > parse_tls_selection_details(const std::string &program, const std::string &selection)
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
std::tuple< std::string, int > ParseAtom()
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
bool iequals(std::string_view a, std::string_view b)
tls_selection_range_seq(int first, int last)
tls_selection_range_id(int first, int last, char icodeFirst=0, char icodeLast=0)
void dump_selection(const std::vector< tls_residue > &selected, size_t indentLevel)
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
tls_selection_parser_impl(const std::string &selection)
if(fabs(c[*nmax+ *nmax *c_dim1])==0.e0)
virtual void match(int token)
TLSSelectionParserImplPhenix(const std::string &selection)
TLSSelectionParserImplBusterOld(const std::string &selection)
tls_selection_by_element(const std::string &element)
void max(Image< double > &op1, const Image< double > &op2)
tls_selection_not(std::unique_ptr< tls_selection > selection)
tls_selection_res_id(int seqNr, char iCode)
std::unique_ptr< tls_selection > selection
virtual std::unique_ptr< tls_selection > Parse()
std::string::iterator m_end
std::unique_ptr< tls_selection > rhs
tls_selection_union(std::unique_ptr< tls_selection > &lhs, std::unique_ptr< tls_selection > &&rhs)
tls_selection_intersection(std::unique_ptr< tls_selection > &lhs, std::unique_ptr< tls_selection > &rhs)
tls_selection_by_name(const std::string &resname)
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
tls_selection_intersection(std::unique_ptr< tls_selection > &lhs, std::unique_ptr< tls_selection > &&rhs)
std::unique_ptr< tls_selection > ParseGroup()
virtual int get_next_token()
virtual std::unique_ptr< tls_selection > Parse()
std::string::iterator m_p
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
std::unique_ptr< tls_selection > rhs
std::unique_ptr< tls_selection > lhs
const int kResidueNrWildcard
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override
std::string to_string(bond_type bondType)
virtual std::unique_ptr< tls_selection > Parse(const std::string &selection) const
TLSSelectionParserImplBuster(const std::string &selection)
bool operator==(const tls_residue &rhs) const
virtual ~TLSSelectionParserBase()
void collect_residues(cif::datablock &db, std::vector< tls_residue > &residues, size_t indentLevel) const override