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
25c900c3
Unverified
Commit
25c900c3
authored
Jul 16, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:PDB-REDO/libcifpp into develop
parents
4e95f7b8
66ad3b0c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
10 deletions
+50
-10
CMakeLists.txt
+2
-0
rsrc/mmcif_pdbx.dic
+0
-0
src/datablock.cpp
+1
-0
src/file.cpp
+24
-2
src/pdb/reconstruct.cpp
+23
-8
No files found.
CMakeLists.txt
View file @
25c900c3
...
...
@@ -256,6 +256,8 @@ if(CIFPP_RECREATE_SYMOP_DATA)
add_executable
(
symop-map-generator
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/symop-map-generator.cpp"
)
target_compile_features
(
symop-map-generator PUBLIC cxx_std_20
)
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/symop_table_data.hpp
COMMAND
...
...
rsrc/mmcif_pdbx.dic
View file @
25c900c3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/datablock.cpp
View file @
25c900c3
...
...
@@ -49,6 +49,7 @@ void datablock::set_validator(const validator *v)
}
catch
(
const
std
::
exception
&
)
{
m_validator
=
nullptr
;
throw_with_nested
(
std
::
runtime_error
(
"Error while setting validator in datablock "
+
m_name
));
}
}
...
...
src/file.cpp
View file @
25c900c3
...
...
@@ -31,11 +31,32 @@ namespace cif
{
// --------------------------------------------------------------------
// TODO: This is wrong. A validator should be assigned to datablocks,
// not to a file. Since audit_conform is a category specifying the
// content of a datablock. Not the entire file.
void
file
::
set_validator
(
const
validator
*
v
)
{
m_validator
=
v
;
for
(
auto
&
db
:
*
this
)
for
(
bool
first
=
true
;
auto
&
db
:
*
this
)
{
try
{
db
.
set_validator
(
v
);
}
catch
(
const
std
::
exception
&
e
)
{
if
(
first
)
throw
;
// Accept failure on secondary datablocks
// now that many mmCIF files have invalid
// restraint data concatenated.
std
::
cerr
<<
e
.
what
()
<<
'\n'
;
}
first
=
false
;
}
}
bool
file
::
is_valid
()
const
...
...
@@ -125,7 +146,8 @@ void file::load_dictionary(std::string_view name)
bool
file
::
contains
(
std
::
string_view
name
)
const
{
return
std
::
find_if
(
begin
(),
end
(),
[
name
](
const
datablock
&
db
)
{
return
iequals
(
db
.
name
(),
name
);
})
!=
end
();
return
std
::
find_if
(
begin
(),
end
(),
[
name
](
const
datablock
&
db
)
{
return
iequals
(
db
.
name
(),
name
);
})
!=
end
();
}
datablock
&
file
::
operator
[](
std
::
string_view
name
)
...
...
src/pdb/reconstruct.cpp
View file @
25c900c3
...
...
@@ -822,6 +822,18 @@ void createEntityPoly(datablock &db)
non_std_monomer
=
true
;
}
else
{
// c_type = "other";
letter_can
=
c
->
one_letter_code
();
if
(
letter_can
==
0
)
letter_can
=
'X'
;
letter
=
'('
+
comp_id
+
')'
;
non_std_monomer
=
true
;
}
if
(
type
.
empty
())
type
=
c_type
;
...
...
@@ -888,7 +900,7 @@ void createEntityPoly(datablock &db)
void
createEntityPolySeq
(
datablock
&
db
)
{
if
(
db
.
get
(
"entity_poly"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"entity_poly"
);
cat
==
nullptr
or
cat
->
empty
()
)
createEntityPoly
(
db
);
using
namespace
literals
;
...
...
@@ -939,7 +951,10 @@ void createEntityPolySeq(datablock &db)
void
createPdbxPolySeqScheme
(
datablock
&
db
)
{
if
(
db
.
get
(
"entity_poly_seq"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"entity_poly"
);
cat
==
nullptr
or
cat
->
empty
())
createEntityPoly
(
db
);
if
(
auto
cat
=
db
.
get
(
"entity_poly_seq"
);
cat
==
nullptr
or
cat
->
empty
())
createEntityPolySeq
(
db
);
using
namespace
literals
;
...
...
@@ -1076,7 +1091,7 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
// ... and any additional datablock will contain compound information
cif
::
compound_source
cs
(
file
);
if
(
db
.
get
(
"atom_site"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"atom_site"
);
cat
==
nullptr
or
cat
->
empty
()
)
throw
std
::
runtime_error
(
"Cannot reconstruct PDBx file, atom data missing"
);
auto
&
validator
=
validator_factory
::
instance
()[
dictionary
];
...
...
@@ -1084,7 +1099,7 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
std
::
string
entry_id
;
// Phenix files do not have an entry record
if
(
db
.
get
(
"entry"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"entry"
);
cat
==
nullptr
or
cat
->
empty
()
)
{
entry_id
=
db
.
name
();
category
entry
(
"entry"
);
...
...
@@ -1338,19 +1353,19 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
// Now create any missing categories
// Next make sure we have struct_asym records
if
(
db
.
get
(
"struct_asym"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"struct_asym"
);
cat
==
nullptr
or
cat
->
empty
()
)
createStructAsym
(
db
);
if
(
db
.
get
(
"entity"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"entity"
);
cat
==
nullptr
or
cat
->
empty
()
)
createEntity
(
db
);
// fill in missing formula_weight, e.g.
checkEntities
(
db
);
if
(
db
.
get
(
"pdbx_poly_seq_scheme"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"pdbx_poly_seq_scheme"
);
cat
==
nullptr
or
cat
->
empty
()
)
createPdbxPolySeqScheme
(
db
);
if
(
db
.
get
(
"ndb_poly_seq_scheme"
)
!=
nullptr
)
if
(
auto
cat
=
db
.
get
(
"ndb_poly_seq_scheme"
);
cat
==
nullptr
or
cat
->
empty
()
)
comparePolySeqSchemes
(
db
);
// skip unknown categories for now
...
...
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