Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
96a67b23
Unverified
Commit
96a67b23
authored
Nov 01, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix loading dictionaries
parent
f84d83b7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
6 deletions
+26
-6
CMakeLists.txt
+1
-1
changelog
+3
-0
src/compound.cpp
+1
-1
src/file.cpp
+4
-1
src/pdb/pdb2cif.cpp
+1
-1
src/validate.cpp
+15
-1
test/model-test.cpp
+1
-1
No files found.
CMakeLists.txt
View file @
96a67b23
...
...
@@ -25,7 +25,7 @@
cmake_minimum_required
(
VERSION 3.16
)
# set the project name
project
(
cifpp VERSION 5.0.
0
LANGUAGES CXX
)
project
(
cifpp VERSION 5.0.
1
LANGUAGES CXX
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
...
...
changelog
View file @
96a67b23
Version
5.0.1
-
Fix
loading
dictionaries
Version
5.0.0
-
Total
rewrite
of
cif
part
-
Removed
DSSP
code
,
moved
into
dssp
project
itself
...
...
src/compound.cpp
View file @
96a67b23
...
...
@@ -414,7 +414,7 @@ compound_factory_impl::compound_factory_impl(const fs::path &file, std::shared_p
else
{
// A CCD components file, validate it first
cifFile
.
load_dictionary
(
"mmcif_pdbx"
);
cifFile
.
load_dictionary
(
"mmcif_pdbx
.dic
"
);
if
(
not
cifFile
.
is_valid
())
throw
std
::
runtime_error
(
"Invalid compound file"
);
...
...
src/file.cpp
View file @
96a67b23
...
...
@@ -97,6 +97,9 @@ void file::load_dictionary()
{
std
::
string
name
=
audit_conform
->
front
().
get
<
std
::
string
>
(
"dict_name"
);
if
(
name
==
"mmcif_pdbx_v50"
)
name
=
"mmcif_pdbx.dic"
;
// we had a bug here in libcifpp...
if
(
not
name
.
empty
())
{
try
...
...
@@ -113,7 +116,7 @@ void file::load_dictionary()
}
if
(
not
m_validator
)
load_dictionary
(
"mmcif_
ddl"
);
load_dictionary
(
"mmcif_
pdbx.dic"
);
// TODO: maybe incorrect? Perhaps improve?
}
void
file
::
load_dictionary
(
std
::
string_view
name
)
...
...
src/pdb/pdb2cif.cpp
View file @
96a67b23
...
...
@@ -6182,7 +6182,7 @@ void ReadPDBFile(std::istream &pdbFile, cif::file &cifFile)
{
PDBFileParser
p
;
cifFile
.
load_dictionary
(
"mmcif_pdbx"
);
cifFile
.
load_dictionary
(
"mmcif_pdbx
.dic
"
);
p
.
Parse
(
pdbFile
,
cifFile
);
...
...
src/validate.cpp
View file @
96a67b23
...
...
@@ -411,11 +411,25 @@ const validator &validator_factory::operator[](std::string_view dictionary_name)
return
validator
;
}
// not found,
add it
// not found,
try to see if it helps if we tweak the name a little
// too bad clang version 10 did not have a constructor for std::filesystem::path that accepts a std::string_view
std
::
filesystem
::
path
dictionary
(
dictionary_name
.
data
(),
dictionary_name
.
data
()
+
dictionary_name
.
length
());
if
(
dictionary
.
extension
()
!=
".dic"
)
{
auto
dict_name
=
dictionary
.
filename
().
string
()
+
".dic"
;
for
(
auto
&
validator
:
m_validators
)
{
if
(
iequals
(
validator
.
name
(),
dict_name
))
return
validator
;
}
}
// not found, add it
auto
data
=
load_resource
(
dictionary_name
);
if
(
not
data
and
dictionary
.
extension
().
string
()
!=
".dic"
)
...
...
test/model-test.cpp
View file @
96a67b23
...
...
@@ -106,7 +106,7 @@ _atom_site.pdbx_formal_charge
# that's enough to test with
)"
_cf
;
atoms
.
load_dictionary
(
"mmcif_pdbx"
);
atoms
.
load_dictionary
(
"mmcif_pdbx
.dic
"
);
auto
&
hem_data
=
atoms
[
"HEM"
];
auto
&
atom_site
=
hem_data
[
"atom_site"
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment