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_;
786 if (num_.size() && (num_.back() >= num)) {
787 std::stringstream ss;
788 ss <<
"Unique ID of revision has to increase with every revision, "
789 <<
"last was " << num_.back() <<
", trying to add " << num;
793 date_.push_back(date);
794 status_.push_back(status);
796 if (first_release_ == 0) {
797 if (status ==
"full release" || status ==
"Initial release") {
798 first_release_ = status_.size();
806 size_t GetSize()
const {
return num_.size(); }
818 int GetNum(
size_t i)
const {
return num_.at(i); }
830 if (date_.empty())
return "?";
831 else return date_.back();
839 return first_release_;
844 size_t first_release_;
845 std::vector<int> num_;
846 std::vector<String> date_;
847 std::vector<String> status_;
851 class MMCifInfoStructRef;
852 class MMCifInfoStructRefSeq;
853 class MMCifInfoStructRefSeqDif;
868 id_(id), ent_id_(ent_id), db_name_(db_name), db_ident_(db_ident),
869 db_access_(db_access)
877 const String& chain_name,
int seq_begin,
878 int seq_end,
int db_begin,
int db_end);
883 seqs.reserve(seqs_.size());
884 for (std::map<String, MMCifInfoStructRefSeqPtr>::const_iterator
885 i=seqs_.begin(), e=seqs_.end(); i!=e; ++i) {
886 seqs.push_back(i->second);
896 std::map<String, MMCifInfoStructRefSeqPtr> seqs_;
902 int seq_begin,
int seq_end,
903 int db_begin,
int db_end):
904 id_(align_id), chain_name_(chain_name),
905 seq_begin_(seq_begin), seq_end_(seq_end), db_begin_(db_begin), db_end_(db_end)
916 const std::vector<MMCifInfoStructRefSeqDifPtr>&
GetDifs()
const {
return difs_; }
924 std::vector<MMCifInfoStructRefSeqDifPtr> difs_;
930 seq_rnum_(seq_rnum), db_rnum_(db_rnum), details_(details) {}
956 MMCifInfo(): exptl_method_(
""), resolution_(0), r_free_(0), r_work_(0) { }
963 citations_.push_back(citation);
970 void AddAuthorsToCitation(
StringRef id, std::vector<String> list);
990 return StringRef(exptl_method_.c_str(), exptl_method_.length());
1077 transops_.push_back(op);
1093 struct_details_ = details;
1101 return struct_details_;
1109 obsolete_ = obsolete;
1128 if (revisions_.GetDateOriginal() ==
"?") {
1129 revisions_.SetDateOriginal(date);
1140 revisions_.AddRevision(num, date, status);
1161 std::vector<MMCifInfoCitation> citations_;
1162 std::vector<MMCifInfoBioUnit> biounits_;
1163 std::vector<MMCifInfoTransOpPtr> transops_;
1165 std::map<String, String> cif_2_pdb_chain_id_;
1166 std::map<String, String> pdb_2_cif_chain_id_;
1167 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
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.
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
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
size_t GetSize() const
Get number of revisions stored.
boost::shared_ptr< MMCifInfoTransOp > MMCifInfoTransOpPtr
Container class for information on file revisions.
void SetRWork(Real r_work)
Set R-work value.
String GetTitle() const
Get the title of a publication.
String GetLastDate() const
Get date of last revision.
const String & GetDBID() const
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
void SetTitle(String title)
Set a title for the data block.
void AddRevision(int num, String date, String status)
Add a revision to history.
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
Get the index of the full release revision.
bool operator==(const MMCifInfoCitation &cit) const
void SetDateOriginal(String date)
Set date the entry entered PDB.
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 SetID(String id)
Set id.
String GetDate(size_t i) const
Get revision date by index in list.
void AddRevision(int num, String date, String status)
Add a revision to history.
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
Get date the entry entered PDB.
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
Get revision status by index in list.
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
Get revision num by index in list.
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.