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
6d0ea5c6
Unverified
Commit
6d0ea5c6
authored
Nov 21, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop using CCP4 monomers library
version bump
parent
dbe40e3a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
14 deletions
+58
-14
CMakeLists.txt
+1
-1
changelog
+3
-0
include/cif++/compound.hpp
+3
-11
include/cif++/utilities.hpp
+16
-0
src/compound.cpp
+0
-0
src/parser.cpp
+4
-1
src/pdb/pdb2cif.cpp
+1
-1
src/utilities.cpp
+21
-0
test/unit-v2-test.cpp
+9
-0
No files found.
CMakeLists.txt
View file @
6d0ea5c6
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
cmake_minimum_required
(
VERSION 3.16
)
cmake_minimum_required
(
VERSION 3.16
)
# set the project name
# set the project name
project
(
libcifpp VERSION
5.2.5
LANGUAGES CXX
)
project
(
libcifpp VERSION
6.0.0
LANGUAGES CXX
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
list
(
PREPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
...
...
changelog
View file @
6d0ea5c6
Version
6.0.0
-
Drop
the
use
of
CCP4
's monomer library for compound information
Version 5.2.5
Version 5.2.5
- Correctly import the Eigen3 library
- Correctly import the Eigen3 library
...
...
include/cif++/compound.hpp
View file @
6d0ea5c6
...
@@ -44,11 +44,7 @@
...
@@ -44,11 +44,7 @@
/// The data is loaded by default from a file called `components.cif`. This file
/// The data is loaded by default from a file called `components.cif`. This file
/// is located using load_resource. (See documentation on cif::load_resource for more information)
/// is located using load_resource. (See documentation on cif::load_resource for more information)
///
///
/// But if the CCP4 environment is available at runtime, the compound information
/// Note that since version 6 the CCP4 monomer library is no longer used.
/// may also be generated from the CCP4 monomer library.
///
/// Note that the information in CCP4 and CCD is not equal.
///
/// See also :doc:`/compound` for more information.
/// See also :doc:`/compound` for more information.
...
@@ -157,10 +153,6 @@ class compound
...
@@ -157,10 +153,6 @@ class compound
float
formula_weight
()
const
{
return
m_formula_weight
;
}
///< Return the formula mass of the chemical component in Daltons.
float
formula_weight
()
const
{
return
m_formula_weight
;
}
///< Return the formula mass of the chemical component in Daltons.
int
formal_charge
()
const
{
return
m_formal_charge
;
}
///< Return the formal charge on the chemical component.
int
formal_charge
()
const
{
return
m_formal_charge
;
}
///< Return the formal charge on the chemical component.
/// The group record is only available in CCP4 monomer library files.
/// For CCD entries this value will always contain 'non-polymer'
std
::
string
group
()
const
{
return
m_group
;
}
const
std
::
vector
<
compound_atom
>
&
atoms
()
const
{
return
m_atoms
;
}
///< Return the list of atoms for this compound
const
std
::
vector
<
compound_atom
>
&
atoms
()
const
{
return
m_atoms
;
}
///< Return the list of atoms for this compound
const
std
::
vector
<
compound_bond
>
&
bonds
()
const
{
return
m_bonds
;
}
///< Return the list of bonds for this compound
const
std
::
vector
<
compound_bond
>
&
bonds
()
const
{
return
m_bonds
;
}
///< Return the list of bonds for this compound
...
@@ -176,8 +168,6 @@ class compound
...
@@ -176,8 +168,6 @@ class compound
private
:
private
:
friend
class
compound_factory_impl
;
friend
class
compound_factory_impl
;
friend
class
CCD_compound_factory_impl
;
friend
class
CCP4_compound_factory_impl
;
compound
(
cif
::
datablock
&
db
);
compound
(
cif
::
datablock
&
db
);
compound
(
cif
::
datablock
&
db
,
const
std
::
string
&
id
,
const
std
::
string
&
name
,
const
std
::
string
&
type
,
const
std
::
string
&
group
);
compound
(
cif
::
datablock
&
db
,
const
std
::
string
&
id
,
const
std
::
string
&
name
,
const
std
::
string
&
type
,
const
std
::
string
&
group
);
...
@@ -246,6 +236,8 @@ class compound_factory
...
@@ -246,6 +236,8 @@ class compound_factory
CIFPP_EXPORT
static
const
std
::
map
<
std
::
string
,
char
>
kAAMap
,
///< Globally accessible static list of the default amino acids
CIFPP_EXPORT
static
const
std
::
map
<
std
::
string
,
char
>
kAAMap
,
///< Globally accessible static list of the default amino acids
kBaseMap
;
///< Globally accessible static list of the default bases
kBaseMap
;
///< Globally accessible static list of the default bases
void
report_missing_compound
(
const
std
::
string
&
compound_id
);
private
:
private
:
compound_factory
();
compound_factory
();
...
...
include/cif++/utilities.hpp
View file @
6d0ea5c6
...
@@ -366,6 +366,14 @@ std::unique_ptr<std::istream> load_resource(std::filesystem::path name);
...
@@ -366,6 +366,14 @@ std::unique_ptr<std::istream> load_resource(std::filesystem::path name);
void
add_file_resource
(
const
std
::
string
&
name
,
std
::
filesystem
::
path
dataFile
);
void
add_file_resource
(
const
std
::
string
&
name
,
std
::
filesystem
::
path
dataFile
);
/**
/**
* @brief List all the file resources added with cif::add_file_resource.
*
* @param os The std::ostream to write the directories to
*/
void
list_file_resources
(
std
::
ostream
&
os
);
/**
* @brief Add a directory to the list of search directories. This list is
* @brief Add a directory to the list of search directories. This list is
* searched in a last-in-first-out order.
* searched in a last-in-first-out order.
*
*
...
@@ -379,4 +387,12 @@ void add_file_resource(const std::string &name, std::filesystem::path dataFile);
...
@@ -379,4 +387,12 @@ void add_file_resource(const std::string &name, std::filesystem::path dataFile);
void
add_data_directory
(
std
::
filesystem
::
path
dataDir
);
void
add_data_directory
(
std
::
filesystem
::
path
dataDir
);
/**
* @brief List all the data directories, for error reporting on missing resources.
*
* @param os The std::ostream to write the directories to
*/
void
list_data_directories
(
std
::
ostream
&
os
);
}
// namespace cif
}
// namespace cif
src/compound.cpp
View file @
6d0ea5c6
This diff is collapsed.
Click to expand it.
src/parser.cpp
View file @
6d0ea5c6
...
@@ -608,6 +608,9 @@ sac_parser::datablock_index sac_parser::index_datablocks()
...
@@ -608,6 +608,9 @@ sac_parser::datablock_index sac_parser::index_datablocks()
std
::
string
::
size_type
si
=
0
;
std
::
string
::
size_type
si
=
0
;
std
::
string
datablock
;
std
::
string
datablock
;
// Seek to beginning of file
m_source
.
pubseekpos
(
0
);
for
(
auto
ch
=
m_source
.
sbumpc
();
ch
!=
std
::
streambuf
::
traits_type
::
eof
();
ch
=
m_source
.
sbumpc
())
for
(
auto
ch
=
m_source
.
sbumpc
();
ch
!=
std
::
streambuf
::
traits_type
::
eof
();
ch
=
m_source
.
sbumpc
())
{
{
switch
(
state
)
switch
(
state
)
...
@@ -667,7 +670,7 @@ sac_parser::datablock_index sac_parser::index_datablocks()
...
@@ -667,7 +670,7 @@ sac_parser::datablock_index sac_parser::index_datablocks()
case
data_name
:
case
data_name
:
if
(
is_non_blank
(
ch
))
if
(
is_non_blank
(
ch
))
datablock
.
insert
(
datablock
.
end
(),
cha
r
(
ch
));
datablock
.
insert
(
datablock
.
end
(),
(
char
)
std
::
touppe
r
(
ch
));
else
if
(
is_space
(
ch
))
else
if
(
is_space
(
ch
))
{
{
if
(
not
datablock
.
empty
())
if
(
not
datablock
.
empty
())
...
...
src/pdb/pdb2cif.cpp
View file @
6d0ea5c6
...
@@ -5146,7 +5146,7 @@ void PDBFileParser::ParseConnectivtyAnnotation()
...
@@ -5146,7 +5146,7 @@ void PDBFileParser::ParseConnectivtyAnnotation()
getCategory
(
"struct_conn"
)
->
emplace
({
getCategory
(
"struct_conn"
)
->
emplace
({
{
"id"
,
type
+
std
::
to_string
(
linkNr
)
},
{
"id"
,
type
+
std
::
to_string
(
linkNr
)
},
{
"conn_type_id"
,
type
},
{
"conn_type_id"
,
type
},
// { "ccp4_link_id", ccp4LinkID },
// { "ccp4_link_id", ccp4LinkID },
...
...
src/utilities.cpp
View file @
6d0ea5c6
...
@@ -845,6 +845,9 @@ class resource_pool
...
@@ -845,6 +845,9 @@ class resource_pool
std
::
unique_ptr
<
std
::
istream
>
load
(
fs
::
path
name
);
std
::
unique_ptr
<
std
::
istream
>
load
(
fs
::
path
name
);
const
auto
data_directories
()
{
return
mDirs
;
}
const
auto
file_resources
()
{
return
mLocalResources
;
}
private
:
private
:
resource_pool
();
resource_pool
();
...
@@ -937,4 +940,22 @@ std::unique_ptr<std::istream> load_resource(std::filesystem::path name)
...
@@ -937,4 +940,22 @@ std::unique_ptr<std::istream> load_resource(std::filesystem::path name)
return
resource_pool
::
instance
().
load
(
name
);
return
resource_pool
::
instance
().
load
(
name
);
}
}
void
list_file_resources
(
std
::
ostream
&
os
)
{
auto
&
file_resources
=
resource_pool
::
instance
().
file_resources
();
if
(
not
file_resources
.
empty
())
{
os
<<
"
\n
The following named resources were loaded:
\n
"
;
for
(
const
auto
&
[
name
,
path
]
:
file_resources
)
os
<<
name
<<
" -> "
<<
std
::
quoted
(
path
.
string
())
<<
'\n'
;
}
}
void
list_data_directories
(
std
::
ostream
&
os
)
{
for
(
auto
&
p
:
resource_pool
::
instance
().
data_directories
())
os
<<
p
<<
'\n'
;
}
}
// namespace cif
}
// namespace cif
test/unit-v2-test.cpp
View file @
6d0ea5c6
...
@@ -3483,3 +3483,11 @@ ATOM 7 CD PRO A 1 15.762 13.216 43.724 1.00 30.71 C)"
...
@@ -3483,3 +3483,11 @@ ATOM 7 CD PRO A 1 15.762 13.216 43.724 1.00 30.71 C)"
auto
f
=
cif
::
pdb
::
read
(
is
);
auto
f
=
cif
::
pdb
::
read
(
is
);
}
}
// --------------------------------------------------------------------
BOOST_AUTO_TEST_CASE
(
compound_not_found_test_1
)
{
auto
cmp
=
cif
::
compound_factory
::
instance
().
create
(
"&&&"
);
BOOST_CHECK
(
cmp
==
nullptr
);
}
\ No newline at end of file
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