19 #ifndef OST_MMCIF_READER_HH
20 #define OST_MMCIF_READER_HH
34 namespace ost {
namespace io {
67 MMCifReader(std::istream& stream, mol::EntityHandle& ent_handle,
68 const IOProfile& profile);
75 MMCifReader(
const String& filename, mol::EntityHandle& ent_handle,
76 const IOProfile& profile);
88 void SetRestrictChains(
const String& restrict_chains);
102 return restrict_chains_;
120 virtual bool OnBeginData(
const StringRef& data_name);
134 const std::vector<StringRef>& columns);
137 virtual void OnEndData();
178 indices_[mapping] = header.
GetIndex(item);
180 if (indices_[mapping] == -1) {
186 this->GetCurrentLinenum()));
203 bool ParseAtomIdent(
const std::vector<StringRef>& columns,
215 void ParseAndAddAtom(
const std::vector<StringRef>& columns);
220 void ParseEntity(
const std::vector<StringRef>& columns);
225 void ParseEntityPoly(
const std::vector<StringRef>& columns);
230 void ParseCitation(
const std::vector<StringRef>& columns);
245 void ParseCitationAuthor(
const std::vector<StringRef>& columns);
248 void ParseStructRef(
const std::vector<StringRef>& columns);
251 void ParseStructRefSeq(
const std::vector<StringRef>& columns);
254 void ParseStructRefSeqDif(
const std::vector<StringRef>& columns);
258 void ParseExptl(
const std::vector<StringRef>& columns);
263 void ParseRefine(
const std::vector<StringRef>& columns);
268 void ParsePdbxStructAssembly(
const std::vector<StringRef>& columns);
273 void ParsePdbxStructAssemblyGen(
const std::vector<StringRef>& columns);
275 std::vector<std::vector<String> > UnPackOperExperession(
StringRef expression);
277 void StoreExpression(
const char* l,
const char* s,
278 bool& is_range,
int lborder,
279 std::vector<String>& single_block);
281 void StoreRange(
const char*& l,
const char* s,
bool& is_range,
int& lborder,
282 std::vector<String>& single_block);
287 void ParsePdbxStructOperList(
const std::vector<StringRef>& columns);
292 void ParseDatabasePDBRev(
const std::vector<StringRef>& columns);
297 void ParsePdbxAuditRevisionHistory(
const std::vector<StringRef>& columns);
302 void ParsePdbxAuditRevisionDetails(
const std::vector<StringRef>& columns);
307 void ParsePdbxDatabaseStatus(
const std::vector<StringRef>& columns);
312 void ParseStruct(
const std::vector<StringRef>& columns);
317 void ParseStructConf(
const std::vector<StringRef>& columns);
322 void ParseStructSheetRange(
const std::vector<StringRef>& columns);
327 void ParsePdbxDatabasePdbObsSpr(
const std::vector<StringRef>& columns);
334 } MMCifSecStructElement;
339 MMCifSecStructElement DetermineSecStructType(
const StringRef& type)
const;
385 PDBX_SEQ_ONE_LETTER_CODE,
386 PDBX_SEQ_ONE_LETTER_CODE_CAN
399 PDBX_DATABASE_ID_DOI,
400 PDBX_DATABASE_ID_PUBMED,
410 } CitationAuthorItems;
432 } PdbxStructAssemblyItems;
460 } StructRefSeqDifItems;
467 } PdbxStructAssemblyGenItems;
485 } PdbxStructOperListItems;
493 PDBX_FORMULA_WEIGHT_METHOD,
495 PDBX_MODEL_TYPE_DETAILS,
502 SC_BEG_LABEL_ASYM_ID,
503 SC_BEG_LABEL_COMP_ID,
507 SC_END_LABEL_ASYM_ID,
508 SC_END_LABEL_COMP_ID,
515 SSR_BEG_LABEL_ASYM_ID,
516 SSR_BEG_LABEL_COMP_ID,
517 SSR_BEG_LABEL_SEQ_ID,
518 SSR_END_LABEL_ASYM_ID,
519 SSR_END_LABEL_COMP_ID,
520 SSR_END_LABEL_SEQ_ID,
523 SSR_BEG_AUTH_ASYM_ID,
524 SSR_END_AUTH_ASYM_ID,
525 } StructSheetRangeItems;
533 } PdbxDatabasePDBObsSpr;
541 } DatabasePDBRevItems;
547 } PdbxAuditRevisionHistoryItems;
551 PARD_REVISION_ORDINAL,
553 } PdbxAuditRevisionDetailsItems;
557 PDS_RECVD_INITIAL_DEPOSITION_DATE,
558 } PdbxDatabaseStatusItems;
569 PDBX_STRUCT_ASSEMBLY,
570 PDBX_STRUCT_ASSEMBLY_GEN,
571 PDBX_STRUCT_OPER_LIST,
575 PDBX_DATABASE_PDB_OBS_SPR,
580 PDBX_AUDIT_REVISION_HISTORY,
581 PDBX_AUDIT_REVISION_DETAILS,
582 PDBX_DATABASE_STATUS,
592 typedef std::map<String, MMCifEntityDesc> MMCifEntityDescMap;
597 std::vector<String> chains;
598 std::vector<std::vector<String> > operations;
602 typedef std::vector<MMCifBioUAssembly> MMCifBioUAssemblyVector;
604 typedef std::map<String, std::pair<std::vector<int>, std::vector<String> > >
605 MMCifCitationAuthorMap;
613 typedef std::vector<MMCifHSEntry> MMCifHSVector;
620 typedef std::map<String, MMCifPSAEntry> MMCifPSAMap;
623 MMCifCategory category_;
625 int indices_[MAX_ITEMS_IN_ROW];
626 const IOProfile& profile_;
627 mol::EntityHandle& ent_handle_;
631 mol::ChainHandle curr_chain_;
632 mol::ResidueHandle curr_residue_;
636 bool warned_name_mismatch_;
637 bool warned_rule_based_;
641 std::vector<std::pair<mol::ChainHandle, String> > chain_id_pairs_;
643 MMCifEntityDescMap entity_desc_map_;
647 MMCifCitationAuthorMap authors_map_;
648 MMCifBioUAssemblyVector bu_assemblies_;
649 MMCifPSAMap bu_origin_map_;
650 MMCifHSVector helix_list_;
651 MMCifHSVector strand_list_;
654 std::map<int, String> revision_dates_;
655 std::map<int, String> revision_types_;
656 bool database_PDB_rev_added_;
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
const MMCifInfoStructRefs & GetStructRefs() const
seq::SequenceList GetSeqRes() const
Return sequences.
const String & GetRestrictChains() const
pointer_it< T > end(const std::vector< T > &values)
boost::shared_ptr< CompoundLib > CompoundLibPtr
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
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.