19 #ifndef OST_MMCIF_READER_HH
20 #define OST_MMCIF_READER_HH
34 namespace ost {
namespace io {
63 MMCifReader(std::istream& stream, mol::EntityHandle& ent_handle,
64 const IOProfile& profile);
69 MMCifReader(
const String& filename, mol::EntityHandle& ent_handle,
70 const IOProfile& profile);
83 void SetRestrictChains(
const String& restrict_chains);
90 void SetReadCanonicalSeqRes(
bool flag)
95 const String& GetRestrictChains()
const
97 return restrict_chains_;
104 void SetAuthChainID(
bool id)
115 virtual bool OnBeginData(
const StringRef& data_name);
129 const std::vector<StringRef>& columns);
132 virtual void OnEndData();
144 void SetReadSeqRes(
bool flag)
152 bool GetReadSeqRes()
const
169 void TryStoreIdx(
const int mapping,
173 indices_[mapping] = header.
GetIndex(item);
175 if (indices_[mapping] == -1) {
181 this->GetCurrentLinenum()));
190 bool IsValidPDBIdent(
const StringRef& pdbid);
204 bool ParseAtomIdent(
const std::vector<StringRef>& columns,
216 void ParseAndAddAtom(
const std::vector<StringRef>& columns);
221 void ParseEntity(
const std::vector<StringRef>& columns);
226 void ParseEntityPoly(
const std::vector<StringRef>& columns);
231 void ParseCitation(
const std::vector<StringRef>& columns);
246 void ParseCitationAuthor(
const std::vector<StringRef>& columns);
249 void ParseStructRef(
const std::vector<StringRef>& columns);
252 void ParseStructRefSeq(
const std::vector<StringRef>& columns);
255 void ParseStructRefSeqDif(
const std::vector<StringRef>& columns);
259 void ParseExptl(
const std::vector<StringRef>& columns);
264 void ParseRefine(
const std::vector<StringRef>& columns);
269 void ParsePdbxStructAssembly(
const std::vector<StringRef>& columns);
274 void ParsePdbxStructAssemblyGen(
const std::vector<StringRef>& columns);
276 std::vector<std::vector<String> > UnPackOperExperession(
StringRef expression);
278 void StoreExpression(
const char* l,
const char* s,
279 bool& is_range,
int lborder,
280 std::vector<String>& single_block);
282 void StoreRange(
const char*& l,
const char* s,
bool& is_range,
int& lborder,
283 std::vector<String>& single_block);
288 void ParsePdbxStructOperList(
const std::vector<StringRef>& columns);
293 void ParseStruct(
const std::vector<StringRef>& columns);
298 void ParseStructConf(
const std::vector<StringRef>& columns);
303 void ParseStructSheetRange(
const std::vector<StringRef>& columns);
308 void ParsePdbxDatabasePdbObsSpr(
const std::vector<StringRef>& columns);
315 } MMCifSecStructElement;
320 MMCifSecStructElement DetermineSecStructType(
const StringRef& type)
const;
367 PDBX_SEQ_ONE_LETTER_CODE,
368 PDBX_SEQ_ONE_LETTER_CODE_CAN
381 PDBX_DATABASE_ID_DOI,
382 PDBX_DATABASE_ID_PUBMED,
392 } CitationAuthorItems;
412 } PdbxStructAssemblyItems;
440 } StructRefSeqDifItems;
446 } PdbxStructAssemblyGenItems;
464 } PdbxStructOperListItems;
472 PDBX_FORMULA_WEIGHT_METHOD,
474 PDBX_MODEL_TYPE_DETAILS,
481 SC_BEG_LABEL_ASYM_ID,
482 SC_BEG_LABEL_COMP_ID,
486 SC_END_LABEL_ASYM_ID,
487 SC_END_LABEL_COMP_ID,
494 SSR_BEG_LABEL_ASYM_ID,
495 SSR_BEG_LABEL_COMP_ID,
496 SSR_BEG_LABEL_SEQ_ID,
497 SSR_END_LABEL_ASYM_ID,
498 SSR_END_LABEL_COMP_ID,
499 SSR_END_LABEL_SEQ_ID,
502 SSR_BEG_AUTH_ASYM_ID,
503 SSR_END_AUTH_ASYM_ID,
504 } StructSheetRangeItems;
512 } PdbxDatabasePDBObsSpr;
523 PDBX_STRUCT_ASSEMBLY,
524 PDBX_STRUCT_ASSEMBLY_GEN,
525 PDBX_STRUCT_OPER_LIST,
529 PDBX_DATABASE_PDB_OBS_SPR,
542 typedef std::map<String, MMCifEntityDesc> MMCifEntityDescMap;
546 MMCifInfoBioUnit biounit;
547 std::vector<std::vector<String> > operations;
550 typedef std::vector<MMCifBioUAssembly> MMCifBioUAssemblyVector;
552 typedef std::map<String, std::pair<std::vector<int>, std::vector<String> > >
553 MMCifCitationAuthorMap;
561 typedef std::vector<MMCifHSEntry> MMCifHSVector;
564 MMCifCategory category_;
566 int indices_[MAX_ITEMS_IN_ROW];
567 const IOProfile& profile_;
568 mol::EntityHandle& ent_handle_;
572 mol::ChainHandle curr_chain_;
573 mol::ResidueHandle curr_residue_;
577 bool warned_name_mismatch_;
578 bool warned_rule_based_;
582 std::vector<std::pair<mol::ChainHandle, String> > chain_id_pairs_;
584 MMCifEntityDescMap entity_desc_map_;
588 MMCifCitationAuthorMap authors_map_;
589 MMCifBioUAssemblyVector bu_assemblies_;
590 std::map<String, String> bu_origin_map_;
591 MMCifHSVector helix_list_;
592 MMCifHSVector strand_list_;