OpenStructure
Loading...
Searching...
No Matches
mmcif_info.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// This file is part of the OpenStructure project <www.openstructure.org>
3//
4// Copyright (C) 2008-2020 by the OpenStructure authors
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License as published by the Free
8// Software Foundation; either version 3.0 of the License, or (at your option)
9// any later version.
10// This library is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this library; if not, write to the Free Software Foundation, Inc.,
17// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18//------------------------------------------------------------------------------
19#ifndef OST_MMCIF_INFO_HH
20#define OST_MMCIF_INFO_HH
21
22#include <vector>
23#include <map>
24#include <boost/shared_ptr.hpp>
26#include <ost/geom/geom.hh>
27#include <ost/string_ref.hh>
29#include <ost/mol/mol.hh>
31
32namespace ost { namespace io {
33
35public:
37 MMCifInfoStructDetails(): entry_id_(""), title_(""), casp_flag_('\0'),
38 descriptor_(""), mass_(0.0), mass_method_(""), model_details_(""),
39 model_type_details_("") {};
40
44 void SetEntryID(String id) { entry_id_ = id; }
48 String GetEntryID() const { return entry_id_; }
49
53 void SetCASPFlag(char flag) { casp_flag_ = flag; }
57 char GetCASPFlag() const { return casp_flag_; }
58
62 void SetDescriptor(String desc) { descriptor_ = desc; }
66 String GetDescriptor() const { return descriptor_; }
67
71 void SetMass(Real mass) { mass_ = mass; }
75 Real GetMass() const { return mass_; }
76
80 void SetMassMethod(String method) { mass_method_ = method; }
84 String GetMassMethod() const { return mass_method_; }
85
89 void SetModelDetails(String desc) { model_details_ = desc; }
93 String GetModelDetails() const { return model_details_; }
94
98 void SetModelTypeDetails(String desc) { model_type_details_ = desc; }
102 String GetModelTypeDetails() const { return model_type_details_; }
103
107 void SetTitle(String title) { title_ = title; }
111 String GetTitle() const { return title_; }
112
113 bool operator==(const MMCifInfoStructDetails& sd) const {
114 if (this->entry_id_ != sd.entry_id_) {
115 return false;
116 }
117 if (this->casp_flag_ != sd.casp_flag_) {
118 return false;
119 }
120 if (this->descriptor_ != sd.descriptor_) {
121 return false;
122 }
123 if (this->mass_ != sd.mass_) {
124 return false;
125 }
126 if (this->mass_method_ != sd.mass_method_) {
127 return false;
128 }
129 if (this->model_details_ != sd.model_details_) {
130 return false;
131 }
132 if (this->model_type_details_ != sd.model_type_details_) {
133 return false;
134 }
135 if (this->title_ != sd.title_) {
136 return false;
137 }
138
139 return true;
140 }
141
142 bool operator!=(const MMCifInfoStructDetails& sd) const {
143 return !this->operator == (sd);
144 }
145
146private:
147 String entry_id_;
148 String title_;
149 char casp_flag_;
150 String descriptor_;
151 Real mass_;
152 String mass_method_;
153 String model_details_;
154 String model_type_details_;
155};
156
158public:
160 MMCifInfoTransOp(): id_(""), type_("")
161 {
162 translation_ = geom::Vec3();
163 };
164
168 void SetID(String id) { id_ = id; }
172 String GetID() const { return id_; }
173
177 void SetType(String type) { type_ = type; }
181 String GetType() const { return type_; }
182
188 void SetVector(Real x, Real y, Real z)
189 {
190 translation_.SetX(x);
191 translation_.SetY(y);
192 translation_.SetZ(z);
193 }
197 geom::Vec3 GetVector() const { return translation_; }
198
210 void SetMatrix(Real i00, Real i01, Real i02,
211 Real i10, Real i11, Real i12,
212 Real i20, Real i21, Real i22)
213 {
214 rotation_ = geom::Mat3(i00,i01,i02, i10,i11,i12, i20,i21,i22);
215 }
219 geom::Mat3 GetMatrix() const { return rotation_; }
220
221 bool operator==(const MMCifInfoTransOp& op) const {
222 if (this->id_ != op.id_) {
223 return false;
224 }
225 if (this->type_ != op.type_) {
226 return false;
227 }
228 if (this->translation_ != op.translation_) {
229 return false;
230 }
231 if (this->rotation_ != op.rotation_) {
232 return false;
233 }
234
235 return true;
236 }
237
238 bool operator!=(const MMCifInfoTransOp& op) const {
239 return !this->operator==(op);
240 }
241
242private:
243 String id_;
244 String type_;
245 geom::Vec3 translation_;
246 geom::Mat3 rotation_;
247};
248typedef boost::shared_ptr<MMCifInfoTransOp> MMCifInfoTransOpPtr;
249
250
252public:
254 MMCifInfoBioUnit(): id_(""), details_("") {};
255
260
264 void SetID(String id) { id_ = id; }
268 String GetID() const { return id_; }
269
273 void SetDetails(String details) { details_ = details; }
277 String GetDetails() const { return details_; }
278
282 void SetMethodDetails(String method_details) {
283 method_details_ = method_details;
284 }
288 String GetMethodDetails() const { return method_details_; }
289
293 void AddChain(String chain);
294
298 void SetChainList(std::vector<String> chains);
299
303 const std::vector<String>& GetChainList() const { return chains_; }
304
308 const std::vector<std::pair<int, int> >& GetChainIntervalList() const
309 {
310 return tr_chains_;
311 }
312
316 void AddOperations(std::vector<MMCifInfoTransOpPtr> operations);
317
321 const std::vector<std::pair<int, int> >& GetOperationsIntervalList() const
322 {
323 return tr_operations_;
324 }
325
329 const std::vector<std::vector<MMCifInfoTransOpPtr> >& GetOperations() const
330 {
331 return operations_;
332 }
333
334 bool operator==(const MMCifInfoBioUnit& bu) const {
335 if (this->id_ != bu.id_) {
336 return false;
337 }
338 if (this->details_ != bu.details_) {
339 return false;
340 }
341 if (this->chains_ != bu.chains_) {
342 return false;
343 }
344 if (this->tr_chains_ != bu.tr_chains_) {
345 return false;
346 }
347 if (this->tr_operations_ != bu.tr_operations_) {
348 return false;
349 }
350 if (this->operations_.size() == bu.operations_.size()) {
351 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator th_ops_it;
352 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator bu_ops_it;
353 std::vector<MMCifInfoTransOpPtr>::const_iterator th_op_it;
354 std::vector<MMCifInfoTransOpPtr>::const_iterator bu_op_it;
355
356 for (th_ops_it = this->operations_.begin(),
357 bu_ops_it = bu.operations_.begin();
358 th_ops_it != this->operations_.end();
359 ++th_ops_it, ++bu_ops_it) {
360 if (th_ops_it->size() == bu_ops_it->size()) {
361 for (th_op_it = th_ops_it->begin(), bu_op_it = bu_ops_it->begin();
362 th_op_it != th_ops_it->end();
363 ++th_op_it, ++bu_op_it) {
364 if (*th_op_it != *bu_op_it) {
365 return false;
366 }
367 }
368 } else {
369 return false;
370 }
371 }
372 } else {
373 return false;
374 }
375
376 return true;
377 }
378
379 bool operator!=(const MMCifInfoBioUnit& bu) const {
380 return !this->operator==(bu);
381 }
382
383private:
384 String id_;
385 String details_;
386 String method_details_;
387 std::vector<String> chains_;
388 std::vector<std::pair<int, int> > tr_chains_; //< chains of a transformation
389 std::vector<std::vector<MMCifInfoTransOpPtr> > operations_;
390 std::vector<std::pair<int, int> > tr_operations_; //< ops. of a transformation
391};
392
394public:
396 typedef enum {
399 UNKNOWN
400 } MMCifInfoCType;
401
403 MMCifInfoCitation(): id_(""), where_(UNKNOWN), cas_(""), published_in_(""),
404 volume_(""), page_first_(""), page_last_(""), doi_(""), pubmed_(0),
405 year_(0), title_(""), book_publisher_(""), book_publisher_city_("") {};
409 void SetID(String id) { id_ = id; }
413 String GetID() const { return id_; }
414
418 void SetCAS(String id) { cas_ = id; }
422 String GetCAS() const { return cas_; }
423
427 void SetISBN(String code) { isbn_ = code; }
428
432 String GetISBN() const { return isbn_; }
433
437 void SetPublishedIn(String title) { published_in_ = title; }
438
442 String GetPublishedIn() const { return published_in_; }
443
447 void SetVolume(String volume) { volume_ = volume; }
448
452 String GetVolume() const { return volume_; }
453
457 void SetPageFirst(String first) { page_first_ = first; }
458
462 String GetPageFirst() const { return page_first_; }
463
467 void SetPageLast(String last) { page_last_ = last; }
468
472 String GetPageLast() const { return page_last_; }
473
477 void SetBookPublisher(String publisher) { book_publisher_ = publisher; }
478
482 String GetBookPublisher() const { return book_publisher_; }
483
487 void SetBookPublisherCity(String publisher_city) {
488 book_publisher_city_ = publisher_city;
489 }
490
494 String GetBookPublisherCity() const { return book_publisher_city_; }
495
496//book_publisher_city_
497
501 void SetDOI(String doi) { doi_ = doi; }
502
506 String GetDOI() const { return doi_; }
507
511 void SetPubMed(int no) { pubmed_ = no; }
512
516 int GetPubMed() const { return pubmed_; }
517
521 void SetYear(int year) { year_ = year; }
522
523
527 int GetYear() const { return year_; }
528
529
533 void SetTitle(String title) { title_ = title; }
534
538 String GetTitle() const { return title_; }
539
543 void SetCitationType(MMCifInfoCType publication_type) {
544 where_ = publication_type;
545 }
546
549 where_ = MMCifInfoCitation::JOURNAL;
550 }
551
554 where_ = MMCifInfoCitation::BOOK;
555 }
556
559 where_ = MMCifInfoCitation::UNKNOWN;
560 }
561
565 MMCifInfoCType GetCitationType() const { return where_; }
566
571 return where_ == MMCifInfoCitation::JOURNAL;
572 }
573
577 bool IsCitationTypeBook() const {
578 return where_ == MMCifInfoCitation::BOOK;
579 }
580
585 return where_ == MMCifInfoCitation::UNKNOWN;
586 }
587
591 void SetAuthorList(std::vector<String> list) { authors_ = list; }
592
596 const std::vector<String>& GetAuthorList() const { return authors_; }
597
598 bool operator==(const MMCifInfoCitation& cit) const {
599 if (this->year_ != cit.year_) {
600 return false;
601 }
602 if (this->pubmed_ != cit.pubmed_) {
603 return false;
604 }
605 if (this->where_ != cit.where_) {
606 return false;
607 }
608 if (StringRef(this->id_.c_str(), this->id_.length()) !=
609 StringRef(cit.id_.c_str(), cit.id_.length())) {
610 return false;
611 }
612 if (StringRef(this->cas_.c_str(), this->cas_.length()) !=
613 StringRef(cit.cas_.c_str(), cit.cas_.length())) {
614 return false;
615 }
616 if (StringRef(this->isbn_.c_str(), this->isbn_.length()) !=
617 StringRef(cit.isbn_.c_str(), cit.isbn_.length())) {
618 return false;
619 }
620 if (StringRef(this->published_in_.c_str(), this->published_in_.length()) !=
621 StringRef(cit.published_in_.c_str(), cit.published_in_.length())) {
622 return false;
623 }
624 if (StringRef(this->volume_.c_str(), this->volume_.length()) !=
625 StringRef(cit.volume_.c_str(), cit.volume_.length())) {
626 return false;
627 }
628 if (StringRef(this->page_first_.c_str(), this->page_first_.length()) !=
629 StringRef(cit.page_first_.c_str(), cit.page_first_.length())) {
630 return false;
631 }
632 if (StringRef(this->page_last_.c_str(), this->page_last_.length()) !=
633 StringRef(cit.page_last_.c_str(), cit.page_last_.length())) {
634 return false;
635 }
636 if (StringRef(this->doi_.c_str(), this->doi_.length()) !=
637 StringRef(cit.doi_.c_str(), cit.doi_.length())) {
638 return false;
639 }
640 if (StringRef(this->title_.c_str(), this->title_.length()) !=
641 StringRef(cit.title_.c_str(), cit.title_.length())) {
642 return false;
643 }
644 if (StringRef(this->book_publisher_.c_str(),
645 this->book_publisher_.length()) !=
646 StringRef(cit.book_publisher_.c_str(),
647 cit.book_publisher_.length())) {
648 return false;
649 }
650 if (StringRef(this->book_publisher_city_.c_str(),
651 this->book_publisher_city_.length()) !=
652 StringRef(cit.book_publisher_city_.c_str(),
653 cit.book_publisher_city_.length())) {
654 return false;
655 }
656 if (this->authors_ != cit.authors_) {
657 return false;
658 }
659
660 return true;
661 }
662
663 bool operator!=(const MMCifInfoCitation& cit) const {
664 return !this->operator==(cit);
665 }
666
667private:
668 String id_;
669 MMCifInfoCType where_;
670 String cas_;
671 String isbn_;
672 String published_in_;
673 String volume_;
674 String page_first_;
675 String page_last_;
676 String doi_;
677 int pubmed_;
678 int year_;
679 String title_;
680 String book_publisher_;
681 String book_publisher_city_;
682 std::vector<String> authors_;
683};
684
688public:
690 MMCifInfoObsolete(): date_(""), id_(UNKNOWN), pdb_id_(""),
691 replaced_pdb_id_("") {};
692
696 void SetDate(String date) { date_ = date; }
697
701 String GetDate() { return date_; }
702
706 void SetID(StringRef type)
707 {
708 if (type == StringRef("OBSLTE", 6)) {
709 id_ = OBSLTE;
710 }
711 else if (type == StringRef("SPRSDE", 6)) {
712 id_ = SPRSDE;
713 }
714 }
715
720 {
721 if (id_ == OBSLTE) {
722 return "Obsolete";
723 }
724 if (id_ == SPRSDE) {
725 return "Supersede";
726 }
727 return "Unknown";
728 }
729
733 void SetPDBID(String id) { pdb_id_ = id; }
734
738 String GetPDBID() { return pdb_id_; }
739
743 void SetReplacedPDBID(String id) { replaced_pdb_id_ = id; }
744
748 String GetReplacedPDBID() { return replaced_pdb_id_; }
749
750private:
752 typedef enum {
753 OBSLTE,
754 SPRSDE,
755 UNKNOWN
756 } MMCifObsoleteType;
757
758 String date_;
759 MMCifObsoleteType id_;
760 String pdb_id_;
761 String replaced_pdb_id_;
762};
763
767public:
769 MMCifInfoRevisions(): date_original_("?"), first_release_(0) {};
770
771 // original depositon date
772 void SetDateOriginal(String date) { date_original_ = date; }
773 String GetDateOriginal() const { return date_original_; }
774
775 // revision history
776 void AddRevision(int num, String date, String status, int major = -1,
777 int minor = -1)
778 {
779 if (num_.size() && (num_.back() >= num)) {
780 std::stringstream ss;
781 ss << "Unique ID of revision has to increase with every revision, "
782 << "last was " << num_.back() << ", trying to add " << num;
783 throw IOException(ss.str());
784 }
785 num_.push_back(num);
786 date_.push_back(date);
787 status_.push_back(status);
788 major_.push_back(major);
789 minor_.push_back(minor);
790 // set first release date if not already occupied
791 if (first_release_ == 0) {
792 if (status == "full release" || status == "Initial release") {
793 first_release_ = status_.size();
794 }
795 }
796 }
797
798 // revision history getters
799 size_t GetSize() const { return num_.size(); }
800 String GetDate(size_t i) const { return date_.at(i); }
801 int GetNum(size_t i) const { return num_.at(i); }
802 String GetStatus(size_t i) const { return status_.at(i); }
803 int GetMajor(size_t i) const { return major_.at(i); }
804 int GetMinor(size_t i) const { return minor_.at(i); }
805
806 // get info of first and last revision
808 if (date_.empty()) return "?";
809 else return date_.back();
810 }
811 int GetLastMajor() const {
812 if (major_.empty()) return -1;
813 else return major_.back();
814 }
815 int GetLastMinor() const {
816 if (minor_.empty()) return -1;
817 else return minor_.back();
818 }
819 size_t GetFirstRelease() const {
820 return first_release_;
821 }
822
823private:
824 String date_original_;
825 size_t first_release_;
826 std::vector<int> num_;
827 std::vector<String> date_;
828 std::vector<String> status_;
829 std::vector<int> major_;
830 std::vector<int> minor_;
831};
832
833
834class MMCifInfoStructRef;
835class MMCifInfoStructRefSeq;
836class MMCifInfoStructRefSeqDif;
837
838
839typedef boost::shared_ptr<MMCifInfoStructRef> MMCifInfoStructRefPtr;
840typedef boost::shared_ptr<MMCifInfoStructRefSeq> MMCifInfoStructRefSeqPtr;
841typedef boost::shared_ptr<MMCifInfoStructRefSeqDif> MMCifInfoStructRefSeqDifPtr;
842
843typedef std::vector<MMCifInfoStructRefPtr> MMCifInfoStructRefs;
844typedef std::vector<MMCifInfoStructRefSeqPtr> MMCifInfoStructRefSeqs;
845typedef std::vector<MMCifInfoStructRefSeqDifPtr> MMCifInfoStructRefSeqDifs;
847public:
848 MMCifInfoStructRef(const String& id, const String& ent_id,
849 const String& db_name,
850 const String& db_ident, const String& db_access):
851 id_(id), ent_id_(ent_id), db_name_(db_name), db_ident_(db_ident),
852 db_access_(db_access)
853 { }
854 const String& GetID() const { return id_; }
855 const String& GetDBName() const { return db_name_; }
856 const String& GetDBID() const { return db_ident_; }
857 const String& GetEntityID() const { return ent_id_; }
858 const String& GetDBAccess() const { return db_access_; }
860 const String& chain_name, int seq_begin,
861 int seq_end, int db_begin, int db_end,
862 bool fault_tolerant);
865 {
867 seqs.reserve(seqs_.size());
868 for (std::map<String, MMCifInfoStructRefSeqPtr>::const_iterator
869 i=seqs_.begin(), e=seqs_.end(); i!=e; ++i) {
870 seqs.push_back(i->second);
871 }
872 return seqs;
873 }
874private:
875 String id_;
876 String ent_id_;
877 String db_name_;
878 String db_ident_;
879 String db_access_;
880 std::map<String, MMCifInfoStructRefSeqPtr> seqs_;
881};
882
884public:
885 MMCifInfoStructRefSeq(const String& align_id, const String& chain_name,
886 int seq_begin, int seq_end,
887 int db_begin, int db_end):
888 id_(align_id), chain_name_(chain_name),
889 seq_begin_(seq_begin), seq_end_(seq_end), db_begin_(db_begin), db_end_(db_end)
890 { }
891
892 const String& GetID() const { return id_; }
893 const String& GetChainName() const { return chain_name_; }
894 int GetSeqBegin() const { return seq_begin_; }
895 int GetSeqEnd() const { return seq_end_; }
896 int GetDBBegin() const { return db_begin_; }
897 int GetDBEnd() const { return db_end_; }
898 MMCifInfoStructRefSeqDifPtr AddDif(int seq_num, const String& db_rnum,
899 const String& details);
900 const std::vector<MMCifInfoStructRefSeqDifPtr>& GetDifs() const { return difs_; }
901private:
902 String id_;
903 String chain_name_;
904 int seq_begin_;
905 int seq_end_;
906 int db_begin_;
907 int db_end_;
908 std::vector<MMCifInfoStructRefSeqDifPtr> difs_;
909};
910
912public:
913 MMCifInfoStructRefSeqDif(int seq_rnum, const String& db_rnum, const String& details):
914 seq_rnum_(seq_rnum), db_rnum_(db_rnum), details_(details) {}
915 int GetSeqRNum() const { return seq_rnum_;}
916 const String& GetDBRNum() const { return db_rnum_; }
917 const String& GetDetails() const { return details_; }
918private:
919 int seq_rnum_;
920 String db_rnum_;
921 String details_;
922};
923
928 int rnum2,
929 const String& aname1,
930 const String& aname2,
931 unsigned char bond_order): rnum1(rnum1), rnum2(rnum2),
932 aname1(aname1), aname2(aname2),
933 bond_order(bond_order) { }
934
935 bool operator==(const MMCifInfoEntityBranchLink& rhs) const {
936 return rnum1 == rhs.rnum1 && rnum2 == rhs.rnum2 &&
937 aname1 == rhs.aname1 && aname2 == rhs.aname2 &&
938 bond_order == rhs.bond_order;
939 }
940
941 bool operator!=(const MMCifInfoEntityBranchLink& rhs) const {
942 return !((*this) == rhs);
943 }
944
945 int rnum1;
946 int rnum2;
949 unsigned char bond_order;
950};
951typedef std::map<String, std::vector<MMCifInfoEntityBranchLink> > MMCifInfoEntityBranchLinkMap;
952
953
967typedef std::map<String, MMCifEntityDesc> MMCifEntityDescMap;
968
969
984public:
986 MMCifInfo(): exptl_method_(""), resolution_(0), em_resolution_(0), r_free_(0),
987 r_work_(0), data_block_name_("") { }
988
992 void AddCitation(MMCifInfoCitation citation) // unit test
993 {
994 citations_.push_back(citation);
995 }
996
1001 void AddAuthorsToCitation(StringRef id, std::vector<String> list,
1002 bool fault_tolerant=false); //unit test
1003
1007 const std::vector<MMCifInfoCitation>& GetCitations() const
1008 {
1009 return citations_;
1010 }
1011
1015 void SetMethod(String method) { exptl_method_ = method; }
1016
1020 const StringRef GetMethod() const
1021 {
1022 return StringRef(exptl_method_.c_str(), exptl_method_.length());
1023 }
1024
1028 void SetResolution(Real res) { resolution_ = res; }
1029
1033 Real GetResolution() const { return resolution_; }
1034
1038 void SetEMResolution(Real res) { em_resolution_ = res; }
1039
1043 Real GetEMResolution() const { return em_resolution_; }
1044
1048 void SetRFree(Real r_free) { r_free_ = r_free; }
1049
1053 Real GetRFree() const { return r_free_; }
1054
1058 void SetRWork(Real r_work) { r_work_ = r_work; }
1059
1063 Real GetRWork() const { return r_work_; }
1064
1065 void SetDataBlockName(const String& name) {data_block_name_ = name; }
1066 String GetDataBlockName() const {return data_block_name_;}
1067
1073 bool fault_tolerant=false);
1074
1080
1086 bool fault_tolerant=false);
1087
1093
1099 bool fault_tolerant=false);
1100
1106
1111
1115 const std::vector<MMCifInfoBioUnit>& GetBioUnits() const
1116 {
1117 return biounits_;
1118 }
1119
1123 void AddOperation(MMCifInfoTransOpPtr op) // unit test
1124 {
1125 transops_.push_back(op);
1126 }
1127
1131 const std::vector<MMCifInfoTransOpPtr>& GetOperations() const
1132 {
1133 return transops_;
1134 }
1135
1140 {
1141 struct_details_ = details;
1142 }
1143
1148 {
1149 return struct_details_;
1150 }
1151
1156 {
1157 obsolete_ = obsolete;
1158 }
1159
1164 {
1165 return obsolete_;
1166 }
1167 const MMCifInfoStructRefs& GetStructRefs() const { return struct_refs_; }
1168 void SetStructRefs(const MMCifInfoStructRefs& sr) { struct_refs_=sr; }
1169
1174 {
1175 // only set once
1176 if (revisions_.GetDateOriginal() == "?") {
1177 revisions_.SetDateOriginal(date);
1178 }
1179 }
1180
1183 void AddRevision(int num, String date, String status, int major = -1,
1184 int minor = -1)
1185 {
1186 revisions_.AddRevision(num, date, status, major, minor);
1187 }
1188
1193 {
1194 return revisions_;
1195 }
1196
1203 int rnum1, int rnum2,
1204 const String& aname1,
1205 const String& aname2,
1206 unsigned char bond_order);
1207
1211 const std::vector<MMCifInfoEntityBranchLink> GetEntityBranchByChain(
1212 const String& chain_name) const;
1213
1216 const std::vector<String> GetEntityBranchChainNames() const;
1217
1218 const MMCifEntityDesc& GetEntityDesc(const String& entity_id) const;
1219
1220 void SetEntityDesc(const String& entity_id,
1221 const MMCifEntityDesc& entity_desc);
1222
1223 std::vector<String> GetEntityIds() const;
1224
1225 std::vector<String> GetEntityIdsOfType(const String& type) const;
1226
1227//protected:
1228
1229private:
1230 // members
1231 String exptl_method_;
1232 Real resolution_;
1233 Real em_resolution_;
1234 Real r_free_;
1235 Real r_work_;
1236 String data_block_name_;
1237 MMCifInfoStructDetails struct_details_;
1238 MMCifInfoObsolete obsolete_;
1239 MMCifInfoRevisions revisions_;
1240 std::vector<MMCifInfoCitation> citations_;
1241 std::vector<MMCifInfoBioUnit> biounits_;
1242 std::vector<MMCifInfoTransOpPtr> transops_;
1243 MMCifInfoStructRefs struct_refs_;
1244 MMCifEntityDescMap entity_desc_;
1245 std::map<String, String> cif_2_pdb_chain_id_;
1246 std::map<String, String> pdb_2_cif_chain_id_;
1247 std::map<String, String> cif_2_entity_id_;
1248 std::map<String, std::vector<MMCifInfoEntityBranchLink> > entity_branches_;
1249};
1250
1251DLLEXPORT_OST_IO std::ostream& operator<<(std::ostream& os,
1252 const MMCifInfoEntityBranchLink& eb);
1253
1254DLLEXPORT_OST_IO std::ostream& operator<<(std::ostream& os,
1255 const std::vector<MMCifInfoEntityBranchLink>& eb_list);
1256}} // ns
1257
1258#endif
Three dimensional vector class, using Real precision.
Definition vec3.hh:48
convenient datatype for referencing character data
Definition string_ref.hh:39
void AddOperations(std::vector< MMCifInfoTransOpPtr > operations)
Add a set of operations.
void AddChain(String chain)
Add a chain name.
const std::vector< std::pair< int, int > > & GetChainIntervalList() const
Get the list of intervals of chains.
void Merge(MMCifInfoBioUnit &from)
Merge chains & operations, set intervals.
bool operator!=(const MMCifInfoBioUnit &bu) const
const std::vector< String > & GetChainList() const
Get vector of chain names.
void SetMethodDetails(String method_details)
Set method details.
const std::vector< std::vector< MMCifInfoTransOpPtr > > & GetOperations() const
Get the list of operations.
void SetChainList(std::vector< String > chains)
Set a vector of chain names.
void SetID(String id)
Set id.
const std::vector< std::pair< int, int > > & GetOperationsIntervalList() const
Get the list of intervals of operations.
void SetDetails(String details)
Set details.
String GetMethodDetails() const
Get method details.
String GetDetails() const
Get details.
MMCifInfoBioUnit()
Create a biounit.
String GetID() const
Get id.
bool operator==(const MMCifInfoBioUnit &bu) const
String GetISBN() const
Get an ISBN code.
void SetPubMed(int no)
Set the PubMed accession number.
void SetTitle(String title)
Set the title of a publication.
void SetCitationTypeUnknown()
Set the type of a publication to unknown.
void SetISBN(String code)
Set an ISBN code.
void SetCitationTypeJournal()
Set the type of a publication to journal.
void SetCAS(String id)
Set a CAS identifier.
String GetTitle() const
Get the title of a publication.
bool IsCitationTypeJournal() const
Check a citation to be published in a journal.
String GetPageLast() const
Get the last page of a publication.
int GetYear() const
Get the year of a publication.
void SetCitationTypeBook()
Set the type of a publication to book.
MMCifInfoCitation()
Create a citation.
void SetPageLast(String last)
Set the end page for a publication.
String GetCAS() const
Get a CAS identifier.
void SetBookPublisher(String publisher)
Set the publisher for a book.
void SetDOI(String doi)
Set the DOI of a document.
String GetDOI() const
Get the DOI of a document.
void SetAuthorList(std::vector< String > list)
Set the list of authors.
String GetPublishedIn() const
Get a book title or journal name.
MMCifInfoCType GetCitationType() const
Get the type of a publication.
void SetCitationType(MMCifInfoCType publication_type)
Set the type of a publication.
bool operator==(const MMCifInfoCitation &cit) const
bool operator!=(const MMCifInfoCitation &cit) const
bool IsCitationTypeUnknown() const
Check if the citation type is unknow.
bool IsCitationTypeBook() const
Check a citation to be published in a book.
void SetID(String id)
Set ID.
int GetPubMed() const
Get the PubMed accession number.
void SetBookPublisherCity(String publisher_city)
Set the publisher city for a book.
void SetPublishedIn(String title)
Set a book title or journal name.
String GetPageFirst() const
Get the start page of a publication.
void SetYear(int year)
Set the year of a publication.
const std::vector< String > & GetAuthorList() const
Get the list of authors.
void SetVolume(String volume)
Set a journal volume.
String GetBookPublisherCity() const
Get the publisher city of a book.
String GetBookPublisher() const
Get the publisher of a book.
void SetPageFirst(String first)
Set the start page for a publication.
String GetID() const
Get ID.
String GetVolume() const
Get a journal volume.
container class for additional information from MMCif files
std::vector< String > GetEntityIds() const
void SetEMResolution(Real res)
Set EM resolution.
void SetMethod(String method)
Set an experimental method.
MMCifInfo()
Create an info object.
const MMCifInfoStructRefs & GetStructRefs() const
const std::vector< MMCifInfoTransOpPtr > & GetOperations() const
Get the list of operations stored in an info object.
MMCifInfoRevisions GetRevisions() const
Get history.
void AddMMCifPDBChainTr(String cif, String pdb, bool fault_tolerant=false)
Add a new mmCIF/ PDB chain name tuple.
void AddMMCifEntityIdTr(String cif, String ent_id, bool fault_tolerant=false)
Add a new mmCIF chain name / entity ID tuple.
MMCifInfoObsolete GetObsoleteInfo() const
Get information on an obsolete entries.
String GetPDBMMCifChainTr(String pdb) const
Get a CIF chain name for a PDB chain name.
void SetDataBlockName(const String &name)
Real GetEMResolution() const
Get EM resolution.
void AddPDBMMCifChainTr(String pdb, String cif, bool fault_tolerant=false)
Add a new PDB/ mmCIF chain name tuple.
void AddEntityBranchLink(String chain_name, int rnum1, int rnum2, const String &aname1, const String &aname2, unsigned char bond_order)
Add bond information for a branched entity.
const MMCifEntityDesc & GetEntityDesc(const String &entity_id) const
const MMCifInfoStructDetails GetStructDetails() const
Get the list of details about structures.
Real GetRWork() const
Get R-work value.
void SetResolution(Real res)
Set resolution.
Real GetRFree() const
Get R-free value.
std::vector< String > GetEntityIdsOfType(const String &type) const
const std::vector< String > GetEntityBranchChainNames() const
Get the names of all chains of branched entities.
void AddRevision(int num, String date, String status, int major=-1, int minor=-1)
Add a revision to history.
void AddBioUnit(MMCifInfoBioUnit bu)
Add a biounit.
void SetStructRefs(const MMCifInfoStructRefs &sr)
void AddOperation(MMCifInfoTransOpPtr op)
Add a operation.
const StringRef GetMethod() const
Get an experimental method.
void SetEntityDesc(const String &entity_id, const MMCifEntityDesc &entity_desc)
void AddAuthorsToCitation(StringRef id, std::vector< String > list, bool fault_tolerant=false)
Add a list of authors to a specific citation.
Real GetResolution() const
Get resolution.
const std::vector< MMCifInfoCitation > & GetCitations() const
Get the list of citations stored in an info object.
void SetStructDetails(MMCifInfoStructDetails details)
Add a set of structure details.
void SetObsoleteInfo(MMCifInfoObsolete obsolete)
Add a block of information on obsolete entries.
String GetMMCifEntityIdTr(String cif) const
Get the entity ID for a CIF chain name.
void SetRWork(Real r_work)
Set R-work value.
const std::vector< MMCifInfoEntityBranchLink > GetEntityBranchByChain(const String &chain_name) const
Check if a chain is a branched entity and return it.
void AddCitation(MMCifInfoCitation citation)
Add an item to the list of citations.
String GetMMCifPDBChainTr(String cif) const
Get a PDB chain name for a CIF chain name.
void SetRevisionsDateOriginal(String date)
Set date_original of revisions.
void SetRFree(Real r_free)
Set R-free value.
String GetDataBlockName() const
const std::vector< MMCifInfoBioUnit > & GetBioUnits() const
Get the list of biounits stored in an info object.
container class for information on obsolete entries
String GetID()
Get type of entry.
String GetPDBID()
Get id of replacement.
String GetDate()
Get the date string.
void SetReplacedPDBID(String id)
Set id of replaced entry.
MMCifInfoObsolete()
Create an object of information about an obsolete entry.
void SetPDBID(String id)
Set id of replacement.
void SetDate(String date)
Set date of replacement.
void SetID(StringRef type)
Set type of entry.
String GetReplacedPDBID()
Get id of replaced entry.
Container class for information on file revisions See Python doc.
MMCifInfoRevisions()
Start recording a revision process.
size_t GetFirstRelease() const
int GetNum(size_t i) const
int GetMinor(size_t i) const
void AddRevision(int num, String date, String status, int major=-1, int minor=-1)
String GetStatus(size_t i) const
String GetDateOriginal() const
void SetDateOriginal(String date)
String GetDate(size_t i) const
int GetMajor(size_t i) const
void SetTitle(String title)
Set a title for the data block.
char GetCASPFlag() const
Get CASP flag.
Definition mmcif_info.hh:57
String GetTitle() const
Get the title of the structure model.
void SetEntryID(String id)
Set id.
Definition mmcif_info.hh:44
String GetMassMethod() const
Get the method how the molecular weight was determined.
Definition mmcif_info.hh:84
void SetMassMethod(String method)
Set the method how the molecular weight was detected.
Definition mmcif_info.hh:80
MMCifInfoStructDetails()
Create a details object.
Definition mmcif_info.hh:37
String GetModelTypeDetails() const
Get the description for the type of the structure model.
void SetCASPFlag(char flag)
Set CASP flag.
Definition mmcif_info.hh:53
Real GetMass() const
Get molecular weight.
Definition mmcif_info.hh:75
void SetModelDetails(String desc)
Set the description about the production of this structure.
Definition mmcif_info.hh:89
String GetModelDetails() const
Get the details how the structure was determined.
Definition mmcif_info.hh:93
void SetDescriptor(String desc)
Set descriptor.
Definition mmcif_info.hh:62
String GetDescriptor() const
Get CASP flag.
Definition mmcif_info.hh:66
void SetModelTypeDetails(String desc)
Set a description for the type of the structure model.
Definition mmcif_info.hh:98
String GetEntryID() const
Get id.
Definition mmcif_info.hh:48
bool operator==(const MMCifInfoStructDetails &sd) const
void SetMass(Real mass)
Set mass.
Definition mmcif_info.hh:71
bool operator!=(const MMCifInfoStructDetails &sd) const
const String & GetDBID() const
const String & GetDBAccess() const
MMCifInfoStructRef(const String &id, const String &ent_id, const String &db_name, const String &db_ident, const String &db_access)
const String & GetEntityID() const
MMCifInfoStructRefSeqs GetAlignedSeqs() const
const String & GetID() const
MMCifInfoStructRefSeqPtr AddAlignedSeq(const String &align_id, const String &chain_name, int seq_begin, int seq_end, int db_begin, int db_end, bool fault_tolerant)
MMCifInfoStructRefSeqPtr GetAlignedSeq(const String &align_id) const
const String & GetDBName() const
const String & GetDBRNum() const
const String & GetDetails() const
MMCifInfoStructRefSeqDif(int seq_rnum, const String &db_rnum, const String &details)
const String & GetChainName() const
const String & GetID() const
const std::vector< MMCifInfoStructRefSeqDifPtr > & GetDifs() const
MMCifInfoStructRefSeq(const String &align_id, const String &chain_name, int seq_begin, int seq_end, int db_begin, int db_end)
MMCifInfoStructRefSeqDifPtr AddDif(int seq_num, const String &db_rnum, const String &details)
bool operator!=(const MMCifInfoTransOp &op) const
bool operator==(const MMCifInfoTransOp &op) const
void SetMatrix(Real i00, Real i01, Real i02, Real i10, Real i11, Real i12, Real i20, Real i21, Real i22)
Set the rotational matrix.
String GetType() const
Get type.
void SetVector(Real x, Real y, Real z)
Set the translational vector.
void SetType(String type)
Set type.
void SetID(String id)
Set id.
geom::Mat3 GetMatrix() const
Get the rotational matrix.
geom::Vec3 GetVector() const
Get the translational vector.
MMCifInfoTransOp()
Create an operation.
String GetID() const
Get id.
#define DLLEXPORT_OST_IO
float Real
Definition base.hh:44
std::string String
Definition base.hh:54
boost::shared_ptr< MMCifInfoTransOp > MMCifInfoTransOpPtr
boost::shared_ptr< MMCifInfoStructRefSeqDif > MMCifInfoStructRefSeqDifPtr
std::map< String, std::vector< MMCifInfoEntityBranchLink > > MMCifInfoEntityBranchLinkMap
std::vector< MMCifInfoStructRefSeqPtr > MMCifInfoStructRefSeqs
std::vector< MMCifInfoStructRefSeqDifPtr > MMCifInfoStructRefSeqDifs
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
boost::shared_ptr< MMCifInfoStructRefSeq > MMCifInfoStructRefSeqPtr
std::map< String, MMCifEntityDesc > MMCifEntityDescMap
boost::shared_ptr< MMCifInfoStructRef > MMCifInfoStructRefPtr
std::ostream & operator<<(std::ostream &stream, const FormattedLine &line)
Definition base.dox:1
String details
description of this entity
String seqres_pdbx
_entity_poly.pdbx_seq_one_letter_code
String branched_type
value of _pdbx_entity_branch.type
std::vector< String > hetero_ids
names of heterogeneous compounds
std::vector< int > hetero_num
res num of heterogeneous compounds
String seqres_canonical
_entity_poly.pdbx_seq_one_letter_code_can
String entity_poly_type
value of _entity_poly.type
mol::ChainType type
characterise entity
std::vector< String > mon_ids
list of monomer names from _entity_poly_seq
String entity_type
value of _entity.type