19 #ifndef OST_MMCIF_READER_HH
20 #define OST_MMCIF_READER_HH
34 namespace ost {
namespace io {
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
401 PDBX_DATABASE_ID_DOI,
402 PDBX_DATABASE_ID_PUBMED,
412 } CitationAuthorItems;
434 } PdbxStructAssemblyItems;
462 } StructRefSeqDifItems;
469 } PdbxStructAssemblyGenItems;
487 } PdbxStructOperListItems;
495 PDBX_FORMULA_WEIGHT_METHOD,
497 PDBX_MODEL_TYPE_DETAILS,
504 SC_BEG_LABEL_ASYM_ID,
505 SC_BEG_LABEL_COMP_ID,
509 SC_END_LABEL_ASYM_ID,
510 SC_END_LABEL_COMP_ID,
517 SSR_BEG_LABEL_ASYM_ID,
518 SSR_BEG_LABEL_COMP_ID,
519 SSR_BEG_LABEL_SEQ_ID,
520 SSR_END_LABEL_ASYM_ID,
521 SSR_END_LABEL_COMP_ID,
522 SSR_END_LABEL_SEQ_ID,
525 SSR_BEG_AUTH_ASYM_ID,
526 SSR_END_AUTH_ASYM_ID,
527 } StructSheetRangeItems;
535 } PdbxDatabasePDBObsSpr;
543 } DatabasePDBRevItems;
551 } PdbxAuditRevisionHistoryItems;
555 PARD_REVISION_ORDINAL,
557 } PdbxAuditRevisionDetailsItems;
561 PDS_RECVD_INITIAL_DEPOSITION_DATE,
562 } PdbxDatabaseStatusItems;
573 PDBX_STRUCT_ASSEMBLY,
574 PDBX_STRUCT_ASSEMBLY_GEN,
575 PDBX_STRUCT_OPER_LIST,
579 PDBX_DATABASE_PDB_OBS_SPR,
584 PDBX_AUDIT_REVISION_HISTORY,
585 PDBX_AUDIT_REVISION_DETAILS,
586 PDBX_DATABASE_STATUS,
596 typedef std::map<String, MMCifEntityDesc> MMCifEntityDescMap;
601 std::vector<String> chains;
602 std::vector<std::vector<String> > operations;
606 typedef std::vector<MMCifBioUAssembly> MMCifBioUAssemblyVector;
608 typedef std::map<String, std::pair<std::vector<int>, std::vector<String> > >
609 MMCifCitationAuthorMap;
617 typedef std::vector<MMCifHSEntry> MMCifHSVector;
624 typedef std::map<String, MMCifPSAEntry> MMCifPSAMap;
627 struct MMCifRevisionDesc {
629 MMCifRevisionDesc(
int _num,
const String& _date,
int _major,
int _minor)
642 MMCifCategory category_;
644 int indices_[MAX_ITEMS_IN_ROW];
645 const IOProfile& profile_;
646 mol::EntityHandle& ent_handle_;
650 mol::ChainHandle curr_chain_;
651 mol::ResidueHandle curr_residue_;
655 bool warned_name_mismatch_;
656 bool warned_rule_based_;
660 std::vector<std::pair<mol::ChainHandle, String> > chain_id_pairs_;
662 MMCifEntityDescMap entity_desc_map_;
666 MMCifCitationAuthorMap authors_map_;
667 MMCifBioUAssemblyVector bu_assemblies_;
668 MMCifPSAMap bu_origin_map_;
669 MMCifHSVector helix_list_;
670 MMCifHSVector strand_list_;
673 std::vector<MMCifRevisionDesc> revisions_;
674 std::map<int, String> revision_types_;
675 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)
parser for the STAR file format
boost::shared_ptr< CompoundLib > CompoundLibPtr
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
std::vector< SequenceImplPtr > SequenceList
void SetReadSeqRes(bool flag)
Toggle reading of SEQRES.
reader for the mmcif file format
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.