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_;
188 translation_.SetX(x);
189 translation_.SetY(y);
190 translation_.SetZ(z);
212 rotation_ =
geom::Mat3(i00,i01,i02, i10,i11,i12, i20,i21,i22);
220 if (this->id_ != op.id_) {
223 if (this->type_ != op.type_) {
226 if (this->translation_ != op.translation_) {
229 if (this->rotation_ != op.rotation_) {
281 method_details_ = method_details;
291 void AddChain(
String chain);
296 void SetChainList(std::vector<String> chains);
314 void AddOperations(std::vector<MMCifInfoTransOpPtr> operations);
321 return tr_operations_;
333 if (this->id_ != bu.id_) {
336 if (this->details_ != bu.details_) {
339 if (this->chains_ != bu.chains_) {
342 if (this->tr_chains_ != bu.tr_chains_) {
345 if (this->tr_operations_ != bu.tr_operations_) {
348 if (this->operations_.size() == bu.operations_.size()) {
349 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator th_ops_it;
350 std::vector<std::vector<MMCifInfoTransOpPtr> >::const_iterator bu_ops_it;
351 std::vector<MMCifInfoTransOpPtr>::const_iterator th_op_it;
352 std::vector<MMCifInfoTransOpPtr>::const_iterator bu_op_it;
354 for (th_ops_it = this->operations_.begin(),
355 bu_ops_it = bu.operations_.begin();
356 th_ops_it != this->operations_.end();
357 ++th_ops_it, ++bu_ops_it) {
358 if (th_ops_it->size() == bu_ops_it->size()) {
359 for (th_op_it = th_ops_it->begin(), bu_op_it = bu_ops_it->begin();
360 th_op_it != th_ops_it->end();
361 ++th_op_it, ++bu_op_it) {
362 if (*th_op_it != *bu_op_it) {
385 std::vector<String> chains_;
386 std::vector<std::pair<int, int> > tr_chains_;
387 std::vector<std::vector<MMCifInfoTransOpPtr> > operations_;
388 std::vector<std::pair<int, int> > tr_operations_;
402 volume_(
""), page_first_(
""), page_last_(
""), doi_(
""), pubmed_(0),
403 year_(0), title_(
""), book_publisher_(
""), book_publisher_city_(
"") {};
486 book_publisher_city_ = publisher_city;
542 where_ = publication_type;
597 if (this->year_ != cit.year_) {
600 if (this->pubmed_ != cit.pubmed_) {
603 if (this->where_ != cit.where_) {
606 if (
StringRef(this->id_.c_str(), this->id_.length()) !=
607 StringRef(cit.id_.c_str(), cit.id_.length())) {
610 if (
StringRef(this->cas_.c_str(), this->cas_.length()) !=
611 StringRef(cit.cas_.c_str(), cit.cas_.length())) {
614 if (
StringRef(this->isbn_.c_str(), this->isbn_.length()) !=
615 StringRef(cit.isbn_.c_str(), cit.isbn_.length())) {
618 if (
StringRef(this->published_in_.c_str(), this->published_in_.length()) !=
619 StringRef(cit.published_in_.c_str(), cit.published_in_.length())) {
622 if (
StringRef(this->volume_.c_str(), this->volume_.length()) !=
623 StringRef(cit.volume_.c_str(), cit.volume_.length())) {
626 if (
StringRef(this->page_first_.c_str(), this->page_first_.length()) !=
627 StringRef(cit.page_first_.c_str(), cit.page_first_.length())) {
630 if (
StringRef(this->page_last_.c_str(), this->page_last_.length()) !=
631 StringRef(cit.page_last_.c_str(), cit.page_last_.length())) {
634 if (
StringRef(this->doi_.c_str(), this->doi_.length()) !=
635 StringRef(cit.doi_.c_str(), cit.doi_.length())) {
638 if (
StringRef(this->title_.c_str(), this->title_.length()) !=
639 StringRef(cit.title_.c_str(), cit.title_.length())) {
642 if (
StringRef(this->book_publisher_.c_str(),
643 this->book_publisher_.length()) !=
645 cit.book_publisher_.length())) {
648 if (
StringRef(this->book_publisher_city_.c_str(),
649 this->book_publisher_city_.length()) !=
650 StringRef(cit.book_publisher_city_.c_str(),
651 cit.book_publisher_city_.length())) {
654 if (this->authors_ != cit.authors_) {
667 MMCifInfoCType where_;
679 String book_publisher_city_;
680 std::vector<String> authors_;
689 replaced_pdb_id_(
"") {};
709 else if (type ==
StringRef(
"SPRSDE", 6)) {
757 MMCifObsoleteType id_;
777 if (num_.size() && (num_.back() >= num)) {
778 std::stringstream ss;
779 ss <<
"Unique ID of revision has to increase with every revision, "
780 <<
"last was " << num_.back() <<
", trying to add " << num;
784 date_.push_back(date);
785 status_.push_back(status);
786 major_.push_back(major);
787 minor_.push_back(minor);
789 if (first_release_ == 0) {
790 if (status ==
"full release" || status ==
"Initial release") {
791 first_release_ = status_.size();
797 size_t GetSize()
const {
return num_.size(); }
799 int GetNum(
size_t i)
const {
return num_.at(i); }
801 int GetMajor(
size_t i)
const {
return major_.at(i); }
802 int GetMinor(
size_t i)
const {
return minor_.at(i); }
806 if (date_.empty())
return "?";
807 else return date_.back();
810 if (major_.empty())
return -1;
811 else return major_.back();
814 if (minor_.empty())
return -1;
815 else return minor_.back();
818 return first_release_;
823 size_t first_release_;
824 std::vector<int> num_;
825 std::vector<String> date_;
826 std::vector<String> status_;
827 std::vector<int> major_;
828 std::vector<int> minor_;
832 class MMCifInfoStructRef;
833 class MMCifInfoStructRefSeq;
834 class MMCifInfoStructRefSeqDif;
849 id_(id), ent_id_(ent_id), db_name_(db_name), db_ident_(db_ident),
850 db_access_(db_access)
858 const String& chain_name,
int seq_begin,
859 int seq_end,
int db_begin,
int db_end);
864 seqs.reserve(seqs_.size());
865 for (std::map<String, MMCifInfoStructRefSeqPtr>::const_iterator
866 i=seqs_.begin(), e=seqs_.end(); i!=e; ++i) {
867 seqs.push_back(i->second);
877 std::map<String, MMCifInfoStructRefSeqPtr> seqs_;
883 int seq_begin,
int seq_end,
884 int db_begin,
int db_end):
885 id_(align_id), chain_name_(chain_name),
886 seq_begin_(seq_begin), seq_end_(seq_end), db_begin_(db_begin), db_end_(db_end)
897 const std::vector<MMCifInfoStructRefSeqDifPtr>&
GetDifs()
const {
return difs_; }
905 std::vector<MMCifInfoStructRefSeqDifPtr> difs_;
911 seq_rnum_(seq_rnum), db_rnum_(db_rnum), details_(details) {}
937 MMCifInfo(): exptl_method_(
""), resolution_(0), r_free_(0), r_work_(0) { }
944 citations_.push_back(citation);
951 void AddAuthorsToCitation(
StringRef id, std::vector<String> list);
971 return StringRef(exptl_method_.c_str(), exptl_method_.length());
1058 transops_.push_back(op);
1074 struct_details_ = details;
1082 return struct_details_;
1090 obsolete_ = obsolete;
1109 if (revisions_.GetDateOriginal() ==
"?") {
1110 revisions_.SetDateOriginal(date);
1119 revisions_.AddRevision(num, date, status, major, minor);
1140 std::vector<MMCifInfoCitation> citations_;
1141 std::vector<MMCifInfoBioUnit> biounits_;
1142 std::vector<MMCifInfoTransOpPtr> transops_;
1144 std::map<String, String> cif_2_pdb_chain_id_;
1145 std::map<String, String> pdb_2_cif_chain_id_;
1146 std::map<String, String> cif_2_entity_id_;
void SetID(String id)
Set ID.
const std::vector< MMCifInfoCitation > & GetCitations() const
Get the list of citations stored in an info object.
void SetCitationTypeUnknown()
Set the type of a publication to unknown.
container class for information on obsolete entries
String GetID()
Get type of entry.
MMCifInfoObsolete GetObsoleteInfo() const
Get information on an obsolete entries.
const StringRef GetMethod() const
Get an experimental method.
bool operator!=(const MMCifInfoStructDetails &sd) const
void AddRevision(int num, String date, String status, int major=-1, int minor=-1)
Add a revision to history.
convenient datatype for referencing character data
void SetTitle(String title)
Set the title of a publication.
String GetBookPublisher() const
Get the publisher of a book.
void SetPubMed(int no)
Set the PubMed accession number.
void SetAuthorList(std::vector< String > list)
Set the list of authors.
void SetObsoleteInfo(MMCifInfoObsolete obsolete)
Add a block of information on obsolete entries.
boost::shared_ptr< MMCifInfoStructRefSeqDif > MMCifInfoStructRefSeqDifPtr
const String & GetDBAccess() const
String GetISBN() const
Get an ISBN code.
std::vector< MMCifInfoStructRefSeqDifPtr > MMCifInfoStructRefSeqDifs
const MMCifInfoStructRefs & GetStructRefs() const
MMCifInfo()
Create an info object.
String GetDetails() const
Get details.
std::vector< MMCifInfoStructRefSeqPtr > MMCifInfoStructRefSeqs
const MMCifInfoStructDetails GetStructDetails() const
Get the list of details about structures.
int GetMajor(size_t i) const
void SetType(String type)
Set type.
MMCifInfoStructDetails()
Create a details object.
void SetModelTypeDetails(String desc)
Set a description for the type of the structure model.
void SetMethod(String method)
Set an experimental method.
bool IsCitationTypeUnknown() const
Check if the citation type is unknow.
void SetCitationTypeBook()
Set the type of a publication to book.
void SetPublishedIn(String title)
Set a book title or journal name.
char GetCASPFlag() const
Get CASP flag.
void SetMethodDetails(String method_details)
Set method details.
MMCifInfoStructRef(const String &id, const String &ent_id, const String &db_name, const String &db_ident, const String &db_access)
void SetCitationType(MMCifInfoCType publication_type)
Set the type of a publication.
void SetDetails(String details)
Set details.
void SetID(String id)
Set id.
Real GetResolution() const
Get resolution.
const std::vector< std::pair< int, int > > & GetOperationsIntervalList()
Get the list of intervals of operations.
MMCifInfoCType GetCitationType() const
Get the type of a publication.
void AddCitation(MMCifInfoCitation citation)
Add an item to the list of citations.
bool operator!=(const MMCifInfoBioUnit &bu) const
boost::shared_ptr< MMCifInfoStructRef > MMCifInfoStructRefPtr
const String & GetDBName() const
int GetMinor(size_t i) const
String GetBookPublisherCity() const
Get the publisher city of a book.
const String & GetDetails() const
String GetVolume() const
Get a journal volume.
bool DLLEXPORT_OST_GEOM operator==(const Line2 &l1, const Line2 &l2)
String GetID() const
Get ID.
const std::vector< MMCifInfoStructRefSeqDifPtr > & GetDifs() const
boost::shared_ptr< MMCifInfoTransOp > MMCifInfoTransOpPtr
Container class for information on file revisions See Python doc.
void SetRWork(Real r_work)
Set R-work value.
String GetTitle() const
Get the title of a publication.
String GetLastDate() const
const String & GetDBID() const
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
void SetTitle(String title)
Set a title for the data block.
void SetRevisionsDateOriginal(String date)
Set date_original of revisions.
Real GetMass() const
Get molecular weight.
MMCifInfoBioUnit()
Create a biounit.
String GetDate()
Get the date string.
void SetCAS(String id)
Set a CAS identifier.
const std::vector< String > & GetChainList() const
Get vector of chain names.
void SetResolution(Real res)
Set resolution.
void SetReplacedPDBID(String id)
Set id of replaced entry.
const String & GetID() const
String GetCAS() const
Get a CAS identifier.
void AddOperation(MMCifInfoTransOpPtr op)
Add a operation.
geom::Vec3 GetVector() const
Get the translational vector.
const std::vector< String > & GetAuthorList() const
Get the list of authors.
int GetPubMed() const
Get the PubMed accession number.
bool operator!=(const MMCifInfoCitation &cit) const
const String & GetDBRNum() const
const std::vector< MMCifInfoTransOpPtr > & GetOperations() const
Get the list of operations stored in an info object.
String GetID() const
Get id.
void SetEntryID(String id)
Set id.
size_t GetFirstRelease() const
bool operator==(const MMCifInfoCitation &cit) const
void SetDateOriginal(String date)
void SetCASPFlag(char flag)
Set CASP flag.
void SetDate(String date)
Set date of replacement.
MMCifInfoTransOp()
Create an operation.
Real GetRWork() const
Get R-work value.
String GetPublishedIn() const
Get a book title or journal name.
MMCifInfoStructRefSeqDif(int seq_rnum, const String &db_rnum, const String &details)
bool operator==(const MMCifInfoStructDetails &sd) const
Three dimensional vector class, using Real precision.
const std::vector< std::vector< MMCifInfoTransOpPtr > > & GetOperations()
Get the list of operations.
void SetStructDetails(MMCifInfoStructDetails details)
Add a set of structure details.
void AddRevision(int num, String date, String status, int major=-1, int minor=-1)
void SetID(String id)
Set id.
String GetDate(size_t i) const
void SetMassMethod(String method)
Set the method how the molecular weight was detected.
bool IsCitationTypeBook() const
Check a citation to be published in a book.
String GetType() const
Get type.
void SetStructRefs(const MMCifInfoStructRefs &sr)
String GetModelDetails() const
Get the details how the structure was determined.
void SetMatrix(Real i00, Real i01, Real i02, Real i10, Real i11, Real i12, Real i20, Real i21, Real i22)
Set the rotational matrix.
void SetRFree(Real r_free)
Set R-free value.
boost::shared_ptr< MMCifInfoStructRefSeq > MMCifInfoStructRefSeqPtr
void SetBookPublisherCity(String publisher_city)
Set the publisher city for a book.
bool operator==(const MMCifInfoBioUnit &bu) const
bool IsCitationTypeJournal() const
Check a citation to be published in a journal.
void SetPageFirst(String first)
Set the start page for a publication.
void SetMass(Real mass)
Set mass.
String GetPageFirst() const
Get the start page of a publication.
void SetID(StringRef type)
Set type of entry.
void SetBookPublisher(String publisher)
Set the publisher for a book.
const String & GetEntityID() const
String GetID() const
Get id.
String GetMassMethod() const
Get the method how the molecular weight was determined.
int GetYear() const
Get the year of a publication.
String GetEntryID() const
Get id.
const std::vector< std::pair< int, int > > & GetChainIntervalList()
Get the list of intervals of chains.
const String & GetID() const
const String & GetChainName() const
void SetModelDetails(String desc)
Set the description about the production of this structure.
MMCifInfoStructRefSeq(const String &align_id, const String &chain_name, int seq_begin, int seq_end, int db_begin, int db_end)
MMCifInfoObsolete()
Create an object of information about an obsolete entry.
void SetPageLast(String last)
Set the end page for a publication.
void SetCitationTypeJournal()
Set the type of a publication to journal.
String GetMethodDetails() const
Get method details.
String GetDateOriginal() const
bool operator==(const MMCifInfoTransOp &op) const
String GetDOI() const
Get the DOI of a document.
String GetPageLast() const
Get the last page of a publication.
MMCifInfoRevisions()
Start recording a revision process.
void SetISBN(String code)
Set an ISBN code.
Real GetRFree() const
Get R-free value.
String GetStatus(size_t i) const
void SetDescriptor(String desc)
Set descriptor.
bool operator!=(const MMCifInfoTransOp &op) const
MMCifInfoStructRefSeqs GetAlignedSeqs() const
const std::vector< MMCifInfoBioUnit > & GetBioUnits() const
Get the list of biounits stored in an info object.
String GetDescriptor() const
Get CASP flag.
int GetNum(size_t i) const
MMCifInfoRevisions GetRevisions() const
Get history.
String GetModelTypeDetails() const
Get the description for the type of the structure model.
String GetPDBID()
Get id of replacement.
geom::Mat3 GetMatrix() const
Get the rotational matrix.
void SetVector(Real x, Real y, Real z)
Set the translational vector.
MMCifInfoCitation()
Create a citation.
String GetTitle() const
Get the title of the structure model.
void SetYear(int year)
Set the year of a publication.
void SetPDBID(String id)
Set id of replacement.
void SetVolume(String volume)
Set a journal volume.
void SetDOI(String doi)
Set the DOI of a document.
String GetReplacedPDBID()
Get id of replaced entry.