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
b9544033
Unverified
Commit
b9544033
authored
Jul 01, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix reconstruction
parent
17840cb8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
src/pdb/reconstruct.cpp
+23
-8
No files found.
src/pdb/reconstruct.cpp
View file @
b9544033
...
@@ -822,6 +822,18 @@ void createEntityPoly(datablock &db)
...
@@ -822,6 +822,18 @@ void createEntityPoly(datablock &db)
non_std_monomer
=
true
;
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
())
if
(
type
.
empty
())
type
=
c_type
;
type
=
c_type
;
...
@@ -888,7 +900,7 @@ void createEntityPoly(datablock &db)
...
@@ -888,7 +900,7 @@ void createEntityPoly(datablock &db)
void
createEntityPolySeq
(
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
);
createEntityPoly
(
db
);
using
namespace
literals
;
using
namespace
literals
;
...
@@ -939,7 +951,10 @@ void createEntityPolySeq(datablock &db)
...
@@ -939,7 +951,10 @@ void createEntityPolySeq(datablock &db)
void
createPdbxPolySeqScheme
(
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
);
createEntityPolySeq
(
db
);
using
namespace
literals
;
using
namespace
literals
;
...
@@ -1076,7 +1091,7 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
...
@@ -1076,7 +1091,7 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
// ... and any additional datablock will contain compound information
// ... and any additional datablock will contain compound information
cif
::
compound_source
cs
(
file
);
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"
);
throw
std
::
runtime_error
(
"Cannot reconstruct PDBx file, atom data missing"
);
auto
&
validator
=
validator_factory
::
instance
()[
dictionary
];
auto
&
validator
=
validator_factory
::
instance
()[
dictionary
];
...
@@ -1084,7 +1099,7 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
...
@@ -1084,7 +1099,7 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
std
::
string
entry_id
;
std
::
string
entry_id
;
// Phenix files do not have an entry record
// 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
();
entry_id
=
db
.
name
();
category
entry
(
"entry"
);
category
entry
(
"entry"
);
...
@@ -1338,19 +1353,19 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
...
@@ -1338,19 +1353,19 @@ bool reconstruct_pdbx(file &file, std::string_view dictionary)
// Now create any missing categories
// Now create any missing categories
// Next make sure we have struct_asym records
// 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
);
createStructAsym
(
db
);
if
(
db
.
get
(
"entity"
)
==
nullptr
)
if
(
auto
cat
=
db
.
get
(
"entity"
);
cat
==
nullptr
or
cat
->
empty
()
)
createEntity
(
db
);
createEntity
(
db
);
// fill in missing formula_weight, e.g.
// fill in missing formula_weight, e.g.
checkEntities
(
db
);
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
);
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
);
comparePolySeqSchemes
(
db
);
// skip unknown categories for now
// 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