Commit c5d277fb by maarten

refactored main using nested exceptions, fixed PDB parser a bit

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@180 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent d0b7e21c
/*
Created by: Maarten L. Hekkelman
Date: dinsdag 07 november, 2017
Copyright 2017 NKI AVL
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <vector>
#include <string>
#include <tuple>
#include "cif++/Cif++.h"
namespace cif
{
extern const int
kResidueNrWildcard,
kNoSeqNum;
struct TLSSelection;
typedef std::unique_ptr<TLSSelection> TLSSelectionPtr;
struct TLSResidue;
struct TLSSelection
{
virtual ~TLSSelection() {}
virtual void CollectResidues(cif::Datablock& db, std::vector<TLSResidue>& residues, int indentLevel = 0) const = 0;
std::vector<std::tuple<std::string,int,int>> GetRanges(cif::Datablock& db, bool pdbNamespace) const;
};
// Low level: get the selections
TLSSelectionPtr ParseSelectionDetails(const std::string& program, const std::string& selection);
}
...@@ -1773,7 +1773,7 @@ Row& Row::operator=(const Row& rhs) ...@@ -1773,7 +1773,7 @@ Row& Row::operator=(const Row& rhs)
void Row::assign(const string& name, const string& value, bool emplacing) void Row::assign(const string& name, const string& value, bool emplacing)
{ {
if (mData == nullptr) if (mData == nullptr)
throw logic_error("invalid Row, no data"); throw logic_error("invalid Row, no data assigning value '" + value + "' to " + name);
auto cat = mData->mCategory; auto cat = mData->mCategory;
auto cix = cat->addColumn(name); auto cix = cat->addColumn(name);
...@@ -1905,7 +1905,7 @@ bool Row::empty() const ...@@ -1905,7 +1905,7 @@ bool Row::empty() const
auto Row::begin() const -> const_iterator auto Row::begin() const -> const_iterator
{ {
return const_iterator(mData, mData->mValues); return const_iterator(mData, mData ? mData->mValues : nullptr);
} }
auto Row::end() const -> const_iterator auto Row::end() const -> const_iterator
......
...@@ -264,6 +264,7 @@ const Compound* CompoundFactory::create(std::string id) ...@@ -264,6 +264,7 @@ const Compound* CompoundFactory::create(std::string id)
value = 1.5; value = 1.5;
else else
{ {
if (VERBOSE)
cerr << "Unimplemented chem_comp_bond.type " << type << " in file " << resFile << endl; cerr << "Unimplemented chem_comp_bond.type " << type << " in file " << resFile << endl;
value = 1.0; value = 1.0;
} }
......
...@@ -978,7 +978,10 @@ float Remark3Parser::parse() ...@@ -978,7 +978,10 @@ float Remark3Parser::parse()
} }
if (not remarks.empty() and not iequals(remarks, "NULL")) if (not remarks.empty() and not iequals(remarks, "NULL"))
{
if (not mDb["refine"].empty())
mDb["refine"].front()["details"] = remarks; mDb["refine"].front()["details"] = remarks;
}
float score = float(lineCount - dropped) / lineCount; float score = float(lineCount - dropped) / lineCount;
......
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