mirror of
https://github.com/PDB-REDO/libcifpp.git
synced 2026-06-04 13:54:25 +08:00
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
This commit is contained in:
55
include/cif++/TlsParser.h
Normal file
55
include/cif++/TlsParser.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
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)
|
||||
void Row::assign(const string& name, const string& value, bool emplacing)
|
||||
{
|
||||
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 cix = cat->addColumn(name);
|
||||
@@ -1905,7 +1905,7 @@ bool Row::empty() const
|
||||
|
||||
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
|
||||
|
||||
@@ -264,7 +264,8 @@ const Compound* CompoundFactory::create(std::string id)
|
||||
value = 1.5;
|
||||
else
|
||||
{
|
||||
cerr << "Unimplemented chem_comp_bond.type " << type << " in file " << resFile << endl;
|
||||
if (VERBOSE)
|
||||
cerr << "Unimplemented chem_comp_bond.type " << type << " in file " << resFile << endl;
|
||||
value = 1.0;
|
||||
}
|
||||
|
||||
|
||||
1991
src/PDB2Cif.cpp
1991
src/PDB2Cif.cpp
File diff suppressed because it is too large
Load Diff
@@ -978,7 +978,10 @@ float Remark3Parser::parse()
|
||||
}
|
||||
|
||||
if (not remarks.empty() and not iequals(remarks, "NULL"))
|
||||
mDb["refine"].front()["details"] = remarks;
|
||||
{
|
||||
if (not mDb["refine"].empty())
|
||||
mDb["refine"].front()["details"] = remarks;
|
||||
}
|
||||
|
||||
float score = float(lineCount - dropped) / lineCount;
|
||||
|
||||
|
||||
1913
src/TlsParser.cpp
Normal file
1913
src/TlsParser.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user