9 #ifndef __RNAMake__residue__
10 #define __RNAMake__residue__
15 #include "base/types.h"
16 #include "util/uuid.h"
17 #include "structure/atom.h"
18 #include "structure/residue_type.h"
19 #include "structure/residue_type_set.h"
22 center(AtomOPs
const &);
32 enum BeadType { PHOS = 0, SUGAR = 1, BASE = 2 };
45 std::runtime_error(message)
61 center_(Point(0,0,0)),
73 BeadType
const btype):
118 typedef std::vector<Bead> Beads;
178 chain_id_ ( chain_id ),
180 atoms_ ( AtomOPs() ),
193 chain_id_(r.chain_id_),
195 atoms_ ( AtomOPs(r.
atoms().size()) ),
198 for(
auto const & a : r.atoms_) {
200 if(a ==
nullptr) {
continue; }
201 atoms_[i] = std::make_shared<Atom>(*a);
214 Strings spl = split_str_by_delimiter(s,
",");
215 rtype_ = rts.get_rtype_by_resname(spl[0]);
217 num_ = std::stoi(spl[2]);
221 auto atoms = AtomOPs();
223 while ( i < spl.size() ) {
224 if( spl[i].length() == 1) {
225 atoms.push_back(
nullptr );
228 atoms.push_back(std::make_shared<Atom>(spl[i]));
268 String
const &
name)
const {
269 int index = rtype_.atom_pos_by_name(name);
273 return atoms_[index];
288 float cutoff = 3.0)
const {
289 String o3 =
"O3'", p =
"P";
293 if(o3_atom !=
nullptr && p_atom !=
nullptr) {
294 if( o3_atom->coords().distance(p_atom->coords()) < cutoff) {
301 if(o3_atom !=
nullptr && p_atom !=
nullptr) {
302 if( o3_atom->coords().distance(p_atom->coords()) < cutoff) {
396 String
const &)
const;
411 return uuid_ == r.uuid_;
422 num(
int nnum) { num_ = nnum; }
430 chain_id(String
const & nchain_id) { chain_id_ = nchain_id; }
470 num()
const {
return num_; }
534 typedef std::shared_ptr<Residue> ResidueOP;
539 typedef std::vector<ResidueOP> ResidueOPs;
Beads get_beads() const
Definition: residue.cc:50
Bead(Bead const &b)
Definition: residue.h:83
Residue(ResidueType const &rtype, String const &name, int const &num, String const &chain_id, String const &i_code)
Definition: residue.h:169
Definition: residue_type_set.h:15
ResidueException(String const &message)
Definition: residue.h:44
Uuid const & uuid() const
Definition: residue.h:491
String to_pdb_str(int &acount)
Definition: residue.h:367
String const & i_code() const
Definition: residue.h:463
String const & name() const
Definition: residue.h:449
Bead()
Definition: residue.h:60
Definition: residue.h:158
Definition: residue_type.h:19
AtomOP const & get_atom(String const &name) const
Definition: residue.h:267
bool operator==(const Residue &r) const
Definition: residue.h:410
void num(int nnum)
Definition: residue.h:422
void uuid(Uuid const &uuid)
Definition: residue.h:439
String to_str() const
Definition: residue.cc:69
int const & num() const
Definition: residue.h:470
Residue(String const &s, ResidueTypeSet const &rts)
Definition: residue.h:210
~Residue()
Definition: residue.h:239
void to_pdb(String const)
Definition: residue.cc:106
AtomOPs const & atoms() const
Definition: residue.h:484
Bead(Point const ¢er, BeadType const btype)
Definition: residue.h:71
int connected_to(Residue const &res, float cutoff=3.0) const
Definition: residue.h:286
BeadType btype() const
Definition: residue.h:103
void setup_atoms(AtomOPs &)
Definition: residue.cc:31
Residue(Residue const &r)
Definition: residue.h:188
String const & short_name() const
Definition: residue.h:477
void chain_id(String const &nchain_id)
Definition: residue.h:430
Point center() const
Definition: residue.h:96
String const & chain_id() const
Definition: residue.h:456
void new_uuid()
Definition: residue.h:317