19 #ifndef OST_MMCIF_READER_HH
20 #define OST_MMCIF_READER_HH
34 namespace ost {
namespace io {
94 return restrict_chains_;
126 const std::vector<StringRef>& columns);
152 indices_[mapping] = header.
GetIndex(item);
154 if (indices_[mapping] == -1) {
160 this->GetCurrentLinenum()));
244 bool& is_range,
int lborder,
245 std::vector<String>& single_block);
247 void StoreRange(
const char*& l,
const char* s,
bool& is_range,
int& lborder,
248 std::vector<String>& single_block);
321 } MMCifSecStructElement;
373 PDBX_SEQ_ONE_LETTER_CODE,
374 PDBX_SEQ_ONE_LETTER_CODE_CAN
389 PDBX_DATABASE_ID_DOI,
390 PDBX_DATABASE_ID_PUBMED,
400 } CitationAuthorItems;
422 } PdbxStructAssemblyItems;
450 } StructRefSeqDifItems;
457 } PdbxStructAssemblyGenItems;
475 } PdbxStructOperListItems;
483 PDBX_FORMULA_WEIGHT_METHOD,
485 PDBX_MODEL_TYPE_DETAILS,
492 SC_BEG_LABEL_ASYM_ID,
493 SC_BEG_LABEL_COMP_ID,
497 SC_END_LABEL_ASYM_ID,
498 SC_END_LABEL_COMP_ID,
505 SSR_BEG_LABEL_ASYM_ID,
506 SSR_BEG_LABEL_COMP_ID,
507 SSR_BEG_LABEL_SEQ_ID,
508 SSR_END_LABEL_ASYM_ID,
509 SSR_END_LABEL_COMP_ID,
510 SSR_END_LABEL_SEQ_ID,
513 SSR_BEG_AUTH_ASYM_ID,
514 SSR_END_AUTH_ASYM_ID,
515 } StructSheetRangeItems;
523 } PdbxDatabasePDBObsSpr;
531 } DatabasePDBRevItems;
539 } PdbxAuditRevisionHistoryItems;
543 PARD_REVISION_ORDINAL,
545 } PdbxAuditRevisionDetailsItems;
549 PDS_RECVD_INITIAL_DEPOSITION_DATE,
550 } PdbxDatabaseStatusItems;
565 BL_ENTITY_BRANCH_LIST_NUM_1,
566 BL_ENTITY_BRANCH_LIST_NUM_2,
567 BL_ATOM_STEREO_CONFIG_1,
568 BL_ATOM_STEREO_CONFIG_2,
570 } EntityBranchLinkItems;
578 } EntityPolySeqItems;
583 } Em3DReconstructionItems;
594 PDBX_STRUCT_ASSEMBLY,
595 PDBX_STRUCT_ASSEMBLY_GEN,
596 PDBX_STRUCT_OPER_LIST,
600 PDBX_DATABASE_PDB_OBS_SPR,
605 PDBX_AUDIT_REVISION_HISTORY,
606 PDBX_AUDIT_REVISION_DETAILS,
607 PDBX_DATABASE_STATUS,
609 PDBX_ENTITY_BRANCH_LINK,
611 EM_3D_RECONSTRUCTION,
618 MMCifEntityDescMap::iterator GetEntityDescMapIterator(
const String& entity_id);
623 std::vector<String> chains;
625 std::vector<std::vector<String> > operations;
628 typedef std::vector<MMCifBioUAssembly> MMCifBioUAssemblyVector;
630 typedef std::map<String, std::pair<std::vector<int>, std::vector<String> > >
631 MMCifCitationAuthorMap;
639 typedef std::vector<MMCifHSEntry> MMCifHSVector;
646 typedef std::map<String, MMCifPSAEntry> MMCifPSAMap;
649 struct MMCifRevisionDesc {
651 MMCifRevisionDesc(
int _num,
const String& _date,
int _major,
int _minor)
671 unsigned char bond_order;
672 } MMCifPdbxEntityBranchLink;
673 typedef std::map<String, std::vector<MMCifPdbxEntityBranchLink> >
674 MMCifPdbxEntityBranchLinkMap;
677 MMCifCategory category_;
679 int indices_[MAX_ITEMS_IN_ROW];
680 const IOProfile& profile_;
681 mol::EntityHandle& ent_handle_;
684 mol::ChainHandle curr_chain_;
685 mol::ResidueHandle curr_residue_;
689 bool warned_name_mismatch_;
690 bool warned_rule_based_;
694 std::vector<std::pair<mol::ChainHandle, String> > chain_id_pairs_;
698 MMCifCitationAuthorMap authors_map_;
699 MMCifBioUAssemblyVector bu_assemblies_;
700 MMCifPSAMap bu_origin_map_;
701 MMCifHSVector helix_list_;
702 MMCifHSVector strand_list_;
705 std::vector<MMCifRevisionDesc> revisions_;
706 std::map<int, String> revision_types_;
707 bool database_PDB_rev_added_;
709 MMCifPdbxEntityBranchLinkMap entity_branch_link_map_;
711 std::map<String, std::map<int, String> > entity_poly_seq_map_;
712 std::map<String, std::vector<std::pair<int, String> > > entity_poly_seq_h_map_;
720 const StringRef value_order);
726 const unsigned char bond_order);
convenient datatype for referencing character data
container class for additional information from MMCif files
void ParseExptl(const std::vector< StringRef > &columns)
Fetch mmCIF exptl information.
MMCifReader(std::istream &stream, mol::EntityHandle &ent_handle, const IOProfile &profile)
create a MMCifReader
void ParsePdbxDatabaseStatus(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_database_status information.
virtual bool OnBeginData(const StringRef &data_name)
check mmcif input to be read. Substitutional function for StarParser.
void ParsePdbxStructAssembly(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_struct_assembly information.
void ParseStruct(const std::vector< StringRef > &columns)
Fetch mmCIF struct information.
void ParseStructRef(const std::vector< StringRef > &columns)
\ brief parse a row in the struct_ref category
void Init()
Initialise the reader.
void ParsePdbxAuditRevisionDetails(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_audit_revision_details information.
MMCifSecStructElement DetermineSecStructType(const StringRef &type) const
Check whether an element was classified sheet or helix.
const String & GetRestrictChains() const
std::vector< std::vector< String > > UnPackOperExperession(StringRef expression)
bool ParseAtomIdent(const std::vector< StringRef > &columns, String &auth_chain_name, String &cif_chain_name, StringRef &res_name, mol::ResNum &resnum, bool &valid_res_num, StringRef &atom_name, char &alt_loc)
fetch values identifying atoms
virtual void OnEndData()
Finalise parsing.
void ParsePdbxStructOperList(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_struct_oper_list information.
void ParseEntityPoly(const std::vector< StringRef > &columns)
Fetch mmCIF entity_poly information.
void StoreExpression(const char *l, const char *s, bool &is_range, int lborder, std::vector< String > &single_block)
virtual void OnDataRow(const StarLoopDesc &header, const std::vector< StringRef > &columns)
read a row of data
void ParseEntity(const std::vector< StringRef > &columns)
Fetch mmCIF entity information.
void SetAuthChainID(bool id)
Enable or disable reading of auth_chain_id instead aof label_chain id (default)
void SetRestrictChains(const String &restrict_chains)
Set names of restricted chains for the reader.
void AssignSecStructure(mol::EntityHandle ent)
Transform data from struct_conf entry into secondary structure.
const MMCifInfo & GetInfo()
Get additional information of the mmCIF file.
void ParseEntityPolySeq(const std::vector< StringRef > &columns)
Fetch mmCIF entity_poly_seq information.
void ParseStructRefSeqDif(const std::vector< StringRef > &columns)
parse row in the struct_ref_seq_dif category
void ParsePdbxEntityBranchLink(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_entity_branch_link information.
const MMCifInfoStructRefs & GetStructRefs() const
seq::SequenceList GetSeqRes() const
Return sequences.
void ParsePdbxStructAssemblyGen(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_struct_assembly_gen information.
void ParseDatabasePDBRev(const std::vector< StringRef > &columns)
Fetch mmCIF database_PDB_rev information.
void StoreRange(const char *&l, const char *s, bool &is_range, int &lborder, std::vector< String > &single_block)
void ClearState()
Set up a fresh instance.
void ParsePdbxAuditRevisionHistory(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_audit_revision_history information.
void ParseCitationAuthor(const std::vector< StringRef > &columns)
Fetch mmCIF citation_author information.
void ParseStructConf(const std::vector< StringRef > &columns)
Fetch mmCIF struct_conf (secondary structure) information.
void ParsePdbxEntityBranch(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_entity_branch information.
void ParsePdbxDatabasePdbObsSpr(const std::vector< StringRef > &columns)
Fetch mmCIF pdbx_database_PDB_obs_spr information.
void ParseAndAddAtom(const std::vector< StringRef > &columns)
Fetch atom information and store it.
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...
MMCifReader(const String &filename, mol::EntityHandle &ent_handle, const IOProfile &profile)
create a MMCifReader
void ParseStructRefSeq(const std::vector< StringRef > &columns)
parse row in the struct_ref_seq category
virtual bool OnBeginLoop(const StarLoopDesc &header)
check if a current loop is to be parsed
void ParseCitation(const std::vector< StringRef > &columns)
Fetch mmCIF citation information.
void ParseRefine(const std::vector< StringRef > &columns)
Fetch mmCIF refine information.
void ParseStructSheetRange(const std::vector< StringRef > &columns)
Fetch mmCIF struct_sheet_range (beta sheets) information.
void ParseEm3DReconstruction(const std::vector< StringRef > &columns)
Fetch mmCIF entity_poly_seq information.
int GetIndex(const String &name) const
const String & GetCategory() const
DLLEXPORT_OST_IO String OSTBondOrderToMMCifValueOrder(const unsigned char bond_order)
Translate an OST bond_order to mmCIF value_order.
std::vector< MMCifInfoStructRefPtr > MMCifInfoStructRefs
std::map< String, MMCifEntityDesc > MMCifEntityDescMap
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.
pointer_it< T > end(const std::vector< T > &values)