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;
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) {}
930 unsigned char bond_order): rnum1(rnum1), rnum2(rnum2),
931 aname1(aname1), aname2(aname2),
932 bond_order(bond_order) { }
935 return rnum1 == rhs.
rnum1 && rnum2 == rhs.
rnum2 &&
941 return !((*this) == rhs);
985 MMCifInfo(): exptl_method_(
""), resolution_(0), em_resolution_(0), r_free_(0),
993 citations_.push_back(citation);
1001 bool fault_tolerant=
false);
1021 return StringRef(exptl_method_.c_str(), exptl_method_.length());
1069 bool fault_tolerant=
false);
1082 bool fault_tolerant=
false);
1095 bool fault_tolerant=
false);
1121 transops_.push_back(op);
1137 struct_details_ = details;
1145 return struct_details_;
1153 obsolete_ = obsolete;
1172 if (revisions_.GetDateOriginal() ==
"?") {
1173 revisions_.SetDateOriginal(date);
1182 revisions_.AddRevision(num, date, status, major, minor);
1199 int rnum1,
int rnum2,
1202 unsigned char bond_order);
1208 const String& chain_name)
const;
1229 Real em_resolution_;
1235 std::vector<MMCifInfoCitation> citations_;
1236 std::vector<MMCifInfoBioUnit> biounits_;
1237 std::vector<MMCifInfoTransOpPtr> transops_;
1240 std::map<String, String> cif_2_pdb_chain_id_;
1241 std::map<String, String> pdb_2_cif_chain_id_;
1242 std::map<String, String> cif_2_entity_id_;
1243 std::map<String, std::vector<MMCifInfoEntityBranchLink> > entity_branches_;
1250 const std::vector<MMCifInfoEntityBranchLink>& eb_list);
Three dimensional vector class, using Real precision.
convenient datatype for referencing character data
void AddOperations(std::vector< MMCifInfoTransOpPtr > operations)
Add a set of operations.
void AddChain(String chain)
Add a chain name.
void Merge(MMCifInfoBioUnit &from)
Merge chains & operations, set intervals.
const std::vector< std::vector< MMCifInfoTransOpPtr > > & GetOperations() const
Get the list of operations.
const std::vector< std::pair< int, int > > & GetOperationsIntervalList() const
Get the list of intervals of operations.
bool operator!=(const MMCifInfoBioUnit &bu) const
void SetMethodDetails(String method_details)
Set method details.
const std::vector< std::pair< int, int > > & GetChainIntervalList() const
Get the list of intervals of chains.
void SetChainList(std::vector< String > chains)
Set a vector of chain names.
void SetID(String id)
Set id.
const std::vector< String > & GetChainList() const
Get vector of chain names.
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.
const std::vector< String > & GetAuthorList() const
Get the list of authors.
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.
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
const std::vector< MMCifInfoBioUnit > & GetBioUnits() const
Get the list of biounits stored in an info object.
std::vector< String > GetEntityIds() const
const std::vector< MMCifInfoEntityBranchLink > GetEntityBranchByChain(const String &chain_name) const
Check if a chain is a branched entity and return it.
void SetEMResolution(Real res)
Set EM resolution.
void SetMethod(String method)
Set an experimental method.
MMCifInfo()
Create 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.
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 std::vector< String > GetEntityBranchChainNames() const
Get the names of all chains of branched entities.
const MMCifInfoStructDetails GetStructDetails() const
Get the list of details about structures.
Real GetRWork() const
Get R-work value.
void SetResolution(Real res)
Set resolution.
const MMCifEntityDesc & GetEntityDesc(const String &entity_id) const
Real GetRFree() const
Get R-free value.
const MMCifInfoStructRefs & GetStructRefs() const
const std::vector< MMCifInfoTransOpPtr > & GetOperations() const
Get the list of operations stored in an info object.
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.
std::vector< String > GetEntityIdsOfType(const String &type) const
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< MMCifInfoCitation > & GetCitations() const
Get the list of citations stored in an info object.
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.
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
String GetLastDate() const
void SetTitle(String title)
Set a title for the data block.
char GetCASPFlag() const
Get CASP flag.
String GetTitle() const
Get the title of the structure model.
void SetEntryID(String id)
Set id.
String GetMassMethod() const
Get the method how the molecular weight was determined.
void SetMassMethod(String method)
Set the method how the molecular weight was detected.
MMCifInfoStructDetails()
Create a details object.
String GetModelTypeDetails() const
Get the description for the type of the structure model.
void SetCASPFlag(char flag)
Set CASP flag.
Real GetMass() const
Get molecular weight.
void SetModelDetails(String desc)
Set the description about the production of this structure.
String GetModelDetails() const
Get the details how the structure was determined.
void SetDescriptor(String desc)
Set descriptor.
String GetDescriptor() const
Get CASP flag.
void SetModelTypeDetails(String desc)
Set a description for the type of the structure model.
String GetEntryID() const
Get id.
bool operator==(const MMCifInfoStructDetails &sd) const
void SetMass(Real mass)
Set mass.
bool operator!=(const MMCifInfoStructDetails &sd) const
const String & GetDBAccess() const
const String & GetDBName() const
MMCifInfoStructRef(const String &id, const String &ent_id, const String &db_name, const String &db_ident, const String &db_access)
MMCifInfoStructRefSeqPtr AddAlignedSeq(const String &align_id, const String &chain_name, int seq_begin, int seq_end, int db_begin, int db_end)
MMCifInfoStructRefSeqs GetAlignedSeqs() const
const String & GetDBID() const
const String & GetEntityID() const
const String & GetID() const
MMCifInfoStructRefSeqPtr GetAlignedSeq(const String &align_id) const
const String & GetDBRNum() const
const String & GetDetails() const
MMCifInfoStructRefSeqDif(int seq_rnum, const String &db_rnum, const String &details)
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)
const String & GetChainName() const
MMCifInfoStructRefSeqDifPtr AddDif(int seq_num, const String &db_rnum, const String &details)
const String & GetID() const
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.
bool DLLEXPORT_OST_GEOM operator==(const Line2 &l1, const Line2 &l2)
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
std::ostream & operator<<(std::ostream &stream, const FormattedLine &line)
boost::shared_ptr< MMCifInfoStructRef > MMCifInfoStructRefPtr
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
Store information on branched structures (oligosaccharides)
MMCifInfoEntityBranchLink(int rnum1, int rnum2, const String &aname1, const String &aname2, unsigned char bond_order)
bool operator==(const MMCifInfoEntityBranchLink &rhs) const
bool operator!=(const MMCifInfoEntityBranchLink &rhs) const