19 #ifndef OST_CONOP_COMPOUND_HH
20 #define OST_CONOP_COMPOUND_HH
24 #include <boost/shared_ptr.hpp>
31 namespace ost {
namespace conop {
35 year(y), month(m), day(d)
38 year(1900), month(1), day(1)
42 return year<date.
year && month<date.
month && day<date.
day;
46 return year==date.
year && month==date.
month && day==date.
day;
56 std::vector<StringRef> parts=str.
split(
'-');
57 assert(parts.size()==3);
58 std::pair<bool, int> year=parts[0].to_int();
59 std::pair<bool, int> month=parts[1].to_int();
60 std::pair<bool, int> day=parts[2].to_int();
61 assert(year.first); assert(month.first); assert(day.first);
62 return Date(year.second, month.second, day.second);
116 BondSpec(
int a,
int b,
int o): atom_one(a), atom_two(b), order(o) {}
198 chem_class_=chem_class;
206 chem_type_=chem_type;
218 return chem_class_.IsPeptideLinking();
222 return chem_class_.IsNucleotideLinking();
226 atom_specs_.push_back(atom);
230 bond_specs_.push_back(bond);
237 int GetAtomSpecIndex(
const String& name)
const;
264 return creation_date_;
274 creation_date_=creation_date;
void SetFormula(const String &formula)
convenient datatype for referencing character data
std::vector< BondSpec > BondSpecList
Date(int y, int m, int d)
std::vector< AtomSpec > AtomSpecList
std::vector< StringRef > split(char p) const
split string into chunks delimited by p
BondSpec(int a, int b, int o)
#define DLLEXPORT_OST_CONOP
void SetName(const String &name)
const BondSpecList & GetBondSpecs() const
bool operator!=(const Date &date) const
bool operator==(const AtomSpec &rhs) const
void SetCreationDate(const Date &creation_date)
const String & GetID() const
three-letter code that is unique for every compound
Compound(const String &id)
std::map< String, CompoundPtr > CompoundMap
bool DLLEXPORT_OST_GEOM operator==(const Line2 &l1, const Line2 &l2)
const String & GetInchi()
static Date FromString(const StringRef &str)
const AtomSpecList & GetAtomSpecs() const
void SetModificationDate(const Date &mod_date)
Knows about the atoms and bonds of a chemical compounds.
const Date & GetCreationDate() const
void SetChemClass(mol::ChemClass chem_class)
void AddAtom(const AtomSpec &atom)
String GetDialectAsString() const
void SetInchiKey(const String &inchikey)
Dialect GetDialect() const
boost::shared_ptr< Compound > CompoundPtr
void SetOneLetterCode(char olc)
bool IsPeptideLinking() const
mol::ChemType GetChemType() const
PDB ligand classification from component dictionary.
char GetOneLetterCode() const
one letter code, if available.
const Date & GetModificationDate() const
void SetDialect(Dialect dialect)
const String & GetInchiKey()
mol::ChemClass GetChemClass() const
bool operator==(const BondSpec &rhs) const
void AddBond(const BondSpec &bond)
AtomSpec(int o, const String &n, const String &a, const String &e, bool l, bool r)
void SetChemType(mol::ChemType chem_type)
bool IsNucleotideLinking() const
bool operator!=(const BondSpec &rhs) const
const String & GetFormula()
bool operator<(const Date &date) const
void SetInchi(const String &inchi)
bool operator==(const Date &date) const
bool operator!=(const AtomSpec &rhs) const