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);
84 bool l,
bool r,
int c=0):
119 BondSpec(
int a,
int b,
int o): atom_one(a), atom_two(b), order(o) {}
204 chem_class_=chem_class;
220 replaced_by_=replaced_by;
228 chem_type_=chem_type;
240 return chem_class_.IsPeptideLinking();
244 return chem_class_.IsNucleotideLinking();
248 atom_specs_.push_back(atom);
252 bond_specs_.push_back(bond);
259 int GetAtomSpecIndex(
const String& name)
const;
290 return creation_date_;
300 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)
void SetSMILES(const String &smiles)
#define DLLEXPORT_OST_CONOP
void SetName(const String &name)
const BondSpecList & GetBondSpecs() const
AtomSpec(int o, const String &n, const String &a, const String &e, bool l, bool r, int c=0)
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)
const String & GetReplacedBy() const
Knows about the atoms and bonds of a chemical compounds.
void SetReplacedBy(const String &replaced_by)
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 & GetSMILES()
const String & GetInchiKey()
mol::ChemClass GetChemClass() const
bool operator==(const BondSpec &rhs) const
void AddBond(const BondSpec &bond)
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 SetObsolete(bool obsolete)
void SetInchi(const String &inchi)
bool operator==(const Date &date) const
bool operator!=(const AtomSpec &rhs) const