19 #ifndef OST_MMCIF_READER_HH
20 #define OST_MMCIF_READER_HH
34 namespace ost {
namespace io {
69 MMCifReader(std::istream& stream, mol::EntityHandle& ent_handle,
70 const IOProfile& profile);
77 MMCifReader(
const String& filename, mol::EntityHandle& ent_handle,
78 const IOProfile& profile);
90 void SetRestrictChains(
const String& restrict_chains);
104 return restrict_chains_;
122 virtual bool OnBeginData(
const StringRef& data_name);
136 const std::vector<StringRef>& columns);
139 virtual void OnEndData();
180 indices_[mapping] = header.
GetIndex(item);
182 if (indices_[mapping] == -1) {
188 this->GetCurrentLinenum()));
205 bool ParseAtomIdent(
const std::vector<StringRef>& columns,
217 void ParseAndAddAtom(
const std::vector<StringRef>& columns);
222 void ParseEntity(
const std::vector<StringRef>& columns);
227 void ParseEntityPoly(
const std::vector<StringRef>& columns);
232 void ParseCitation(
const std::vector<StringRef>& columns);
247 void ParseCitationAuthor(
const std::vector<StringRef>& columns);
250 void ParseStructRef(
const std::vector<StringRef>& columns);
253 void ParseStructRefSeq(
const std::vector<StringRef>& columns);
256 void ParseStructRefSeqDif(
const std::vector<StringRef>& columns);
260 void ParseExptl(
const std::vector<StringRef>& columns);
265 void ParseRefine(
const std::vector<StringRef>& columns);
270 void ParsePdbxStructAssembly(
const std::vector<StringRef>& columns);
275 void ParsePdbxStructAssemblyGen(
const std::vector<StringRef>& columns);
277 std::vector<std::vector<String> > UnPackOperExperession(
StringRef expression);
279 void StoreExpression(
const char* l,
const char* s,
280 bool& is_range,
int lborder,
281 std::vector<String>& single_block);
283 void StoreRange(
const char*& l,
const char* s,
bool& is_range,
int& lborder,
284 std::vector<String>& single_block);
289 void ParsePdbxStructOperList(
const std::vector<StringRef>& columns);
294 void ParseDatabasePDBRev(
const std::vector<StringRef>& columns);
299 void ParsePdbxAuditRevisionHistory(
const std::vector<StringRef>& columns);
304 void ParsePdbxAuditRevisionDetails(
const std::vector<StringRef>& columns);
309 void ParsePdbxDatabaseStatus(
const std::vector<StringRef>& columns);
314 void ParseStruct(
const std::vector<StringRef>& columns);
319 void ParseStructConf(
const std::vector<StringRef>& columns);
324 void ParseStructSheetRange(
const std::vector<StringRef>& columns);
329 void ParsePdbxDatabasePdbObsSpr(
const std::vector<StringRef>& columns);
334 void ParsePdbxEntityBranch(
const std::vector<StringRef>& columns);
339 void ParsePdbxEntityBranchLink(
const std::vector<StringRef>& columns);
344 void ParseEntityPolySeq(
const std::vector<StringRef>& columns);
349 void ParseEm3DReconstruction(
const std::vector<StringRef>& columns);
357 } MMCifSecStructElement;
362 MMCifSecStructElement DetermineSecStructType(
const StringRef& type)
const;
409 PDBX_SEQ_ONE_LETTER_CODE,
410 PDBX_SEQ_ONE_LETTER_CODE_CAN
425 PDBX_DATABASE_ID_DOI,
426 PDBX_DATABASE_ID_PUBMED,
436 } CitationAuthorItems;
458 } PdbxStructAssemblyItems;
486 } StructRefSeqDifItems;
493 } PdbxStructAssemblyGenItems;
511 } PdbxStructOperListItems;
519 PDBX_FORMULA_WEIGHT_METHOD,
521 PDBX_MODEL_TYPE_DETAILS,
528 SC_BEG_LABEL_ASYM_ID,
529 SC_BEG_LABEL_COMP_ID,
533 SC_END_LABEL_ASYM_ID,
534 SC_END_LABEL_COMP_ID,
541 SSR_BEG_LABEL_ASYM_ID,
542 SSR_BEG_LABEL_COMP_ID,
543 SSR_BEG_LABEL_SEQ_ID,
544 SSR_END_LABEL_ASYM_ID,
545 SSR_END_LABEL_COMP_ID,
546 SSR_END_LABEL_SEQ_ID,
549 SSR_BEG_AUTH_ASYM_ID,
550 SSR_END_AUTH_ASYM_ID,
551 } StructSheetRangeItems;
559 } PdbxDatabasePDBObsSpr;
567 } DatabasePDBRevItems;
575 } PdbxAuditRevisionHistoryItems;
579 PARD_REVISION_ORDINAL,
581 } PdbxAuditRevisionDetailsItems;
585 PDS_RECVD_INITIAL_DEPOSITION_DATE,
586 } PdbxDatabaseStatusItems;
601 BL_ENTITY_BRANCH_LIST_NUM_1,
602 BL_ENTITY_BRANCH_LIST_NUM_2,
603 BL_ATOM_STEREO_CONFIG_1,
604 BL_ATOM_STEREO_CONFIG_2,
606 } EntityBranchLinkItems;
614 } EntityPolySeqItems;
619 } Em3DReconstructionItems;
630 PDBX_STRUCT_ASSEMBLY,
631 PDBX_STRUCT_ASSEMBLY_GEN,
632 PDBX_STRUCT_OPER_LIST,
636 PDBX_DATABASE_PDB_OBS_SPR,
641 PDBX_AUDIT_REVISION_HISTORY,
642 PDBX_AUDIT_REVISION_DETAILS,
643 PDBX_DATABASE_STATUS,
645 PDBX_ENTITY_BRANCH_LINK,
647 EM_3D_RECONSTRUCTION,
654 MMCifEntityDescMap::iterator GetEntityDescMapIterator(
const String& entity_id);
659 std::vector<String> chains;
660 std::vector<std::vector<String> > operations;
664 typedef std::vector<MMCifBioUAssembly> MMCifBioUAssemblyVector;
666 typedef std::map<String, std::pair<std::vector<int>, std::vector<String> > >
667 MMCifCitationAuthorMap;
675 typedef std::vector<MMCifHSEntry> MMCifHSVector;
682 typedef std::map<String, MMCifPSAEntry> MMCifPSAMap;
685 struct MMCifRevisionDesc {
687 MMCifRevisionDesc(
int _num,
const String& _date,
int _major,
int _minor)
707 unsigned char bond_order;
708 } MMCifPdbxEntityBranchLink;
709 typedef std::map<String, std::vector<MMCifPdbxEntityBranchLink> >
710 MMCifPdbxEntityBranchLinkMap;
713 MMCifCategory category_;
715 int indices_[MAX_ITEMS_IN_ROW];
716 const IOProfile& profile_;
717 mol::EntityHandle& ent_handle_;
721 mol::ChainHandle curr_chain_;
722 mol::ResidueHandle curr_residue_;
726 bool warned_name_mismatch_;
727 bool warned_rule_based_;
731 std::vector<std::pair<mol::ChainHandle, String> > chain_id_pairs_;
737 MMCifCitationAuthorMap authors_map_;
738 MMCifBioUAssemblyVector bu_assemblies_;
739 MMCifPSAMap bu_origin_map_;
740 MMCifHSVector helix_list_;
741 MMCifHSVector strand_list_;
744 std::vector<MMCifRevisionDesc> revisions_;
745 std::map<int, String> revision_types_;
746 bool database_PDB_rev_added_;
748 MMCifPdbxEntityBranchLinkMap entity_branch_link_map_;
750 std::map<String, std::map<int, String> > entity_poly_seq_map_;
751 std::map<String, std::vector<std::pair<int, String> > > entity_poly_seq_h_map_;
759 const StringRef value_order);
765 const unsigned char bond_order);
convenient datatype for referencing character data
void SetAuthChainID(bool id)
Enable or disable reading of auth_chain_id instead aof label_chain id (default)
container class for additional information from MMCif files
boost::shared_ptr< CompoundLibBase > CompoundLibBasePtr
const MMCifInfoStructRefs & GetStructRefs() const
std::map< String, MMCifEntityDesc > MMCifEntityDescMap
seq::SequenceList GetSeqRes() const
Return sequences.
const String & GetRestrictChains() const
pointer_it< T > end(const std::vector< T > &values)
DLLEXPORT_OST_IO unsigned char MMCifValueOrderToOSTBondOrder(const StringRef value_order)
Translate mmCIF info on bond type (e.g. pdbx_entity_branch_link.value_order) to OST bond_order...
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
DLLEXPORT_OST_IO String OSTBondOrderToMMCifValueOrder(const unsigned char bond_order)
Translate an OST bond_order to mmCIF value_order.
std::vector< SequenceImplPtr > SequenceList
void SetReadSeqRes(bool flag)
Toggle reading of SEQRES.
const MMCifInfo & GetInfo()
Get additional information of the mmCIF file.
void TryStoreIdx(const int mapping, const String &item, const StarLoopDesc &header)
Store an item index from loop header in preparation for reading a row. Throws an exception if the ite...
const String & GetCategory() const
int GetIndex(const String &name) const
void SetReadCanonicalSeqRes(bool flag)
Toggle reading of canonical sequence residues (entity_poly.pdbx_seq_one_letter_code_can instead of en...
bool GetReadSeqRes() const
Check if reading of SEQRES is enabled.