19 #ifndef OST_MMCIF_INFO_HH
20 #define OST_MMCIF_INFO_HH
24 #include <boost/shared_ptr.hpp>
30 namespace ost {
namespace io {
36 descriptor_(
""), mass_(0.0), mass_method_(
""), model_details_(
""),
37 model_type_details_(
"") {};
112 if (this->entry_id_ != sd.entry_id_) {
115 if (this->casp_flag_ != sd.casp_flag_) {
118 if (this->descriptor_ != sd.descriptor_) {
121 if (this->mass_ != sd.mass_) {
124 if (this->mass_method_ != sd.mass_method_) {
127 if (this->model_details_ != sd.model_details_) {
130 if (this->model_type_details_ != sd.model_type_details_) {
133 if (this->title_ != sd.title_) {
152 String model_type_details_;
186 translation_.SetX(x);
187 translation_.SetY(y);
188 translation_.SetZ(z);
202 rotation_ =
geom::Mat3(i00,i01,i02, i10,i11,i12, i20,i21,i22);
210 if (this->id_ != op.id_) {
213 if (this->type_ != op.type_) {
216 if (this->translation_ != op.translation_) {
219 if (this->rotation_ != op.rotation_) {
270 void AddChain(
String chain);
275 void SetChainList(std::vector<String> chains);
285 const std::vector<std::pair<int, int> >& GetChainIntervalList()
293 void AddOperations(std::vector<MMCifInfoTransOpPtr> operations);
298 const std::vector<std::pair<int, int> >& GetOperationsIntervalList()
300 return tr_operations_;
306 const std::vector<std::vector<MMCifInfoTransOpPtr> >& GetOperations()
312 if (this->id_ != bu.id_) {
315 if (this->details_ != bu.details_) {
318 if (this->chains_ != bu.chains_) {
321 if (this->tr_chains_ != bu.tr_chains_) {
324 if (this->tr_operations_ != bu.tr_operations_) {
327 if (this->operations_.size() == bu.operations_.size()) {
328 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator th_ops_it;
329 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator bu_ops_it;
330 std::vector<MMCifInfoTransOpPtr>::const_iterator th_op_it;
331 std::vector<MMCifInfoTransOpPtr>::const_iterator bu_op_it;
333 for (th_ops_it = this->operations_.begin(),
334 bu_ops_it = bu.operations_.begin();
335 th_ops_it != this->operations_.end();
336 ++th_ops_it, ++bu_ops_it) {
337 if (th_ops_it->size() == bu_ops_it->size()) {
338 for (th_op_it = th_ops_it->begin(), bu_op_it = bu_ops_it->begin();
339 th_op_it != th_ops_it->end();
340 ++th_op_it, ++bu_op_it) {
341 if (*th_op_it != *bu_op_it) {
363 std::vector<String> chains_;
364 std::vector<std::pair<int, int> > tr_chains_;
365 std::vector<std::vector<MMCifInfoTransOpPtr> > operations_;
366 std::vector<std::pair<int, int> > tr_operations_;
373 volume_(
""), page_first_(
""), page_last_(
""), doi_(
""), pubmed_(0),
374 year_(0), title_(
"") {};
498 if (this->year_ != cit.year_) {
501 if (this->pubmed_ != cit.pubmed_) {
504 if (this->where_ != cit.where_) {
507 if (
StringRef(this->id_.c_str(), this->id_.length()) !=
508 StringRef(cit.id_.c_str(), cit.id_.length())) {
511 if (
StringRef(this->cas_.c_str(), this->cas_.length()) !=
512 StringRef(cit.cas_.c_str(), cit.cas_.length())) {
515 if (
StringRef(this->isbn_.c_str(), this->isbn_.length()) !=
516 StringRef(cit.isbn_.c_str(), cit.isbn_.length())) {
519 if (
StringRef(this->published_in_.c_str(), this->published_in_.length()) !=
520 StringRef(cit.published_in_.c_str(), cit.published_in_.length())) {
523 if (
StringRef(this->volume_.c_str(), this->volume_.length()) !=
524 StringRef(cit.volume_.c_str(), cit.volume_.length())) {
527 if (
StringRef(this->page_first_.c_str(), this->page_first_.length()) !=
528 StringRef(cit.page_first_.c_str(), cit.page_first_.length())) {
531 if (
StringRef(this->page_last_.c_str(), this->page_last_.length()) !=
532 StringRef(cit.page_last_.c_str(), cit.page_last_.length())) {
535 if (
StringRef(this->doi_.c_str(), this->doi_.length()) !=
536 StringRef(cit.doi_.c_str(), cit.doi_.length())) {
539 if (
StringRef(this->title_.c_str(), this->title_.length()) !=
540 StringRef(cit.title_.c_str(), cit.title_.length())) {
543 if (this->authors_ != cit.authors_) {
563 MMCifInfoCType where_;
574 std::vector<String> authors_;
583 replaced_pdb_id_(
"") {};
603 else if (type ==
StringRef(
"SPRSDE", 6)) {
651 MMCifObsoleteType id_;
680 if (num_.size() && (num_.back() > num)) {
681 std::stringstream ss;
682 ss <<
"'num' component of 'database_pdb_rev' category has to increase ";
683 ss <<
"with every revision, last was ";
685 ss <<
", trying to add ";
690 date_.push_back(date);
691 status_.push_back(status);
693 if (first_release_ == 0) {
694 if (status ==
"full release") {
695 first_release_ = status_.size();
703 size_t GetSize()
const {
return num_.size(); }
715 int GetNum(
size_t i)
const {
return num_[i]; }
731 size_t GetFirstRelease()
const
733 return first_release_;
738 size_t first_release_;
739 std::vector<int> num_;
740 std::vector<String> date_;
741 std::vector<String> status_;
745 class MMCifInfoStructRef;
746 class MMCifInfoStructRefSeq;
762 id_(id), ent_id_(ent_id), db_name_(db_name), db_ident_(db_ident),
763 db_access_(db_access)
771 const String& chain_name,
int seq_begin,
772 int seq_end,
int db_begin,
int db_end);
777 seqs.reserve(seqs_.size());
778 for (std::map<String, MMCifInfoStructRefSeqPtr>::const_iterator
779 i=seqs_.begin(), e=seqs_.end(); i!=e; ++i) {
780 seqs.push_back(i->second);
790 std::map<String, MMCifInfoStructRefSeqPtr> seqs_;
796 int seq_begin,
int seq_end,
797 int db_begin,
int db_end):
798 id_(align_id), chain_name_(chain_name),
799 seq_begin_(seq_begin), seq_end_(seq_end), db_begin_(db_begin), db_end_(db_end)
810 const std::vector<MMCifInfoStructRefSeqDifPtr>&
GetDifs()
const {
return difs_; }
818 std::vector<MMCifInfoStructRefSeqDifPtr> difs_;
824 seq_rnum_(seq_rnum), db_rnum_(db_rnum), details_(details) {}
857 citations_.push_back(citation);
864 void AddAuthorsToCitation(
StringRef id, std::vector<String> list);
869 const std::vector<MMCifInfoCitation>& GetCitations()
const
884 return StringRef(exptl_method_.c_str(), exptl_method_.length());
929 const std::vector<MMCifInfoBioUnit>& GetBioUnits()
const
939 transops_.push_back(op);
945 const std::vector<MMCifInfoTransOpPtr>& GetOperations()
const
955 struct_details_ = details;
963 return struct_details_;
971 obsolete_ = obsolete;
987 void SetRevisionsDateOriginal(
String date)
989 revisions_.SetDateOriginal(date);
999 revisions_.AddRevision(num, date, status);
1018 std::vector<MMCifInfoCitation> citations_;
1019 std::vector<MMCifInfoBioUnit> biounits_;
1020 std::vector<MMCifInfoTransOpPtr> transops_;
1022 std::map<String, String> cif_2_pdb_chain_id_;
1023 std::map<String, String> pdb_2_cif_chain_id_;