Commit db164a20 by maarten

aanpassen van gelinkte data bij swapAtoms

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@478 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 9b1e9356
......@@ -152,7 +152,15 @@ class Item
void value(const string& v) { mValue = v; }
bool empty() const { return mValue.empty(); }
// empty means either null or unknown
bool empty() const;
// is_null means the field contains '.'
bool is_null() const;
// is_unknown means the field contains '?'
bool is_unknown() const;
size_t length() const { return mValue.length(); }
const char* c_str() const { return mValue.c_str(); }
......@@ -284,9 +292,15 @@ namespace detail
return result;
}
// empty means either null or unknown
bool empty() const;
// bool unapplicable() const;
// is_null means the field contains '.'
bool is_null() const;
// is_unknown means the field contains '?'
bool is_unknown() const;
const char* c_str() const;
// the following returns the defaultValue from either the parameter
......@@ -615,6 +629,8 @@ struct Condition
return mImpl ? mImpl->str() : "";
}
bool empty() const { return mImpl == nullptr; }
detail::ConditionImpl* mImpl;
bool mPrepared = false;
};
......
......@@ -63,6 +63,7 @@ struct ValidateItem
const ValidateType* mType;
cif::iset mEnums;
std::string mDefault;
bool mDefaultIsNull;
ValidateCategory* mCategory = nullptr;
// ItemLinked is used for non-key links
......
......@@ -15,6 +15,7 @@
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/logic/tribool.hpp>
#include "cif++/mrsrc.h"
......@@ -48,6 +49,10 @@ struct ItemValue
ItemValue(const char* v, uint32_t columnIndex);
~ItemValue();
bool empty() const { return mText[0] == 0 or ((mText[0] == '.' or mText[0] == '?') and mText[1] == 0); }
bool null() const { return mText[0] == '.' and mText[1] == 0; }
bool unknown() const { return mText[0] == '?' and mText[1] == 0; }
void* operator new(size_t size, size_t dataSize);
void operator delete(void* p);
};
......@@ -274,6 +279,32 @@ bool ItemReference::empty() const
return c_str() == kEmptyResult;
}
bool ItemReference::is_null() const
{
boost::tribool result;
if (mRow.mData != nullptr and mRow.mData->mCategory != nullptr)
{
for (auto iv = mRow.mData->mValues; iv != nullptr; iv = iv->mNext)
{
if (iv->mColumnIndex == mColumn)
{
result = iv->mText[0] == '.' and iv->mText[1] == 0;
break;
}
}
if (result == boost::indeterminate and mColumn < mRow.mData->mCategory->mColumns.size()) // not found, perhaps the category has a default defined?
{
auto iv = mRow.mData->mCategory->mColumns[mColumn].mValidator;
if (iv != nullptr)
result = iv->mDefaultIsNull;
}
}
return result;
}
void ItemReference::swap(ItemReference& b)
{
Row::swap(mColumn, mRow.mData, b.mRow.mData);
......@@ -1603,17 +1634,39 @@ Category::const_iterator Category::end() const
bool Category::hasParent(Row r, const Category& parentCat, const ValidateLink& link) const
{
assert(mValidator != nullptr);
assert(mCatValidator != nullptr);
bool result = true;
Condition cond;
for (size_t ix = 0; ix < link.mChildKeys.size(); ++ix)
{
const char* value = r[link.mChildKeys[ix]].c_str();
cond = move(cond) && (Key(link.mParentKeys[ix]) == value);
auto& name = link.mChildKeys[ix];
auto field = r[name];
if (field.empty())
{
if (mCatValidator->mMandatoryFields.count(name) and field.is_null())
cond = move(cond) and (Key(link.mParentKeys[ix]) == Empty());
}
else
{
const char* value = field.c_str();
cond = move(cond) and (Key(link.mParentKeys[ix]) == value);
}
}
if (VERBOSE > 2)
cerr << "Check condition '" << cond << "' in parent category " << link.mParentCategory << " for child cat " << mName << endl;
if (result and not cond.empty())
{
result = parentCat.exists(std::move(cond));
if (VERBOSE > 3 or (result == false and VERBOSE > 2))
cerr << "result = " << boolalpha << result << " for: '" << cond << "' in parent category " << link.mParentCategory << " for child cat " << mName << endl;
}
else if (VERBOSE > 3 and cond.empty())
cerr << "Condition is empty due to missing data in parent category " << link.mParentCategory << " for child cat " << mName << endl;
return parentCat.exists(std::move(cond));
return result;
}
bool Category::isOrphan(Row r)
......@@ -2263,9 +2316,9 @@ void Row::swap(size_t cix, ItemRow* a, ItemRow* b)
cat->mIndex->erase(b);
}
ItemValue* ap = nullptr;
ItemValue* ap = nullptr; // parent of ai
ItemValue* ai = nullptr;
ItemValue* bp = nullptr;
ItemValue* bp = nullptr; // parent of bi
ItemValue* bi = nullptr;
if (a->mValues == nullptr)
......@@ -2337,39 +2390,118 @@ void Row::swap(size_t cix, ItemRow* a, ItemRow* b)
cat->mIndex->insert(b);
}
#pragma warning("doen!")
// // see if we need to update any child categories that depend on these values
// auto iv = col.mValidator;
// if ((ai != nullptr or bi != nullptr) and
// iv != nullptr and not iv->mChildren.empty())
// {
// for (auto child: iv->mChildren)
// {
// if (child->mCategory == nullptr)
// continue;
//
// auto childCat = db.get(child->mCategory->mName);
// if (childCat == nullptr)
// continue;
//
//#if DEBUG
//cerr << "fixing linked item " << child->mCategory->mName << '.' << child->mTag << endl;
//#endif
// if (ai != nullptr)
// {
// auto rows = childCat->find(Key(child->mTag) == string(ai->mText));
// for (auto& cr: rows)
// cr.assign(child->mTag, bi == nullptr ? "" : bi->mText, false);
// }
//
// if (bi != nullptr)
// {
// auto rows = childCat->find(Key(child->mTag) == string(bi->mText));
// for (auto& cr: rows)
// cr.assign(child->mTag, ai == nullptr ? "" : ai->mText, false);
// }
// }
// }
if ((ai != nullptr or bi != nullptr))
{
auto parentColName = cat->getColumnName(cix);
// see if we need to update any child categories that depend on these values
auto& validator = cat->getValidator();
auto parentCatValidator = cat->getCatValidator();
for (auto& link: validator.getLinksForParent(cat->mName))
{
if (find(link->mParentKeys.begin(), link->mParentKeys.end(), parentColName) == link->mParentKeys.end())
continue;
auto childCat = cat->db().get(link->mChildCategory);
if (childCat == nullptr or childCat->empty())
continue;
auto childCatValidator = childCat->getCatValidator();
if (childCatValidator == nullptr)
continue;
string linkChildColName;
Condition cond[2];
for (size_t ab = 0; ab < 2; ++ab)
{
auto i = ab == 0 ? ai : bi;
auto r = ab == 0 ? a : b;
for (size_t ix = 0; ix < link->mChildKeys.size(); ++ix)
{
assert(ix < link->mParentKeys.size());
auto pcix = cat->getColumnIndex(link->mParentKeys[ix]);
auto childColName = link->mChildKeys[ix];
bool mandatory =
find(childCatValidator->mMandatoryFields.begin(), childCatValidator->mMandatoryFields.end(), childColName) != childCatValidator->mMandatoryFields.end() or
find(parentCatValidator->mMandatoryFields.begin(), parentCatValidator->mMandatoryFields.end(), link->mParentKeys[ix]) != parentCatValidator->mMandatoryFields.end();
string childValue;
if (pcix == cix)
{
linkChildColName = childColName;
if (not (i == nullptr or strcmp(i->mText, ".") == 0 or strcmp(i->mText, "?") == 0))
childValue = i->mText;
}
else
{
string ps = r->c_str(pcix);
if (not (ps.empty() or ps == "." or ps == "?"))
childValue = ps;
}
if (not childValue.empty())
{
if (mandatory or pcix == cix)
cond[ab] = move(cond[ab]) and Key(childColName) == childValue;
else
cond[ab] = move(cond[ab]) and (Key(childColName) == childValue or Key(childColName) == Empty());
}
else
cond[ab] = move(cond[ab]) and Key(childColName) == Empty();
}
}
RowSet rs[2] = { *childCat, *childCat };
// first find the respective rows, then flip values, otherwise you won't find them anymore!
for (size_t ab = 0; ab < 2; ++ab)
{
if (cond[ab].empty())
continue;
if (VERBOSE > 1)
cerr << "Fixing link from " << cat->mName << " to " << childCat->mName << " with " << endl
<< cond[ab] << endl;
rs[ab] = childCat->find(move(cond[ab]));
}
for (size_t ab = 0; ab < 2; ++ab)
{
auto i = ab == 0 ? bi : ai;
for (auto r: rs[ab])
{
// now due to the way links are defined, we might have found a row
// that contains an empty value for all child columns...
// Now, that's not a real hit, is it?
size_t n = 0;
for (auto c: link->mChildKeys)
if (r[c].empty())
++n;
if (n == link->mChildKeys.size())
{
if (VERBOSE > 1)
cerr << "All empty columns, skipping" << endl;
}
else
{
if (VERBOSE)
cerr << "In " << childCat->mName << " changing " << linkChildColName << ": " << r[linkChildColName] << " => " << (i ? i->mText : "") << endl;
r[linkChildColName] = i ? i->mText : "";
}
}
}
}
}
}
void Row::assign(const Item& value, bool emplacing)
......
......@@ -780,6 +780,15 @@ void DictParser::parseSaveFrame()
ess.insert(e["value"].as<string>());
string defaultValue = dict.firstItem("_item_default.value");
bool defaultIsNull = false;
if (defaultValue.empty())
{
for (auto& r: dict["_item_default"])
{
defaultIsNull = r["value"].is_null();
break;
}
}
// collect the dict from our dataBlock and construct validators
for (auto i: dict["item"])
......@@ -803,7 +812,7 @@ void DictParser::parseSaveFrame()
auto vi = find(ivs.begin(), ivs.end(), ValidateItem{itemName});
if (vi == ivs.end())
ivs.push_back(ValidateItem{itemName, iequals(mandatory, "yes"), tv, ess, defaultValue});
ivs.push_back(ValidateItem{itemName, iequals(mandatory, "yes"), tv, ess, defaultValue, defaultIsNull});
else
{
// need to update the itemValidator?
......
......@@ -13,6 +13,7 @@
#include <clipper/clipper-contrib.h>
#include <clipper/clipper-ccp4.h>
#include "cif++/Cif++.h"
#include "cif++/MapMaker.h"
#include "cif++/ResolutionCalculator.h"
......@@ -21,8 +22,6 @@ namespace fs = boost::filesystem;
namespace io = boost::iostreams;
namespace ba = boost::algorithm;
extern int VERBOSE;
namespace mmcif
{
......@@ -312,7 +311,7 @@ void Map<FTYPE>::read(const fs::path& mapFile)
{
fs::path dataFile = mapFile;
if (VERBOSE)
if (cif::VERBOSE)
cout << "Reading map from " << mapFile << endl;
if (mapFile.extension() == ".gz" or mapFile.extension() == ".bz2")
......@@ -401,7 +400,7 @@ void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate,
initializer_list<string> foLabels, initializer_list<string> fcLabels,
initializer_list<string> faLabels)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Reading map from " << hklin << endl
<< " with labels: FB: " << ba::join(fbLabels, ",") << endl
<< " with labels: FD: " << ba::join(fdLabels, ",") << endl
......@@ -523,7 +522,7 @@ void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate,
faMap.fft_from(mFaData);
}
if (VERBOSE)
if (cif::VERBOSE)
{
cerr << "Read Xmaps with sampling rate: " << samplingRate << endl
<< " stored resolution: " << mHKLInfo.resolution().limit() << endl
......@@ -660,7 +659,7 @@ void MapMaker<FTYPE>::loadFoFreeFromReflectionsFile(const fs::path& hklin)
if (ix < 0)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Ignoring hkl(" << h << ", " << k << ", " << l << ")" << endl;
continue;
}
......@@ -692,7 +691,7 @@ void MapMaker<FTYPE>::loadFoFreeFromReflectionsFile(const fs::path& hklin)
break;
default:
if (VERBOSE > 1)
if (cif::VERBOSE > 1)
cerr << "Unexpected value in status: '" << flag << "' for hkl(" << h << ", " << k << ", " << l << ")" << endl;
break;
}
......@@ -705,7 +704,7 @@ template<typename FTYPE>
void MapMaker<FTYPE>::loadFoFreeFromMTZFile(const fs::path& hklin,
initializer_list<std::string> foLabels, initializer_list<std::string> freeLabels)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Recalculating maps from " << hklin << endl;
const string kBasePath("/%1%/%2%/[%3%]");
......@@ -761,7 +760,7 @@ void MapMaker<FTYPE>::recalc(const Structure& structure,
clipper::SFcalc_obs_bulk<float> sfcb;
sfcb(mFcData, mFoData, atoms);
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Bulk correction volume: " << sfcb.bulk_frac() << endl
<< "Bulk correction factor: " << sfcb.bulk_scale() << endl;
}
......@@ -775,7 +774,7 @@ void MapMaker<FTYPE>::recalc(const Structure& structure,
else
sfscl(mFcData, mFoData); // scale Fcal
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Anisotropic scaling:" << endl
<< sfscl.u_aniso_orth(F).format() << endl;
}
......@@ -819,7 +818,7 @@ void MapMaker<FTYPE>::recalc(const Structure& structure,
mResLow = res;
}
if (VERBOSE > 1)
if (cif::VERBOSE > 1)
cerr << "calculated reshi = " << mResHigh << " reslo = " << mResLow << endl;
samplingRate /= 2;
......@@ -836,7 +835,7 @@ void MapMaker<FTYPE>::recalc(const Structure& structure,
fdMap.init(spacegroup, cell, mGrid); // define map
fdMap.fft_from(mFdData); // generate map
if (VERBOSE)
if (cif::VERBOSE)
{
cerr << "Read Xmaps with sampling rate: " << samplingRate << endl
<< " resolution: " << mResHigh
......@@ -873,7 +872,7 @@ void MapMaker<FTYPE>::fixMTZ()
// first run the tests to see if we need to fix anything
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Testing MTZ file" << endl;
for (auto ih = mFbData.first(); not ih.last(); ih.next())
......@@ -903,13 +902,13 @@ void MapMaker<FTYPE>::fixMTZ()
if (tests[T10] and abs(FM - FC) > 0.05)
{
tests[T10] = false;
if (VERBOSE) cerr << "Test 10 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test 10 failed at " << ih.hkl() << endl;
}
if (tests[T11] and abs(FD) > 0.05)
{
tests[T11] = false;
if (VERBOSE) cerr << "Test 11 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test 11 failed at " << ih.hkl() << endl;
}
}
else if (cls.centric())
......@@ -917,31 +916,31 @@ void MapMaker<FTYPE>::fixMTZ()
if (tests[C5] and abs(FC + FM - 2 * WFO) > 0.05)
{
tests[C5] = false;
if (VERBOSE) cerr << "Test C5 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test C5 failed at " << ih.hkl() << endl;
}
if (tests[C6] and abs(FM - WFO) > 0.05)
{
tests[C6] = false;
if (VERBOSE) cerr << "Test C6 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test C6 failed at " << ih.hkl() << endl;
}
if (tests[C7] and abs(FC + FD - WFO) > 0.05)
{
tests[C7] = false;
if (VERBOSE) cerr << "Test C7 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test C7 failed at " << ih.hkl() << endl;
}
if (tests[C8] and abs(FC + 0.5 * FD - WFO) > 0.05)
{
tests[C8] = false;
if (VERBOSE) cerr << "Test C8 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test C8 failed at " << ih.hkl() << endl;
}
if (tests[C9] and (1.01 * FC + Gd - WFO) < -0.05)
{
tests[C9] = false;
if (VERBOSE) cerr << "Test C9 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test C9 failed at " << ih.hkl() << endl;
}
}
......@@ -950,25 +949,25 @@ void MapMaker<FTYPE>::fixMTZ()
if (tests[A1] and abs(FC + FM - 2 * WFO) > 0.05)
{
tests[A1] = false;
if (VERBOSE) cerr << "Test A1 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test A1 failed at " << ih.hkl() << endl;
}
if (tests[A2] and 1.01 * FC + FM - 2 * WFO < -0.05)
{
tests[A2] = false;
if (VERBOSE) cerr << "Test A2 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test A2 failed at " << ih.hkl() << endl;
}
if (tests[A3] and abs(FM - FD - WFO) > 0.05)
{
tests[A3] = false;
if (VERBOSE) cerr << "Test A3 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test A3 failed at " << ih.hkl() << endl;
}
if (tests[A4] and abs(FM - 0.5 * FD - WFO) > 0.05)
{
tests[A4] = false;
if (VERBOSE) cerr << "Test A4 failed at " << ih.hkl() << endl;
if (cif::VERBOSE) cerr << "Test A4 failed at " << ih.hkl() << endl;
}
}
}
......
......@@ -22,7 +22,7 @@ namespace ba = boost::algorithm;
namespace fs = boost::filesystem;
namespace io = boost::iostreams;
extern int VERBOSE;
extern int cif::VERBOSE;
namespace mmcif
{
......@@ -72,14 +72,14 @@ void FileImpl::load(fs::path p)
{
try
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "unrecognized file extension, trying cif" << endl;
mData.load(in);
}
catch (const cif::CifParserError& e)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Not cif, trying plain old PDB" << endl;
// pffft...
......@@ -114,7 +114,7 @@ void FileImpl::load(fs::path p)
// if (mData.getValidator() == nullptr)
mData.loadDictionary("mmcif_pdbx");
if (not mData.isValid())
cerr << "Invalid mmCIF file" << (VERBOSE ? "." : " use --verbose option to see errors") << endl;
cerr << "Invalid mmCIF file" << (cif::VERBOSE ? "." : " use --verbose option to see errors") << endl;
}
void FileImpl::save(fs::path p)
......@@ -313,7 +313,7 @@ struct AtomImpl
mCompound = Compound::create(compId);
if (VERBOSE and mCompound == nullptr)
if (cif::VERBOSE and mCompound == nullptr)
cerr << "Compound not found: '" << compId << '\'' << endl;
}
......@@ -587,7 +587,7 @@ void Atom::calculateRadius(float resHigh, float resLow, float perc)
mImpl->mRadius = shape.radius();
// verbose
if (VERBOSE > 1)
if (cif::VERBOSE > 1)
cout << "Calculated radius for " << AtomTypeTraits(mImpl->mType).name() << " with charge " << charge() << " is " << mImpl->mRadius << endl;
}
......@@ -864,7 +864,7 @@ float Monomer::phi() const
}
catch (const exception& ex)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << ex.what() << endl;
}
......@@ -887,7 +887,7 @@ float Monomer::psi() const
}
catch (const exception& ex)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << ex.what() << endl;
}
......@@ -911,7 +911,7 @@ float Monomer::alpha() const
}
catch (const exception& ex)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << ex.what() << endl;
}
......@@ -939,7 +939,7 @@ float Monomer::kappa() const
}
catch (const exception& ex)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "When trying to calculate kappa for " << asymID() << ':' << seqID() << ": "
<< ex.what() << endl;
}
......
......@@ -266,7 +266,7 @@ struct TLSSelectionNot : public TLSSelection
for (auto& r: residues)
r.selected = not r.selected;
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "NOT" << endl;
DumpSelection(residues, indentLevel);
......@@ -285,7 +285,7 @@ struct TLSSelectionAll : public TLSSelection
for (auto& r: residues)
r.selected = true;
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "ALL" << endl;
DumpSelection(residues, indentLevel);
......@@ -305,7 +305,7 @@ struct TLSSelectionChain : public TLSSelectionAll
for (auto& r: residues)
r.selected = allChains or r.chainID == m_chain;
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "CHAIN " << m_chain << endl;
DumpSelection(residues, indentLevel);
......@@ -325,7 +325,7 @@ struct TLSSelectionResID : public TLSSelectionAll
for (auto& r: residues)
r.selected = r.seqNr == m_seq_nr and r.iCode == m_icode;
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "ResID " << m_seq_nr << (m_icode ? string { m_icode} : "") << endl;
DumpSelection(residues, indentLevel);
......@@ -349,7 +349,7 @@ struct TLSSelectionRangeSeq : public TLSSelectionAll
(r.seqNr <= m_last or m_last == kResidueNrWildcard));
}
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "Range " << m_first << ':' << m_last << endl;
DumpSelection(residues, indentLevel);
......@@ -392,7 +392,7 @@ struct TLSSelectionRangeID : public TLSSelectionAll
}
}
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "Through " << m_first << ':' << m_last << endl;
DumpSelection(residues, indentLevel);
......@@ -425,7 +425,7 @@ struct TLSSelectionUnion : public TLSSelection
for (auto ai = a.begin(), bi = b.begin(), ri = residues.begin(); ri != residues.end(); ++ai, ++bi, ++ri)
ri->selected = ai->selected or bi->selected;
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "Union" << endl;
DumpSelection(residues, indentLevel);
......@@ -458,7 +458,7 @@ struct TLSSelectionIntersection : public TLSSelection
for (auto ai = a.begin(), bi = b.begin(), ri = residues.begin(); ri != residues.end(); ++ai, ++bi, ++ri)
ri->selected = ai->selected and bi->selected;
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "Intersection" << endl;
DumpSelection(residues, indentLevel);
......@@ -480,7 +480,7 @@ struct TLSSelectionByName : public TLSSelectionAll
for (auto& r: residues)
r.selected = r.name == m_name;
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "Name " << m_name << endl;
DumpSelection(residues, indentLevel);
......@@ -506,7 +506,7 @@ struct TLSSelectionByElement : public TLSSelectionAll
for (auto& r: residues)
r.selected = iequals(r.name, m_element);
if (VERBOSE)
if (cif::VERBOSE)
{
cout << string(indentLevel * 2, ' ') << "Element " << m_element << endl;
DumpSelection(residues, indentLevel);
......@@ -1051,7 +1051,7 @@ TLSSelectionPtr TLSSelectionParserImplPhenix::ParseFactor()
result.reset(new TLSSelectionRangeID(from, to, icode_from, icode_to));
else
{
if (VERBOSE and (icode_from or icode_to))
if (cif::VERBOSE and (icode_from or icode_to))
cerr << "Warning, ignoring insertion codes" << endl;
result.reset(new TLSSelectionRangeSeq(from, to));
......@@ -1307,7 +1307,7 @@ tuple<string,int> TLSSelectionParserImplBuster::ParseAtom()
Match(':');
string atom = m_value_s;
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Warning: ignoring atom ID '" << atom << "' in TLS selection" << endl;
Match(bt_IDENT);
......@@ -1852,14 +1852,14 @@ TLSSelectionPtr ParseSelectionDetails(const string& program, const string& selec
if (not result)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Falling back to old BUSTER" << endl;
result = busterOld.Parse(selection);
}
if (not result)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Falling back to PHENIX" << endl;
result = phenix.Parse(selection);
}
......@@ -1870,35 +1870,35 @@ TLSSelectionPtr ParseSelectionDetails(const string& program, const string& selec
if (not result)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Falling back to BUSTER" << endl;
result = buster.Parse(selection);
}
if (not result)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Falling back to old BUSTER" << endl;
result = busterOld.Parse(selection);
}
}
else
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "No known program specified, trying PHENIX" << endl;
result = phenix.Parse(selection);
if (not result)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Falling back to BUSTER" << endl;
result = buster.Parse(selection);
}
if (not result)
{
if (VERBOSE)
if (cif::VERBOSE)
cerr << "Falling back to old BUSTER" << endl;
result = busterOld.Parse(selection);
}
......
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