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
a9e9f86c
Unverified
Commit
a9e9f86c
authored
Aug 16, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renaming internal use of mmcif_pdbx dictionary. It was wrong to use the name mmcif_pdbx_v50
parent
a2c52713
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
30 additions
and
32 deletions
+30
-32
CMakeLists.txt
+2
-2
examples/example.cpp
+0
-1
include/cif++/structure/Compound.hpp
+1
-1
rsrc/mmcif_pdbx.dic
+0
-0
src/Cif++.cpp
+1
-1
src/cif/file.cpp
+7
-6
src/pdb/PDB2Cif.cpp
+3
-2
src/structure/Compound.cpp
+1
-1
src/structure/Structure.cpp
+1
-1
test/dssp-test.cpp
+2
-5
test/rename-compound-test.cpp
+2
-2
test/structure-test.cpp
+4
-4
test/sugar-test.cpp
+1
-1
test/unit-test.cpp
+2
-2
test/unit-v2-test.cpp
+1
-1
tools/update-dictionary-script
+1
-1
tools/update-libcifpp-data.in
+1
-1
No files found.
CMakeLists.txt
View file @
a9e9f86c
...
...
@@ -362,7 +362,7 @@ install(
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ddl.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_pdbx
_v50
.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_pdbx.dic
${
COMPONENTS_CIF
}
DESTINATION
${
SHARE_INSTALL_DIR
}
)
...
...
@@ -435,7 +435,7 @@ if(CIFPP_BUILD_TESTS)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp::cifpp Boost::boost
)
if
(
CIFPP_USE_RSRC
)
mrc_target_resources
(
${
CIFPP_TEST
}
${
CMAKE_SOURCE_DIR
}
/rsrc/mmcif_pdbx
_v50
.dic
)
mrc_target_resources
(
${
CIFPP_TEST
}
${
CMAKE_SOURCE_DIR
}
/rsrc/mmcif_pdbx.dic
)
endif
()
if
(
MSVC
)
...
...
examples/example.cpp
View file @
a9e9f86c
...
...
@@ -8,7 +8,6 @@ namespace fs = std::filesystem;
int
main
()
{
cif
::
file
file
;
file
.
load_dictionary
(
"mmcif_pdbx_v50"
);
file
.
load
(
"1cbs.cif.gz"
);
auto
&
db
=
file
.
front
();
...
...
include/cif++/structure/Compound.hpp
View file @
a9e9f86c
...
...
@@ -46,7 +46,7 @@ class Compound;
struct
CompoundAtom
;
class
CompoundFactoryImpl
;
/// \brief The bond type as defined in the CCD, possible values taken from the mmcif_pdbx
_v50
file
/// \brief The bond type as defined in the CCD, possible values taken from the mmcif_pdbx file
enum
class
BondType
{
sing
,
// 'single bond'
...
...
rsrc/mmcif_pdbx
_v50
.dic
→
rsrc/mmcif_pdbx.dic
View file @
a9e9f86c
File moved
src/Cif++.cpp
View file @
a9e9f86c
...
...
@@ -1798,7 +1798,7 @@ auto Category::erase(iterator pos) -> iterator
}
// links are created based on the _pdbx_item_linked_group_list entries
// in mmcif_pdbx
_v50
.dic dictionary.
// in mmcif_pdbx.dic dictionary.
//
// For each link group in _pdbx_item_linked_group_list
// a std::set of keys from one category is mapped to another.
...
...
src/cif/file.cpp
View file @
a9e9f86c
...
...
@@ -61,7 +61,8 @@ bool file::is_valid()
load_dictionary
();
}
bool
result
=
true
;
bool
result
=
not
empty
();
for
(
auto
&
d
:
*
this
)
result
=
d
.
is_valid
()
and
result
;
...
...
@@ -76,9 +77,10 @@ void file::load_dictionary()
if
(
audit_conform
and
not
audit_conform
->
empty
())
{
std
::
string
name
;
cif
::
tie
(
name
)
=
audit_conform
->
front
().
get
(
"name"
);
cif
::
tie
(
name
)
=
audit_conform
->
front
().
get
(
"
dict_
name"
);
load_dictionary
(
name
);
if
(
not
name
.
empty
())
load_dictionary
(
name
);
}
}
...
...
@@ -158,10 +160,9 @@ void file::load(std::istream &is)
p
.
parse_file
();
if
(
saved
!=
nullptr
)
{
set_validator
(
saved
);
(
void
)
is_valid
();
}
else
load_dictionary
();
}
void
file
::
save
(
const
std
::
filesystem
::
path
&
p
)
const
...
...
src/pdb/PDB2Cif.cpp
View file @
a9e9f86c
...
...
@@ -6055,10 +6055,11 @@ void ReadPDBFile(std::istream &pdbFile, cif::File &cifFile)
{
PDBFileParser
p
;
cifFile
.
loadDictionary
(
"mmcif_pdbx_v50"
);
p
.
Parse
(
pdbFile
,
cifFile
);
cifFile
.
loadDictionary
(
"mmcif_pdbx"
);
if
(
not
cifFile
.
isValid
()
and
cif
::
VERBOSE
>=
0
)
std
::
cerr
<<
"Resulting mmCIF file is not valid!"
<<
std
::
endl
;
}
src/structure/Compound.cpp
View file @
a9e9f86c
...
...
@@ -416,7 +416,7 @@ CompoundFactoryImpl::CompoundFactoryImpl(const fs::path &file, std::shared_ptr<C
else
{
// A CCD components file, validate it first
cifFile
.
load_dictionary
(
"mmcif_pdbx
_v50
"
);
cifFile
.
load_dictionary
(
"mmcif_pdbx"
);
if
(
not
cifFile
.
is_valid
())
throw
std
::
runtime_error
(
"Invalid compound file"
);
...
...
src/structure/Structure.cpp
View file @
a9e9f86c
...
...
@@ -1297,7 +1297,7 @@ void File::load(const std::filesystem::path &path)
cif
::
File
::
load
(
in
);
// validate, otherwise lots of functionality won't work
loadDictionary
(
"mmcif_pdbx
_v50
"
);
loadDictionary
(
"mmcif_pdbx"
);
if
(
not
isValid
()
and
cif
::
VERBOSE
>=
0
)
std
::
cerr
<<
"Invalid mmCIF file"
<<
(
cif
::
VERBOSE
>
0
?
"."
:
" use --verbose option to see errors"
)
<<
std
::
endl
;
}
...
...
test/dssp-test.cpp
View file @
a9e9f86c
...
...
@@ -64,7 +64,7 @@ bool init_unit_test()
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
// do this now, avoids the need for installing
cif
::
add_file_resource
(
"mmcif_pdbx
_v50.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50
.dic"
);
cif
::
add_file_resource
(
"mmcif_pdbx
.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx
.dic"
);
// initialize CCD location
cif
::
add_file_resource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
...
...
@@ -76,12 +76,9 @@ bool init_unit_test()
BOOST_AUTO_TEST_CASE
(
dssp_1
)
{
// using namespace mmcif;
cif
::
file
f
(
gTestDir
/
"1cbs.cif"
);
f
.
load_dictionary
(
"mmcif_pdbx_v50"
);
BOOST_
CHECK
(
f
.
is_valid
());
BOOST_
ASSERT
(
f
.
is_valid
());
std
::
ifstream
t
(
gTestDir
/
"1cbs-dssp-test.tsv"
);
...
...
test/rename-compound-test.cpp
View file @
a9e9f86c
...
...
@@ -19,8 +19,8 @@ int main(int argc, char* argv[])
if
(
std
::
filesystem
::
exists
(
testdir
/
".."
/
"data"
/
"ccd-subset.cif"
))
cif
::
add_file_resource
(
"components.cif"
,
testdir
/
".."
/
"data"
/
"ccd-subset.cif"
);
if
(
std
::
filesystem
::
exists
(
testdir
/
".."
/
"rsrc"
/
"mmcif_pdbx
_v50
.dic"
))
cif
::
add_file_resource
(
"mmcif_pdbx
_v50.dic"
,
testdir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50
.dic"
);
if
(
std
::
filesystem
::
exists
(
testdir
/
".."
/
"rsrc"
/
"mmcif_pdbx.dic"
))
cif
::
add_file_resource
(
"mmcif_pdbx
.dic"
,
testdir
/
".."
/
"rsrc"
/
"mmcif_pdbx
.dic"
);
mmcif
::
CompoundFactory
::
instance
().
pushDictionary
(
testdir
/
"REA.cif"
);
mmcif
::
CompoundFactory
::
instance
().
pushDictionary
(
testdir
/
"RXA.cif"
);
...
...
test/structure-test.cpp
View file @
a9e9f86c
...
...
@@ -61,7 +61,7 @@ bool init_unit_test()
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
// do this now, avoids the need for installing
cif
::
add_file_resource
(
"mmcif_pdbx
_v50.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50
.dic"
);
cif
::
add_file_resource
(
"mmcif_pdbx
.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx
.dic"
);
// initialize CCD location
cif
::
add_file_resource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
...
...
@@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(create_nonpoly_1)
cif
::
VERBOSE
=
1
;
mmcif
::
File
file
;
file
.
loadDictionary
(
"mmcif_pdbx
_v50
.dic"
);
file
.
loadDictionary
(
"mmcif_pdbx.dic"
);
file
.
emplace
(
"TEST"
);
// create a datablock
mmcif
::
Structure
structure
(
file
);
...
...
@@ -180,7 +180,7 @@ _struct_asym.details ?
#
)"
_cf
;
expected
.
loadDictionary
(
"mmcif_pdbx
_v50
.dic"
);
expected
.
loadDictionary
(
"mmcif_pdbx.dic"
);
if
(
not
(
expected
.
firstDatablock
()
==
structure
.
datablock
()))
{
...
...
@@ -280,7 +280,7 @@ _struct_asym.details ?
#
)"
_cf
;
data
.
loadDictionary
(
"mmcif_pdbx
_v50
.dic"
);
data
.
loadDictionary
(
"mmcif_pdbx.dic"
);
mmcif
::
Structure
s
(
data
);
...
...
test/sugar-test.cpp
View file @
a9e9f86c
...
...
@@ -61,7 +61,7 @@ bool init_unit_test()
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
// do this now, avoids the need for installing
cif
::
add_file_resource
(
"mmcif_pdbx
_v50.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50
.dic"
);
cif
::
add_file_resource
(
"mmcif_pdbx
.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx
.dic"
);
// initialize CCD location
cif
::
add_file_resource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
...
...
test/unit-test.cpp
View file @
a9e9f86c
...
...
@@ -67,7 +67,7 @@ bool init_unit_test()
gTestDir
=
boost
::
unit_test
::
framework
::
master_test_suite
().
argv
[
1
];
// do this now, avoids the need for installing
cif
::
add_file_resource
(
"mmcif_pdbx
_v50.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx_v50
.dic"
);
cif
::
add_file_resource
(
"mmcif_pdbx
.dic"
,
gTestDir
/
".."
/
"rsrc"
/
"mmcif_pdbx
.dic"
);
// initialize CCD location
cif
::
add_file_resource
(
"components.cif"
,
gTestDir
/
".."
/
"data"
/
"ccd-subset.cif"
);
...
...
@@ -295,7 +295,6 @@ save__cat_2.desc
cif
::
Validator
validator
(
"test"
,
is_dict
);
cif
::
File
f
;
f
.
setValidator
(
&
validator
);
// --------------------------------------------------------------------
...
...
@@ -327,6 +326,7 @@ _cat_2.desc
std
::
istream
is_data
(
&
data_buffer
);
f
.
load
(
is_data
);
f
.
setValidator
(
&
validator
);
auto
&
cat1
=
f
.
firstDatablock
()[
"cat_1"
];
auto
&
cat2
=
f
.
firstDatablock
()[
"cat_2"
];
...
...
test/unit-v2-test.cpp
View file @
a9e9f86c
...
...
@@ -69,7 +69,7 @@ bool init_unit_test()
// gTestDir = boost::unit_test::framework::master_test_suite().argv[1];
// // do this now, avoids the need for installing
// cif::add_file_resource("mmcif_pdbx
_v50.dic", gTestDir / ".." / "rsrc" / "mmcif_pdbx_v50
.dic");
// cif::add_file_resource("mmcif_pdbx
.dic", gTestDir / ".." / "rsrc" / "mmcif_pdbx
.dic");
// // initialize CCD location
// cif::add_file_resource("components.cif", gTestDir / ".." / "data" / "ccd-subset.cif");
...
...
tools/update-dictionary-script
View file @
a9e9f86c
...
...
@@ -43,7 +43,7 @@ fetch_dictionary () {
# fetch the dictionaries
fetch_dictionary
"/var/cache/libcifpp/mmcif_pdbx
_v50
.dic"
"https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz"
fetch_dictionary
"/var/cache/libcifpp/mmcif_pdbx.dic"
"https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz"
fetch_dictionary
"/var/cache/libcifpp/components.cif"
"ftp://ftp.wwpdb.org/pub/pdb/data/monomers/components.cif.gz"
# this one is not compressed
...
...
tools/update-libcifpp-data.in
View file @
a9e9f86c
...
...
@@ -43,7 +43,7 @@ fetch_dictionary () {
# fetch the dictionaries
fetch_dictionary
"@CIFPP_CACHE_DIR@/mmcif_pdbx
_v50
.dic"
"https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz"
fetch_dictionary
"@CIFPP_CACHE_DIR@/mmcif_pdbx.dic"
"https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz"
fetch_dictionary
"@CIFPP_CACHE_DIR@/components.cif"
"ftp://ftp.wwpdb.org/pub/pdb/data/monomers/components.cif.gz"
# notify subscribers
...
...
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