RNAMake
residue_type.h
1 //
2 // residue_type.h
3 // RNAMake
4 //
5 // Created by Joseph Yesselman on 1/24/15.
6 // Copyright (c) 2015 Joseph Yesselman. All rights reserved.
7 //
8 
9 #ifndef __RNAMake__residue_type__
10 #define __RNAMake__residue_type__
11 
12 #include <stdio.h>
13 #include <vector>
14 
15 //RNAMake Headers
16 #include "base/types.h"
17 #include "structure/atom.h"
18 
19 class ResidueType {
20 public:
21  ResidueType() {}
23  String const &,
24  StringIntMap const &);
25 
26  ~ResidueType() {}
27 
28 public:
29  String
30  get_correct_atom_name(
31  Atom const &) const;
32 
33  int
34  match_name(
35  String const &) const;
36 
37  inline
38  String
39  const &
40  name() const { return name_; }
41 
42  inline
43  String
44  const &
45  short_name() const { return alt_names_[0]; }
46 
47  inline
48  int
49  atom_pos_by_name(
50  String const & aname) const {
51 
52  StringIntMap::const_iterator iter( atom_map_.find(aname));
53  if(iter != atom_map_.end()) {
54  return iter->second;
55  }
56  else {
57  return -1;
58  }
59  }
60 
61  inline
62  int
63  size() { return (int)atom_map_.size(); }
64 
65 private:
66 
67  void
68  extend_res_specific_altnames();
69 
70 private:
71  String name_;
72  StringIntMap atom_map_;
73  Strings alt_names_;
74  StringStringMap atom_alt_names_;
75 
76 };
77 
78 typedef std::vector<ResidueType> ResidueTypes;
79 
80 
81 #endif /* defined(__RNAMake__residue_type__) */
Definition: residue_type.h:19
Definition: atom.h:26