Commit d4972542 by Maarten L. Hekkelman

re-added group to Compound. Seems to be important

parent b7330c07
...@@ -104,6 +104,7 @@ class Compound ...@@ -104,6 +104,7 @@ class Compound
std::string id() const { return mID; } std::string id() const { return mID; }
std::string name() const { return mName; } std::string name() const { return mName; }
std::string type() const { return mType; } std::string type() const { return mType; }
std::string group() const { return mGroup; }
std::string formula() const { return mFormula; } std::string formula() const { return mFormula; }
float formulaWeight() const { return mFormulaWeight; } float formulaWeight() const { return mFormulaWeight; }
int formalCharge() const { return mFormalCharge; } int formalCharge() const { return mFormalCharge; }
...@@ -130,11 +131,12 @@ class Compound ...@@ -130,11 +131,12 @@ class Compound
friend class CCP4CompoundFactoryImpl; friend class CCP4CompoundFactoryImpl;
Compound(cif::Datablock &db); Compound(cif::Datablock &db);
Compound(cif::Datablock &db, const std::string &id, const std::string &name, const std::string &type); Compound(cif::Datablock &db, const std::string &id, const std::string &name, const std::string &type, const std::string &group);
std::string mID; std::string mID;
std::string mName; std::string mName;
std::string mType; std::string mType;
std::string mGroup;
std::string mFormula; std::string mFormula;
float mFormulaWeight = 0; float mFormulaWeight = 0;
int mFormalCharge = 0; int mFormalCharge = 0;
......
...@@ -127,6 +127,8 @@ Compound::Compound(cif::Datablock &db) ...@@ -127,6 +127,8 @@ Compound::Compound(cif::Datablock &db)
ba::replace_all(mName, "\n", ""); ba::replace_all(mName, "\n", "");
mGroup = "non-polymer";
auto &chemCompAtom = db["chem_comp_atom"]; auto &chemCompAtom = db["chem_comp_atom"];
for (auto row : chemCompAtom) for (auto row : chemCompAtom)
{ {
...@@ -150,10 +152,11 @@ Compound::Compound(cif::Datablock &db) ...@@ -150,10 +152,11 @@ Compound::Compound(cif::Datablock &db)
} }
} }
Compound::Compound(cif::Datablock &db, const std::string &id, const std::string &name, const std::string &type) Compound::Compound(cif::Datablock &db, const std::string &id, const std::string &name, const std::string &type, const std::string &group)
: mID(id) : mID(id)
, mName(name) , mName(name)
, mType(type) , mType(type)
, mGroup(group)
{ {
auto &chemCompAtom = db["chem_comp_atom"]; auto &chemCompAtom = db["chem_comp_atom"];
for (auto row : chemCompAtom) for (auto row : chemCompAtom)
...@@ -410,7 +413,7 @@ CompoundFactoryImpl::CompoundFactoryImpl(const std::filesystem::path &file, std: ...@@ -410,7 +413,7 @@ CompoundFactoryImpl::CompoundFactoryImpl(const std::filesystem::path &file, std:
auto &db = cifFile["comp_" + id]; auto &db = cifFile["comp_" + id];
mCompounds.push_back(new Compound(db, id, name, type)); mCompounds.push_back(new Compound(db, id, name, type, group));
} }
} }
else else
...@@ -616,7 +619,7 @@ Compound *CCP4CompoundFactoryImpl::create(const std::string &id) ...@@ -616,7 +619,7 @@ Compound *CCP4CompoundFactoryImpl::create(const std::string &id)
else else
type = "non-polymer"; type = "non-polymer";
mCompounds.push_back(new Compound(db, id, name, type)); mCompounds.push_back(new Compound(db, id, name, type, group));
result = mCompounds.back(); result = mCompounds.back();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment