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);
290 return creation_date_;
300 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.
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