19 #ifndef OST_MMCIF_INFO_HH
20 #define OST_MMCIF_INFO_HH
24 #include <boost/shared_ptr.hpp>
32 namespace ost {
namespace io {
38 descriptor_(
""), mass_(0.0), mass_method_(
""), model_details_(
""),
39 model_type_details_(
"") {};
114 if (this->entry_id_ != sd.entry_id_) {
117 if (this->casp_flag_ != sd.casp_flag_) {
120 if (this->descriptor_ != sd.descriptor_) {
123 if (this->mass_ != sd.mass_) {
126 if (this->mass_method_ != sd.mass_method_) {
129 if (this->model_details_ != sd.model_details_) {
132 if (this->model_type_details_ != sd.model_type_details_) {
135 if (this->title_ != sd.title_) {
154 String model_type_details_;
190 translation_.SetX(x);
191 translation_.SetY(y);
192 translation_.SetZ(z);
214 rotation_ =
geom::Mat3(i00,i01,i02, i10,i11,i12, i20,i21,i22);
222 if (this->id_ != op.id_) {
225 if (this->type_ != op.type_) {
228 if (this->translation_ != op.translation_) {
231 if (this->rotation_ != op.rotation_) {
283 method_details_ = method_details;
293 void AddChain(
String chain);
298 void SetChainList(std::vector<String> chains);
316 void AddOperations(std::vector<MMCifInfoTransOpPtr> operations);
323 return tr_operations_;
335 if (this->id_ != bu.id_) {
338 if (this->details_ != bu.details_) {
341 if (this->chains_ != bu.chains_) {
344 if (this->tr_chains_ != bu.tr_chains_) {
347 if (this->tr_operations_ != bu.tr_operations_) {
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;
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) {
387 std::vector<String> chains_;
388 std::vector<std::pair<int, int> > tr_chains_;
389 std::vector<std::vector<MMCifInfoTransOpPtr> > operations_;
390 std::vector<std::pair<int, int> > tr_operations_;
404 volume_(
""), page_first_(
""), page_last_(
""), doi_(
""), pubmed_(0),
405 year_(0), title_(
""), book_publisher_(
""), book_publisher_city_(
"") {};
488 book_publisher_city_ = publisher_city;
544 where_ = publication_type;
599 if (this->year_ != cit.year_) {
602 if (this->pubmed_ != cit.pubmed_) {
605 if (this->where_ != cit.where_) {
608 if (
StringRef(this->id_.c_str(), this->id_.length()) !=
609 StringRef(cit.id_.c_str(), cit.id_.length())) {
612 if (
StringRef(this->cas_.c_str(), this->cas_.length()) !=
613 StringRef(cit.cas_.c_str(), cit.cas_.length())) {
616 if (
StringRef(this->isbn_.c_str(), this->isbn_.length()) !=
617 StringRef(cit.isbn_.c_str(), cit.isbn_.length())) {
620 if (
StringRef(this->published_in_.c_str(), this->published_in_.length()) !=
621 StringRef(cit.published_in_.c_str(), cit.published_in_.length())) {
624 if (
StringRef(this->volume_.c_str(), this->volume_.length()) !=
625 StringRef(cit.volume_.c_str(), cit.volume_.length())) {
628 if (
StringRef(this->page_first_.c_str(), this->page_first_.length()) !=
629 StringRef(cit.page_first_.c_str(), cit.page_first_.length())) {
632 if (
StringRef(this->page_last_.c_str(), this->page_last_.length()) !=
633 StringRef(cit.page_last_.c_str(), cit.page_last_.length())) {
636 if (
StringRef(this->doi_.c_str(), this->doi_.length()) !=
637 StringRef(cit.doi_.c_str(), cit.doi_.length())) {
640 if (
StringRef(this->title_.c_str(), this->title_.length()) !=
641 StringRef(cit.title_.c_str(), cit.title_.length())) {
644 if (
StringRef(this->book_publisher_.c_str(),
645 this->book_publisher_.length()) !=
647 cit.book_publisher_.length())) {
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())) {
656 if (this->authors_ != cit.authors_) {
669 MMCifInfoCType where_;
681 String book_publisher_city_;
682 std::vector<String> authors_;
691 replaced_pdb_id_(
"") {};
711 else if (type ==
StringRef(
"SPRSDE", 6)) {
759 MMCifObsoleteType id_;
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;
786 date_.push_back(date);
787 status_.push_back(status);
788 major_.push_back(major);
789 minor_.push_back(minor);
791 if (first_release_ == 0) {
792 if (status ==
"full release" || status ==
"Initial release") {
793 first_release_ = status_.size();
799 size_t GetSize()
const {
return num_.size(); }
801 int GetNum(
size_t i)
const {
return num_.at(i); }
803 int GetMajor(
size_t i)
const {
return major_.at(i); }
804 int GetMinor(
size_t i)
const {
return minor_.at(i); }
808 if (date_.empty())
return "?";
809 else return date_.back();
812 if (major_.empty())
return -1;
813 else return major_.back();
816 if (minor_.empty())
return -1;
817 else return minor_.back();
820 return first_release_;
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_;
834 class MMCifInfoStructRef;
835 class MMCifInfoStructRefSeq;
836 class MMCifInfoStructRefSeqDif;
851 id_(id), ent_id_(ent_id), db_name_(db_name), db_ident_(db_ident),
852 db_access_(db_access)
860 const String& chain_name,
int seq_begin,
861 int seq_end,
int db_begin,
int db_end);
866 seqs.reserve(seqs_.size());
867 for (std::map<String, MMCifInfoStructRefSeqPtr>::const_iterator
868 i=seqs_.begin(), e=seqs_.end(); i!=e; ++i) {
869 seqs.push_back(i->second);
879 std::map<String, MMCifInfoStructRefSeqPtr> seqs_;
885 int seq_begin,
int seq_end,
886 int db_begin,
int db_end):
887 id_(align_id), chain_name_(chain_name),
888 seq_begin_(seq_begin), seq_end_(seq_end), db_begin_(db_begin), db_end_(db_end)
899 const std::vector<MMCifInfoStructRefSeqDifPtr>&
GetDifs()
const {
return difs_; }
907 std::vector<MMCifInfoStructRefSeqDifPtr> difs_;
913 seq_rnum_(seq_rnum), db_rnum_(db_rnum), details_(details) {}
929 unsigned char bond_order):
930 atom1_(atom1), atom2_(atom2), bond_order_(bond_order) {}
936 void SetBondOrder(
unsigned char bond_order) { bond_order_ = bond_order; }
938 editor.
Connect(atom1_, atom2_, bond_order_);
942 if (this->atom1_ != eb.atom1_) {
945 if (this->atom2_ != eb.atom2_) {
958 unsigned char bond_order_;
971 std::vector<String> mon_ids;
972 std::vector<int> hetero_num;
973 std::vector<String> hetero_ids;
994 MMCifInfo(): exptl_method_(
""), resolution_(0), em_resolution_(0), r_free_(0),
1002 citations_.push_back(citation);
1009 void AddAuthorsToCitation(
StringRef id, std::vector<String> list,
1010 bool fault_tolerant=
false);
1030 return StringRef(exptl_method_.c_str(), exptl_method_.length());
1127 transops_.push_back(op);
1143 struct_details_ = details;
1151 return struct_details_;
1159 obsolete_ = obsolete;
1178 if (revisions_.GetDateOriginal() ==
"?") {
1179 revisions_.SetDateOriginal(date);
1188 revisions_.AddRevision(num, date, status, major, minor);
1204 void AddEntityBranchLink(
String chain_name,
1207 unsigned char bond_order);
1211 const std::vector<MMCifInfoEntityBranchLink> GetEntityBranchLinks()
const;
1216 const std::vector<MMCifInfoEntityBranchLink> GetEntityBranchByChain(
1217 const String& chain_name)
const;
1221 const std::vector<String> GetEntityBranchChainNames()
const;
1229 void ConnectBranchLinks();
1233 void SetEntityDesc(
const String& entity_id,
1236 std::vector<String> GetEntityIds()
const;
1238 std::vector<String> GetEntityIdsOfType(
const String& type)
const;
1246 Real em_resolution_;
1252 std::vector<MMCifInfoCitation> citations_;
1253 std::vector<MMCifInfoBioUnit> biounits_;
1254 std::vector<MMCifInfoTransOpPtr> transops_;
1257 std::map<String, String> cif_2_pdb_chain_id_;
1258 std::map<String, String> pdb_2_cif_chain_id_;
1259 std::map<String, String> cif_2_entity_id_;
1260 std::map<String, std::vector<MMCifInfoEntityBranchLink> > entity_branches_;
1264 const MMCifInfoEntityBranchLink& eb);
1267 const std::vector<MMCifInfoEntityBranchLink>& eb_list);
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.
const std::vector< std::vector< MMCifInfoTransOpPtr > > & GetOperations() const
Get the list of operations.
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.
Store information on branched structures (oligosaccharides)
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.
const std::vector< std::pair< int, int > > & GetOperationsIntervalList() const
Get the list of intervals of operations.
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.
std::map< String, MMCifEntityDesc > MMCifEntityDescMap
void SetDetails(String details)
Set details.
void SetID(String id)
Set id.
Real GetResolution() const
Get resolution.
mol::AtomHandle GetAtom2() const
mol::AtomHandle GetAtom1() const
void SetAtom2(mol::AtomHandle atom)
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.
void SetBondOrder(unsigned char bond_order)
std::map< String, std::vector< MMCifInfoEntityBranchLink > > MMCifInfoEntityBranchLinkMap
void ConnectBranchLink(mol::XCSEditor editor)
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
Real GetEMResolution() const
Get EM resolution.
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
unsigned char GetBondOrder() const
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.
bool operator==(const MMCifInfoEntityBranchLink &eb) const
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.
MMCifInfoEntityBranchLink(mol::AtomHandle atom1, mol::AtomHandle atom2, unsigned char bond_order)
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.
const std::vector< std::pair< int, int > > & GetChainIntervalList() const
Get the list of intervals of chains.
MMCifInfoStructRefSeqDif(int seq_rnum, const String &db_rnum, const String &details)
bool operator==(const MMCifInfoStructDetails &sd) const
Three dimensional vector class, using Real precision.
void SetStructDetails(MMCifInfoStructDetails details)
Add a set of structure details.
external coordinate system editor
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 String & GetID() const
const String & GetChainName() const
void SetModelDetails(String desc)
Set the description about the production of this structure.
void SetEMResolution(Real res)
Set EM resolution.
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.
bool operator!=(const MMCifInfoEntityBranchLink &eb) const
String GetDateOriginal() const
std::ostream & operator<<(std::ostream &stream, const FormattedLine &line)
BondHandle Connect(const AtomHandle &first, const AtomHandle &second)
connect two atoms with bond
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
void SetAtom1(mol::AtomHandle atom)
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.
std::vector< ChainHandle > ChainHandleList
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.