19 #ifndef OST_MMCIF_READER_HH
20 #define OST_MMCIF_READER_HH
34 namespace ost {
namespace io {
104 return restrict_chains_;
136 const std::vector<StringRef>& columns);
180 indices_[mapping] = header.
GetIndex(item);
182 if (indices_[mapping] == -1) {
188 this->GetCurrentLinenum()));
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);
357 } MMCifSecStructElement;
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;
661 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_;
765 const unsigned char bond_order);
convenient datatype for referencing character data
container class for additional information from MMCif files
reader for the mmcif file format
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 SetReadCanonicalSeqRes(bool flag)
Toggle reading of canonical sequence residues (entity_poly.pdbx_seq_one_letter_code_can instead of en...
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)
bool GetReadSeqRes() const
Check if reading of SEQRES is enabled.
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.
void SetReadSeqRes(bool flag)
Toggle reading of SEQRES.
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)
String ConvertSEQRES(const String &seqres, conop::CompoundLibBasePtr compound_lib)
convert the seqres data item to canonical form.
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
parser for the STAR file format
boost::shared_ptr< CompoundLibBase > CompoundLibBasePtr
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)
std::vector< SequenceImplPtr > SequenceList