STORMM Source Documentation
|
A molecular or atomic property read from an MDL .mol or SDF file. More...
#include <mdlmol_property.h>
Public Member Functions | |
MdlMolPropertyKind | getKind () const |
Get the kind of property according to the internal enumerator. | |
char4 | getCode () const |
Get the property code. This will indicate whether to obliterate certain types of information from the atom block of the V2000 MDL MOL format entry. | |
int | getSubstrate () const |
Get the substrate atom or S-group. The nature of the property will indicate which type of substrate this is. | |
int | getPrintedSubstrate () const |
Get the substrate atom or S-group for the purposes of printing. The nature of the property will indicate which type of substrate this is, but all substrates' indices shift by -1 when being read and therefore shift by +1 when being written to the MDL MOL format. | |
bool | applyToExclusions () const |
Indicate whether the atom list encoded by this property is based on excluded elements (return TRUE) or included ones (return FALSE). If the property is not an "M ALS" entry, raise a runtime error. | |
char | getExclusionCode () const |
Get a code ('T' if TRUE, 'F' if FALSE) to indicate whether the atom list describes exclusions. | |
int | getEntryCount () const |
Get the number of entries for this property. | |
int | getDataLineCount () const |
Get the number of data lines for this property. | |
const std::string & | getDataLine (int index) const |
Get a const pointer to one of the data lines. | |
std::string | getMdlText () const |
Recompose the text string for this property as it would appear in an MDL MOL file. | |
void | setSubstrate (int index) |
Define the substrate to be used, whether an atom or an S-group. | |
void | setEntryFormat (const std::vector< MolObjPropField > &entry_detail_in, const std::vector< MolObjIndexKind > &entry_adjustment_in) |
Define the entry format for the property. If applied to an existing MdlMolProperty with nonzero depth, this will create an error. | |
void | addEntry (const std::vector< int > &int_data_in, const std::vector< char4 > &char4_data_in, const std::vector< double > &real_data_in, const std::vector< std::string > &str_data_in) |
Add an entry to the MDL MOL V2000 format property. The layout must match that established in the detail array. Adjustments will not be applied to the indexing for input originating within the program. Other methods will adjust the indexing of atoms, bonds, and S-groups named in auxiliary user input when making properties out of such information. | |
MdlMolProperty (const char4 code_in={ ' ', ' ', ' ', ' ' }, int substrate_in=-1, int entry_count_in=0, int entry_depth_in=0, bool exclusions_in=false, int substrate_line_pos_in=-1, int entry_count_line_pos_in=-1, int entry_read_start_pos_in=0, const std::vector< int > &entry_data_bounds_in={}, const std::vector< MolObjPropField > &entry_detail_in={}, const std::vector< MolObjIndexKind > &entry_adjustment_in={}, const std::vector< int > &int_data_in={}, const std::vector< double > &real_data_in={}, const std::vector< std::string > &str_data_in={}, const std::vector< std::string > &data_lines_in={}) | |
The constructor takes all member variable inputs, or the original text and a line number within it. | |
MdlMolProperty (const TextFile &tf, int line_number, int *line_advance, const std::string &title=std::string("")) | |
MdlMolProperty (const MdlMolProperty &original)=default | |
The default copy and move constructors, as well as copy and move assignment operators, are applicable to this object which has no const members or pointers to repair. | |
MdlMolProperty (MdlMolProperty &&original)=default | |
MdlMolProperty & | operator= (const MdlMolProperty &other)=default |
MdlMolProperty & | operator= (MdlMolProperty &&other)=default |
int | getIntegerValue (int entry_index, int attribute_index) const |
Get a value from the property for a specific entry. Inputs to these functions will be checked by checkAttributeValidity(). | |
int | getPrintedIntegerValue (int entry_index, int attribute_index) const |
double | getRealValue (int entry_index, int attribute_index) const |
char4 | getChar4Value (int entry_index, int attribute_index) const |
std::string | getStringValue (int entry_index, int attribute_index) const |
void | setCode (char x, char y, char z, char major='M') |
Define the property code. | |
void | setCode (char4 code_in) |
A molecular or atomic property read from an MDL .mol or SDF file.
stormm::structure::MdlMolProperty::MdlMolProperty | ( | const char4 | code_in = { ' ', ' ', ' ', ' ' }, |
int | substrate_in = -1, | ||
int | entry_count_in = 0, | ||
int | entry_depth_in = 0, | ||
bool | exclusions_in = false, | ||
int | substrate_line_pos_in = -1, | ||
int | entry_count_line_pos_in = -1, | ||
int | entry_read_start_pos_in = 0, | ||
const std::vector< int > & | entry_data_bounds_in = {}, | ||
const std::vector< MolObjPropField > & | entry_detail_in = {}, | ||
const std::vector< MolObjIndexKind > & | entry_adjustment_in = {}, | ||
const std::vector< int > & | int_data_in = {}, | ||
const std::vector< double > & | real_data_in = {}, | ||
const std::vector< std::string > & | str_data_in = {}, | ||
const std::vector< std::string > & | data_lines_in = {} ) |
The constructor takes all member variable inputs, or the original text and a line number within it.
tf | Text of the original .sdf or .mol file, read into RAM |
line_number | Number of the line on which to read the data |
line_advance | The line advancement position, which will account for data lines in some properties |
title | The title of the structure, if known, for error tracing purposes |
void stormm::structure::MdlMolProperty::addEntry | ( | const std::vector< int > & | int_data_in, |
const std::vector< char4 > & | char4_data_in, | ||
const std::vector< double > & | real_data_in, | ||
const std::vector< std::string > & | str_data_in ) |
Add an entry to the MDL MOL V2000 format property. The layout must match that established in the detail array. Adjustments will not be applied to the indexing for input originating within the program. Other methods will adjust the indexing of atoms, bonds, and S-groups named in auxiliary user input when making properties out of such information.
int_data_in All integer data, given in the order that INTEGER MolObjPropField types appear in the detail array. No char4, real or string data indices are included in this array.
char4_data_in | List of char4 data elements, given back-to-back in the order that CHAR4 MolObjPropField types appear in the detail array. |
real_data_in | List of real data, ordered as the other arrays in this input. |
string_data_in | List of string data, ordered as the other arrays in this input. |
int stormm::structure::MdlMolProperty::getIntegerValue | ( | int | entry_index, |
int | attribute_index ) const |
Get a value from the property for a specific entry. Inputs to these functions will be checked by checkAttributeValidity().
entry_index | The index of the entry to access |
attribute_index | The index of the attribute to retrieve |
void stormm::structure::MdlMolProperty::setCode | ( | char | x, |
char | y, | ||
char | z, | ||
char | major = 'M' ) |
Define the property code.
Overloaded:
x | The first letter of the three-letter tuple in the property code |
y | The second letter of the three-letter tuple defining the property code |
z | The last letter of the three-letter tuple defining the property code |
major | The first letter that will appear on the line if the property is written to a file |
code_in | A pre-made code to apply, ordered 3-4-5-0 in terms of the indices that each character would occupy on a property line of an MDL MOL format entry |
void stormm::structure::MdlMolProperty::setEntryFormat | ( | const std::vector< MolObjPropField > & | entry_detail_in, |
const std::vector< MolObjIndexKind > & | entry_adjustment_in ) |
Define the entry format for the property. If applied to an existing MdlMolProperty with nonzero depth, this will create an error.
entry_detail_in | List of data types of the entry elements |
entry_adjustment_in | List of index adjustments for each element of the entry. Atom and bond elements will have their indices adjusted by -1, but only if the information is read from a file–programmatic input is still expected to occur in the C / C++ array numbering. |
void stormm::structure::MdlMolProperty::setSubstrate | ( | int | index | ) |
Define the substrate to be used, whether an atom or an S-group.
index | Atom or S-group index of the substrate. This should be provided for the C / C++ array element, not the file format (+1 will be added if and when the information is committed to a file). |