19 #ifndef OST_CONOP_COMPOUND_HH
20 #define OST_CONOP_COMPOUND_HH
24 #include <boost/shared_ptr.hpp>
33 namespace ost {
namespace conop {
37 year(y), month(m), day(d)
40 year(1900), month(1), day(1)
44 return year<date.
year && month<date.
month && day<date.
day;
48 return year==date.
year && month==date.
month && day==date.
day;
58 std::vector<StringRef> parts=str.
split(
'-');
59 if (parts.size() != 3) {
60 std::stringstream msg;
61 msg <<
"Invalid date string: '" << str <<
"'";
64 std::pair<bool, int> year=parts[0].to_int();
65 std::pair<bool, int> month=parts[1].to_int();
66 std::pair<bool, int> day=parts[2].to_int();
67 if (! year.first || ! month.first || ! day.first) {
68 std::stringstream msg;
69 msg <<
"Invalid date string: '" << str <<
"'";
72 return Date(year.second, month.second, day.second);
94 bool l,
bool r,
int c=0):
129 BondSpec(
int a,
int b,
int o): atom_one(a), atom_two(b), order(o) {}
220 chem_class_=chem_class;
236 replaced_by_=replaced_by;
244 chem_type_=chem_type;
256 return chem_class_.IsPeptideLinking();
260 return chem_class_.IsNucleotideLinking();
264 atom_specs_.push_back(atom);
268 bond_specs_.push_back(bond);
306 return creation_date_;
316 creation_date_=creation_date;
convenient datatype for referencing character data
std::vector< StringRef > split(char p) const
split string into chunks delimited by p
Knows about the atoms and bonds of a chemical compounds.
void AddBond(const BondSpec &bond)
mol::ChemType GetChemType() const
PDB ligand classification from component dictionary.
const String & GetInchiKey()
bool IsPeptideLinking() const
const String & GetSMILES()
void AddAtom(const AtomSpec &atom)
void SetFormula(const String &formula)
void SetReplacedBy(const String &replaced_by)
const String & GetReplacedBy() const
char GetOneLetterCode() const
one letter code, if available.
void SetID(const String &id)
set three-letter code that is unique for every compound
String GetDialectAsString() const
Dialect GetDialect() const
void SetModificationDate(const Date &mod_date)
void SetOneLetterCode(char olc)
const Date & GetCreationDate() const
const String & GetFormula()
void SetSMILES(const String &smiles)
void SetObsolete(bool obsolete)
void SetChemClass(mol::ChemClass chem_class)
const BondSpecList & GetBondSpecs() const
const String & GetInchi()
void SetInchi(const String &inchi)
const AtomSpecList & GetAtomSpecs() const
bool IsNucleotideLinking() const
int GetAtomSpecIndex(const String &name) const
Compound(const String &id)
void SetDialect(Dialect dialect)
void SetName(const String &name)
mol::ChemClass GetChemClass() const
void SetChemType(mol::ChemType chem_type)
const String & GetID() const
three-letter code that is unique for every compound
void SetCreationDate(const Date &creation_date)
void SetInchiKey(const String &inchikey)
const Date & GetModificationDate() const
#define DLLEXPORT_OST_CONOP
bool DLLEXPORT_OST_GEOM operator==(const Line2 &l1, const Line2 &l2)
std::vector< BondSpec > BondSpecList
boost::shared_ptr< Compound > CompoundPtr
std::vector< AtomSpec > AtomSpecList
std::map< String, CompoundPtr > CompoundMap
bool operator!=(const AtomSpec &rhs) const
bool operator==(const AtomSpec &rhs) const
AtomSpec(int o, const String &n, const String &a, const String &e, bool l, bool r, int c=0)
bool operator!=(const BondSpec &rhs) const
bool operator==(const BondSpec &rhs) const
BondSpec(int a, int b, int o)
Date(int y, int m, int d)
bool operator<(const Date &date) const
bool operator!=(const Date &date) const
static Date FromString(const StringRef &str)
bool operator==(const Date &date) const