reader for the mmcif file format More...
#include <mmcif_reader.hh>
Inherits ost::io::StarParser, and ost::io::StarParser.
Data Structures | |
struct | MMCifBioUAssembly |
struct | MMCifEntityDesc |
struct | MMCifHSEntry |
struct | MMCifPSAEntry |
Public Member Functions | |
MMCifReader (std::istream &stream, mol::EntityHandle &ent_handle, const IOProfile &profile) | |
MMCifReader (const String &filename, mol::EntityHandle &ent_handle, const IOProfile &profile) | |
void | Init () |
void | ClearState () |
void | SetRestrictChains (const String &restrict_chains) |
void | SetReadCanonicalSeqRes (bool flag) |
const String & | GetRestrictChains () const |
void | SetAuthChainID (bool id) |
virtual bool | OnBeginData (const StringRef &data_name) |
virtual bool | OnBeginLoop (const StarLoopDesc &header) |
virtual void | OnDataRow (const StarLoopDesc &header, const std::vector< StringRef > &columns) |
virtual void | OnEndData () |
seq::SequenceList | GetSeqRes () const |
void | SetReadSeqRes (bool flag) |
bool | GetReadSeqRes () const |
const MMCifInfo & | GetInfo () |
MMCifReader (std::istream &stream, mol::EntityHandle &ent_handle, const IOProfile &profile) | |
MMCifReader (const String &filename, mol::EntityHandle &ent_handle, const IOProfile &profile) | |
void | Init () |
void | ClearState () |
void | SetRestrictChains (const String &restrict_chains) |
void | SetReadCanonicalSeqRes (bool flag) |
const String & | GetRestrictChains () const |
void | SetAuthChainID (bool id) |
virtual bool | OnBeginData (const StringRef &data_name) |
virtual bool | OnBeginLoop (const StarLoopDesc &header) |
virtual void | OnDataRow (const StarLoopDesc &header, const std::vector< StringRef > &columns) |
virtual void | OnEndData () |
seq::SequenceList | GetSeqRes () const |
void | SetReadSeqRes (bool flag) |
bool | GetReadSeqRes () const |
const MMCifInfo & | GetInfo () |
Protected Types | |
enum | MMCifSecStructElement { MMCIF_HELIX, MMCIF_STRAND, MMCIF_TURN, MMCIF_HELIX, MMCIF_STRAND, MMCIF_TURN } |
enum | MMCifSecStructElement { MMCIF_HELIX, MMCIF_STRAND, MMCIF_TURN, MMCIF_HELIX, MMCIF_STRAND, MMCIF_TURN } |
Protected Member Functions | |
void | TryStoreIdx (const int mapping, const String &item, const StarLoopDesc &header) |
bool | IsValidPDBIdent (const StringRef &pdbid) |
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) |
void | ParseAndAddAtom (const std::vector< StringRef > &columns) |
void | ParseEntity (const std::vector< StringRef > &columns) |
void | ParseEntityPoly (const std::vector< StringRef > &columns) |
void | ParseCitation (const std::vector< StringRef > &columns) |
const MMCifInfoStructRefs & | GetStructRefs () const |
String | ConvertSEQRES (const String &seqres, conop::CompoundLibPtr compound_lib) |
void | ParseCitationAuthor (const std::vector< StringRef > &columns) |
void | ParseStructRef (const std::vector< StringRef > &columns) |
void | ParseStructRefSeq (const std::vector< StringRef > &columns) |
void | ParseStructRefSeqDif (const std::vector< StringRef > &columns) |
void | ParseExptl (const std::vector< StringRef > &columns) |
void | ParseRefine (const std::vector< StringRef > &columns) |
void | ParsePdbxStructAssembly (const std::vector< StringRef > &columns) |
void | ParsePdbxStructAssemblyGen (const std::vector< StringRef > &columns) |
std::vector< std::vector < String > > | UnPackOperExperession (StringRef expression) |
void | StoreExpression (const char *l, const char *s, bool &is_range, int lborder, std::vector< String > &single_block) |
void | StoreRange (const char *&l, const char *s, bool &is_range, int &lborder, std::vector< String > &single_block) |
void | ParsePdbxStructOperList (const std::vector< StringRef > &columns) |
void | ParseDatabasePDBRev (const std::vector< StringRef > &columns) |
void | ParseStruct (const std::vector< StringRef > &columns) |
void | ParseStructConf (const std::vector< StringRef > &columns) |
void | ParseStructSheetRange (const std::vector< StringRef > &columns) |
void | ParsePdbxDatabasePdbObsSpr (const std::vector< StringRef > &columns) |
MMCifSecStructElement | DetermineSecStructType (const StringRef &type) const |
void | AssignSecStructure (mol::EntityHandle ent) |
void | TryStoreIdx (const int mapping, const String &item, const StarLoopDesc &header) |
bool | IsValidPDBIdent (const StringRef &pdbid) |
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) |
void | ParseAndAddAtom (const std::vector< StringRef > &columns) |
void | ParseEntity (const std::vector< StringRef > &columns) |
void | ParseEntityPoly (const std::vector< StringRef > &columns) |
void | ParseCitation (const std::vector< StringRef > &columns) |
const MMCifInfoStructRefs & | GetStructRefs () const |
String | ConvertSEQRES (const String &seqres, conop::CompoundLibPtr compound_lib) |
void | ParseCitationAuthor (const std::vector< StringRef > &columns) |
void | ParseStructRef (const std::vector< StringRef > &columns) |
void | ParseStructRefSeq (const std::vector< StringRef > &columns) |
void | ParseStructRefSeqDif (const std::vector< StringRef > &columns) |
void | ParseExptl (const std::vector< StringRef > &columns) |
void | ParseRefine (const std::vector< StringRef > &columns) |
void | ParsePdbxStructAssembly (const std::vector< StringRef > &columns) |
void | ParsePdbxStructAssemblyGen (const std::vector< StringRef > &columns) |
std::vector< std::vector < String > > | UnPackOperExperession (StringRef expression) |
void | StoreExpression (const char *l, const char *s, bool &is_range, int lborder, std::vector< String > &single_block) |
void | StoreRange (const char *&l, const char *s, bool &is_range, int &lborder, std::vector< String > &single_block) |
void | ParsePdbxStructOperList (const std::vector< StringRef > &columns) |
void | ParseDatabasePDBRev (const std::vector< StringRef > &columns) |
void | ParseStruct (const std::vector< StringRef > &columns) |
void | ParseStructConf (const std::vector< StringRef > &columns) |
void | ParseStructSheetRange (const std::vector< StringRef > &columns) |
void | ParsePdbxDatabasePdbObsSpr (const std::vector< StringRef > &columns) |
MMCifSecStructElement | DetermineSecStructType (const StringRef &type) const |
void | AssignSecStructure (mol::EntityHandle ent) |
reader for the mmcif file format
mmcif is an instance of the STAR format to store entries of the PDB. The following data categories should be covered by this reader:
Definition at line 59 of file mmcif_reader.hh.
enum MMCifSecStructElement [protected] |
Definition at line 322 of file mmcif_reader.hh.
enum MMCifSecStructElement [protected] |
Definition at line 322 of file mmcif_reader.hh.
MMCifReader | ( | std::istream & | stream, | |
mol::EntityHandle & | ent_handle, | |||
const IOProfile & | profile | |||
) |
create a MMCifReader
stream | input stream | |
ent_handle | ||
profile |
MMCifReader | ( | const String & | filename, | |
mol::EntityHandle & | ent_handle, | |||
const IOProfile & | profile | |||
) |
create a MMCifReader
filename | input file | |
ent_handle | ||
profile |
MMCifReader | ( | std::istream & | stream, | |
mol::EntityHandle & | ent_handle, | |||
const IOProfile & | profile | |||
) |
create a MMCifReader
stream | input stream | |
ent_handle | ||
profile |
MMCifReader | ( | const String & | filename, | |
mol::EntityHandle & | ent_handle, | |||
const IOProfile & | profile | |||
) |
create a MMCifReader
filename | input file | |
ent_handle | ||
profile |
void AssignSecStructure | ( | mol::EntityHandle | ent | ) | [protected] |
Transform data from struct_conf entry into secondary structure.
ent | Entity to assign secondary structure to |
void AssignSecStructure | ( | mol::EntityHandle | ent | ) | [protected] |
Transform data from struct_conf entry into secondary structure.
ent | Entity to assign secondary structure to |
void ClearState | ( | ) |
Set up a fresh instance.
void ClearState | ( | ) |
Set up a fresh instance.
String ConvertSEQRES | ( | const String & | seqres, | |
conop::CompoundLibPtr | compound_lib | |||
) | [protected] |
convert the seqres data item to canonical form.
The seqres sequence lists non-standard residues in paranthesis. For proper handling of our sequence classes, these need to be converted to one-letter-codes. Ideally, we would use the canonical SEQRES. This is not possible, however, since the PDB assigns multiple one letter codes to some of the residues. To be consistent, we have to do the conversion on our own.
String ConvertSEQRES | ( | const String & | seqres, | |
conop::CompoundLibPtr | compound_lib | |||
) | [protected] |
convert the seqres data item to canonical form.
The seqres sequence lists non-standard residues in paranthesis. For proper handling of our sequence classes, these need to be converted to one-letter-codes. Ideally, we would use the canonical SEQRES. This is not possible, however, since the PDB assigns multiple one letter codes to some of the residues. To be consistent, we have to do the conversion on our own.
MMCifSecStructElement DetermineSecStructType | ( | const StringRef & | type | ) | const [protected] |
Check whether an element was classified sheet or helix.
type | Type to be classified |
MMCifSecStructElement DetermineSecStructType | ( | const StringRef & | type | ) | const [protected] |
Check whether an element was classified sheet or helix.
type | Type to be classified |
const MMCifInfo& GetInfo | ( | ) | [inline] |
Get additional information of the mmCIF file.
Definition at line 165 of file mmcif_reader.hh.
const MMCifInfo& GetInfo | ( | ) | [inline] |
Get additional information of the mmCIF file.
Definition at line 165 of file mmcif_reader.hh.
bool GetReadSeqRes | ( | ) | const [inline] |
Check if reading of SEQRES is enabled.
Definition at line 157 of file mmcif_reader.hh.
bool GetReadSeqRes | ( | ) | const [inline] |
Check if reading of SEQRES is enabled.
Definition at line 157 of file mmcif_reader.hh.
const String& GetRestrictChains | ( | ) | const [inline] |
Definition at line 100 of file mmcif_reader.hh.
const String& GetRestrictChains | ( | ) | const [inline] |
Definition at line 100 of file mmcif_reader.hh.
seq::SequenceList GetSeqRes | ( | ) | const [inline] |
seq::SequenceList GetSeqRes | ( | ) | const [inline] |
const MMCifInfoStructRefs& GetStructRefs | ( | ) | const [inline, protected] |
Definition at line 239 of file mmcif_reader.hh.
const MMCifInfoStructRefs& GetStructRefs | ( | ) | const [inline, protected] |
Definition at line 239 of file mmcif_reader.hh.
void Init | ( | ) |
Initialise the reader.
void Init | ( | ) |
Initialise the reader.
bool IsValidPDBIdent | ( | const StringRef & | pdbid | ) | [protected] |
Check a PDB id to be of length 4 and start with a digit.
pdbid | putative PDB id |
bool IsValidPDBIdent | ( | const StringRef & | pdbid | ) | [protected] |
Check a PDB id to be of length 4 and start with a digit.
pdbid | putative PDB id |
virtual bool OnBeginData | ( | const StringRef & | data_name | ) | [virtual] |
check mmcif input to be read. Substitutional function for StarParser.
data_name | value of the data_ tag |
Reimplemented from StarParser.
virtual bool OnBeginData | ( | const StringRef & | data_name | ) | [virtual] |
check mmcif input to be read. Substitutional function for StarParser.
data_name | value of the data_ tag |
Reimplemented from StarParser.
virtual bool OnBeginLoop | ( | const StarLoopDesc & | header | ) | [virtual] |
check if a current loop is to be parsed
header | categories of the upcoming loop block |
Reimplemented from StarParser.
virtual bool OnBeginLoop | ( | const StarLoopDesc & | header | ) | [virtual] |
check if a current loop is to be parsed
header | categories of the upcoming loop block |
Reimplemented from StarParser.
virtual void OnDataRow | ( | const StarLoopDesc & | header, | |
const std::vector< StringRef > & | columns | |||
) | [virtual] |
read a row of data
header | categories and items | |
columns | data |
Reimplemented from StarParser.
virtual void OnDataRow | ( | const StarLoopDesc & | header, | |
const std::vector< StringRef > & | columns | |||
) | [virtual] |
read a row of data
header | categories and items | |
columns | data |
Reimplemented from StarParser.
virtual void OnEndData | ( | ) | [virtual] |
Finalise parsing.
Reimplemented from StarParser.
virtual void OnEndData | ( | ) | [virtual] |
Finalise parsing.
Reimplemented from StarParser.
void ParseAndAddAtom | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch atom information and store it.
columns | data row |
void ParseAndAddAtom | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch atom information and store it.
columns | data row |
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 | |||
) | [protected] |
fetch values identifying atoms
[in] | columns | data row |
[out] | auth_chain_name | takes atom_site.label_asym_id or, if auth_chain_id_ is set, atom_site.auth_asym_id as a chain name |
[out] | cif_chain_name | |
[out] | res_name | fetches atom_site.label_comp_id |
[out] | resnum | gets atom_site.label_seq_id if available, consecutive numbers, otherwise |
[out] | valid_res_num | shows if we have a valid residue number or if we have to invent our own |
[out] | atom_name | corresponds to label_atom_id |
[out] | alt_loc | gets first letter of atom_site.label_alt_id |
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 | |||
) | [protected] |
fetch values identifying atoms
[in] | columns | data row |
[out] | auth_chain_name | takes atom_site.label_asym_id or, if auth_chain_id_ is set, atom_site.auth_asym_id as a chain name |
[out] | cif_chain_name | |
[out] | res_name | fetches atom_site.label_comp_id |
[out] | resnum | gets atom_site.label_seq_id if available, consecutive numbers, otherwise |
[out] | valid_res_num | shows if we have a valid residue number or if we have to invent our own |
[out] | atom_name | corresponds to label_atom_id |
[out] | alt_loc | gets first letter of atom_site.label_alt_id |
void ParseCitation | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF citation information.
columns | data row |
void ParseCitation | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF citation information.
columns | data row |
void ParseCitationAuthor | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF citation_author information.
columns | data row |
void ParseCitationAuthor | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF citation_author information.
columns | data row |
void ParseDatabasePDBRev | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF database_PDB_rev information.
columns | data row |
void ParseDatabasePDBRev | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF database_PDB_rev information.
columns | data row |
void ParseEntity | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF entity information.
columns | data row |
void ParseEntity | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF entity information.
columns | data row |
void ParseEntityPoly | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF entity_poly information.
columns | data row |
void ParseEntityPoly | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF entity_poly information.
columns | data row |
void ParseExptl | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF exptl information.
columns | data row |
void ParseExptl | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF exptl information.
columns | data row |
void ParsePdbxDatabasePdbObsSpr | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_database_PDB_obs_spr information.
columns | data row |
void ParsePdbxDatabasePdbObsSpr | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_database_PDB_obs_spr information.
columns | data row |
void ParsePdbxStructAssembly | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_struct_assembly information.
columns | data row |
void ParsePdbxStructAssembly | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_struct_assembly information.
columns | data row |
void ParsePdbxStructAssemblyGen | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_struct_assembly_gen information.
columns | data row |
void ParsePdbxStructAssemblyGen | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_struct_assembly_gen information.
columns | data row |
void ParsePdbxStructOperList | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_struct_oper_list information.
columns | data row |
void ParsePdbxStructOperList | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF pdbx_struct_oper_list information.
columns | data row |
void ParseRefine | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF refine information.
columns | data row |
void ParseRefine | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF refine information.
columns | data row |
void ParseStruct | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF struct information.
columns | data row |
void ParseStruct | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF struct information.
columns | data row |
void ParseStructConf | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF struct_conf (secondary structure) information.
columns | data row |
void ParseStructConf | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF struct_conf (secondary structure) information.
columns | data row |
void ParseStructRef | ( | const std::vector< StringRef > & | columns | ) | [protected] |
\ brief parse a row in the struct_ref category
void ParseStructRef | ( | const std::vector< StringRef > & | columns | ) | [protected] |
\ brief parse a row in the struct_ref category
void ParseStructRefSeq | ( | const std::vector< StringRef > & | columns | ) | [protected] |
parse row in the struct_ref_seq category
void ParseStructRefSeq | ( | const std::vector< StringRef > & | columns | ) | [protected] |
parse row in the struct_ref_seq category
void ParseStructRefSeqDif | ( | const std::vector< StringRef > & | columns | ) | [protected] |
parse row in the struct_ref_seq_dif category
void ParseStructRefSeqDif | ( | const std::vector< StringRef > & | columns | ) | [protected] |
parse row in the struct_ref_seq_dif category
void ParseStructSheetRange | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF struct_sheet_range (beta sheets) information.
columns | data row |
void ParseStructSheetRange | ( | const std::vector< StringRef > & | columns | ) | [protected] |
Fetch mmCIF struct_sheet_range (beta sheets) information.
columns | data row |
void SetAuthChainID | ( | bool | id | ) | [inline] |
Enable or disable reading of auth_chain_id instead aof label_chain id (default).
id | enable (true) or disable (false) reading of auth_chain_id. |
Definition at line 109 of file mmcif_reader.hh.
void SetAuthChainID | ( | bool | id | ) | [inline] |
Enable or disable reading of auth_chain_id instead aof label_chain id (default).
id | enable (true) or disable (false) reading of auth_chain_id. |
Definition at line 109 of file mmcif_reader.hh.
void SetReadCanonicalSeqRes | ( | bool | flag | ) | [inline] |
Toggle reading of canonical sequence residues (entity_poly.pdbx_seq_one_letter_code_can instead of entity_poly.pdbx_seq_one_letter_code). This flag is exclusive.
flag | True for reading canonical sequences. |
Definition at line 95 of file mmcif_reader.hh.
void SetReadCanonicalSeqRes | ( | bool | flag | ) | [inline] |
Toggle reading of canonical sequence residues (entity_poly.pdbx_seq_one_letter_code_can instead of entity_poly.pdbx_seq_one_letter_code). This flag is exclusive.
flag | True for reading canonical sequences. |
Definition at line 95 of file mmcif_reader.hh.
void SetReadSeqRes | ( | bool | flag | ) | [inline] |
Toggle reading of SEQRES.
flag | True enables, False disables reading SEQRES |
Definition at line 149 of file mmcif_reader.hh.
void SetReadSeqRes | ( | bool | flag | ) | [inline] |
Toggle reading of SEQRES.
flag | True enables, False disables reading SEQRES |
Definition at line 149 of file mmcif_reader.hh.
void SetRestrictChains | ( | const String & | restrict_chains | ) |
Set names of restricted chains for the reader.
restrict_chains | chain name |
void SetRestrictChains | ( | const String & | restrict_chains | ) |
Set names of restricted chains for the reader.
restrict_chains | chain name |
void StoreExpression | ( | const char * | l, | |
const char * | s, | |||
bool & | is_range, | |||
int | lborder, | |||
std::vector< String > & | single_block | |||
) | [protected] |
void StoreExpression | ( | const char * | l, | |
const char * | s, | |||
bool & | is_range, | |||
int | lborder, | |||
std::vector< String > & | single_block | |||
) | [protected] |
void StoreRange | ( | const char *& | l, | |
const char * | s, | |||
bool & | is_range, | |||
int & | lborder, | |||
std::vector< String > & | single_block | |||
) | [protected] |
void StoreRange | ( | const char *& | l, | |
const char * | s, | |||
bool & | is_range, | |||
int & | lborder, | |||
std::vector< String > & | single_block | |||
) | [protected] |
void TryStoreIdx | ( | const int | mapping, | |
const String & | item, | |||
const StarLoopDesc & | header | |||
) | [inline, protected] |
Store an item index from loop header in preparation for reading a row. Throws an exception if the item does not exist.
mapping | position the item index is stored at | |
item | exact item name to fetch | |
header | loop header to pull index from |
Definition at line 174 of file mmcif_reader.hh.
void TryStoreIdx | ( | const int | mapping, | |
const String & | item, | |||
const StarLoopDesc & | header | |||
) | [inline, protected] |
Store an item index from loop header in preparation for reading a row. Throws an exception if the item does not exist.
mapping | position the item index is stored at | |
item | exact item name to fetch | |
header | loop header to pull index from |
Definition at line 174 of file mmcif_reader.hh.