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_;
395 volume_(
""), page_first_(
""), page_last_(
""), doi_(
""), pubmed_(0),
396 year_(0), title_(
"") {};
520 if (this->year_ != cit.year_) {
523 if (this->pubmed_ != cit.pubmed_) {
526 if (this->where_ != cit.where_) {
529 if (
StringRef(this->id_.c_str(), this->id_.length()) !=
530 StringRef(cit.id_.c_str(), cit.id_.length())) {
533 if (
StringRef(this->cas_.c_str(), this->cas_.length()) !=
534 StringRef(cit.cas_.c_str(), cit.cas_.length())) {
537 if (
StringRef(this->isbn_.c_str(), this->isbn_.length()) !=
538 StringRef(cit.isbn_.c_str(), cit.isbn_.length())) {
541 if (
StringRef(this->published_in_.c_str(), this->published_in_.length()) !=
542 StringRef(cit.published_in_.c_str(), cit.published_in_.length())) {
545 if (
StringRef(this->volume_.c_str(), this->volume_.length()) !=
546 StringRef(cit.volume_.c_str(), cit.volume_.length())) {
549 if (
StringRef(this->page_first_.c_str(), this->page_first_.length()) !=
550 StringRef(cit.page_first_.c_str(), cit.page_first_.length())) {
553 if (
StringRef(this->page_last_.c_str(), this->page_last_.length()) !=
554 StringRef(cit.page_last_.c_str(), cit.page_last_.length())) {
557 if (
StringRef(this->doi_.c_str(), this->doi_.length()) !=
558 StringRef(cit.doi_.c_str(), cit.doi_.length())) {
561 if (
StringRef(this->title_.c_str(), this->title_.length()) !=
562 StringRef(cit.title_.c_str(), cit.title_.length())) {
565 if (this->authors_ != cit.authors_) {
585 MMCifInfoCType where_;
596 std::vector<String> authors_;
605 replaced_pdb_id_(
"") {};
625 else if (type ==
StringRef(
"SPRSDE", 6)) {
673 MMCifObsoleteType id_;
702 if (num_.size() && (num_.back() >= num)) {
703 std::stringstream ss;
704 ss <<
"Unique ID of revision has to increase with every revision, "
705 <<
"last was " << num_.back() <<
", trying to add " << num;
709 date_.push_back(date);
710 status_.push_back(status);
712 if (first_release_ == 0) {
713 if (status ==
"full release" || status ==
"Initial release") {
714 first_release_ = status_.size();
722 size_t GetSize()
const {
return num_.size(); }
734 int GetNum(
size_t i)
const {
return num_.at(i); }
746 if (date_.empty())
return "?";
747 else return date_.back();
755 return first_release_;
760 size_t first_release_;
761 std::vector<int> num_;
762 std::vector<String> date_;
763 std::vector<String> status_;
767 class MMCifInfoStructRef;
768 class MMCifInfoStructRefSeq;
769 class MMCifInfoStructRefSeqDif;
784 id_(id), ent_id_(ent_id), db_name_(db_name), db_ident_(db_ident),
785 db_access_(db_access)
793 const String& chain_name,
int seq_begin,
794 int seq_end,
int db_begin,
int db_end);
799 seqs.reserve(seqs_.size());
800 for (std::map<String, MMCifInfoStructRefSeqPtr>::const_iterator
801 i=seqs_.begin(), e=seqs_.end(); i!=e; ++i) {
802 seqs.push_back(i->second);
812 std::map<String, MMCifInfoStructRefSeqPtr> seqs_;
818 int seq_begin,
int seq_end,
819 int db_begin,
int db_end):
820 id_(align_id), chain_name_(chain_name),
821 seq_begin_(seq_begin), seq_end_(seq_end), db_begin_(db_begin), db_end_(db_end)
832 const std::vector<MMCifInfoStructRefSeqDifPtr>&
GetDifs()
const {
return difs_; }
840 std::vector<MMCifInfoStructRefSeqDifPtr> difs_;
846 seq_rnum_(seq_rnum), db_rnum_(db_rnum), details_(details) {}
872 MMCifInfo(): exptl_method_(
""), resolution_(0), r_free_(0), r_work_(0) { }
879 citations_.push_back(citation);
886 void AddAuthorsToCitation(
StringRef id, std::vector<String> list);
906 return StringRef(exptl_method_.c_str(), exptl_method_.length());
993 transops_.push_back(op);
1009 struct_details_ = details;
1017 return struct_details_;
1025 obsolete_ = obsolete;
1044 if (revisions_.GetDateOriginal() ==
"?") {
1045 revisions_.SetDateOriginal(date);
1056 revisions_.AddRevision(num, date, status);
1077 std::vector<MMCifInfoCitation> citations_;
1078 std::vector<MMCifInfoBioUnit> biounits_;
1079 std::vector<MMCifInfoTransOpPtr> transops_;
1081 std::map<String, String> cif_2_pdb_chain_id_;
1082 std::map<String, String> pdb_2_cif_chain_id_;
1083 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.
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.
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.
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 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.
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
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.
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
bool operator==(const MMCifInfoBioUnit &bu) const
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.
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.
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.