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_) {
271 method_details_ = method_details;
281 void AddChain(
String chain);
286 void SetChainList(std::vector<String> chains);
296 const std::vector<std::pair<int, int> >& GetChainIntervalList()
304 void AddOperations(std::vector<MMCifInfoTransOpPtr> operations);
309 const std::vector<std::pair<int, int> >& GetOperationsIntervalList()
311 return tr_operations_;
317 const std::vector<std::vector<MMCifInfoTransOpPtr> >& GetOperations()
323 if (this->id_ != bu.id_) {
326 if (this->details_ != bu.details_) {
329 if (this->chains_ != bu.chains_) {
332 if (this->tr_chains_ != bu.tr_chains_) {
335 if (this->tr_operations_ != bu.tr_operations_) {
338 if (this->operations_.size() == bu.operations_.size()) {
339 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator th_ops_it;
340 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator bu_ops_it;
341 std::vector<MMCifInfoTransOpPtr>::const_iterator th_op_it;
342 std::vector<MMCifInfoTransOpPtr>::const_iterator bu_op_it;
344 for (th_ops_it = this->operations_.begin(),
345 bu_ops_it = bu.operations_.begin();
346 th_ops_it != this->operations_.end();
347 ++th_ops_it, ++bu_ops_it) {
348 if (th_ops_it->size() == bu_ops_it->size()) {
349 for (th_op_it = th_ops_it->begin(), bu_op_it = bu_ops_it->begin();
350 th_op_it != th_ops_it->end();
351 ++th_op_it, ++bu_op_it) {
352 if (*th_op_it != *bu_op_it) {
375 std::vector<String> chains_;
376 std::vector<std::pair<int, int> > tr_chains_;
377 std::vector<std::vector<MMCifInfoTransOpPtr> > operations_;
378 std::vector<std::pair<int, int> > tr_operations_;
385 volume_(
""), page_first_(
""), page_last_(
""), doi_(
""), pubmed_(0),
386 year_(0), title_(
"") {};
510 if (this->year_ != cit.year_) {
513 if (this->pubmed_ != cit.pubmed_) {
516 if (this->where_ != cit.where_) {
519 if (
StringRef(this->id_.c_str(), this->id_.length()) !=
520 StringRef(cit.id_.c_str(), cit.id_.length())) {
523 if (
StringRef(this->cas_.c_str(), this->cas_.length()) !=
524 StringRef(cit.cas_.c_str(), cit.cas_.length())) {
527 if (
StringRef(this->isbn_.c_str(), this->isbn_.length()) !=
528 StringRef(cit.isbn_.c_str(), cit.isbn_.length())) {
531 if (
StringRef(this->published_in_.c_str(), this->published_in_.length()) !=
532 StringRef(cit.published_in_.c_str(), cit.published_in_.length())) {
535 if (
StringRef(this->volume_.c_str(), this->volume_.length()) !=
536 StringRef(cit.volume_.c_str(), cit.volume_.length())) {
539 if (
StringRef(this->page_first_.c_str(), this->page_first_.length()) !=
540 StringRef(cit.page_first_.c_str(), cit.page_first_.length())) {
543 if (
StringRef(this->page_last_.c_str(), this->page_last_.length()) !=
544 StringRef(cit.page_last_.c_str(), cit.page_last_.length())) {
547 if (
StringRef(this->doi_.c_str(), this->doi_.length()) !=
548 StringRef(cit.doi_.c_str(), cit.doi_.length())) {
551 if (
StringRef(this->title_.c_str(), this->title_.length()) !=
552 StringRef(cit.title_.c_str(), cit.title_.length())) {
555 if (this->authors_ != cit.authors_) {
575 MMCifInfoCType where_;
586 std::vector<String> authors_;
595 replaced_pdb_id_(
"") {};
615 else if (type ==
StringRef(
"SPRSDE", 6)) {
663 MMCifObsoleteType id_;
692 if (num_.size() && (num_.back() > num)) {
693 std::stringstream ss;
694 ss <<
"'num' component of 'database_pdb_rev' category has to increase ";
695 ss <<
"with every revision, last was ";
697 ss <<
", trying to add ";
702 date_.push_back(date);
703 status_.push_back(status);
705 if (first_release_ == 0) {
706 if (status ==
"full release") {
707 first_release_ = status_.size();
715 size_t GetSize()
const {
return num_.size(); }
727 int GetNum(
size_t i)
const {
return num_[i]; }
743 size_t GetFirstRelease()
const
745 return first_release_;
750 size_t first_release_;
751 std::vector<int> num_;
752 std::vector<String> date_;
753 std::vector<String> status_;
757 class MMCifInfoStructRef;
758 class MMCifInfoStructRefSeq;
759 class MMCifInfoStructRefSeqDif;
774 id_(id), ent_id_(ent_id), db_name_(db_name), db_ident_(db_ident),
775 db_access_(db_access)
783 const String& chain_name,
int seq_begin,
784 int seq_end,
int db_begin,
int db_end);
789 seqs.reserve(seqs_.size());
790 for (std::map<String, MMCifInfoStructRefSeqPtr>::const_iterator
791 i=seqs_.begin(), e=seqs_.end(); i!=e; ++i) {
792 seqs.push_back(i->second);
802 std::map<String, MMCifInfoStructRefSeqPtr> seqs_;
808 int seq_begin,
int seq_end,
809 int db_begin,
int db_end):
810 id_(align_id), chain_name_(chain_name),
811 seq_begin_(seq_begin), seq_end_(seq_end), db_begin_(db_begin), db_end_(db_end)
822 const std::vector<MMCifInfoStructRefSeqDifPtr>&
GetDifs()
const {
return difs_; }
830 std::vector<MMCifInfoStructRefSeqDifPtr> difs_;
836 seq_rnum_(seq_rnum), db_rnum_(db_rnum), details_(details) {}
869 citations_.push_back(citation);
876 void AddAuthorsToCitation(
StringRef id, std::vector<String> list);
881 const std::vector<MMCifInfoCitation>& GetCitations()
const
896 return StringRef(exptl_method_.c_str(), exptl_method_.length());
941 const std::vector<MMCifInfoBioUnit>& GetBioUnits()
const
951 transops_.push_back(op);
957 const std::vector<MMCifInfoTransOpPtr>& GetOperations()
const
967 struct_details_ = details;
975 return struct_details_;
983 obsolete_ = obsolete;
999 void SetRevisionsDateOriginal(
String date)
1001 revisions_.SetDateOriginal(date);
1011 revisions_.AddRevision(num, date, status);
1030 std::vector<MMCifInfoCitation> citations_;
1031 std::vector<MMCifInfoBioUnit> biounits_;
1032 std::vector<MMCifInfoTransOpPtr> transops_;
1034 std::map<String, String> cif_2_pdb_chain_id_;
1035 std::map<String, String> pdb_2_cif_chain_id_;