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
fb2ad7b7
Unverified
Commit
fb2ad7b7
authored
Feb 10, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix in REMARK3 parser for more strict mmcif_pdbx dictionary
parent
24aa7a70
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
17 deletions
+35
-17
src/model.cpp
+11
-5
src/pdb/cif2pdb.cpp
+21
-11
src/pdb/pdb2cif_remark_3.cpp
+3
-1
No files found.
src/model.cpp
View file @
fb2ad7b7
...
...
@@ -807,11 +807,17 @@ float monomer::chi(size_t nr) const
atoms
.
back
()
=
"CG2"
;
}
result
=
static_cast
<
float
>
(
dihedral_angle
(
get_atom_by_atom_id
(
atoms
[
nr
+
0
]).
get_location
(),
get_atom_by_atom_id
(
atoms
[
nr
+
1
]).
get_location
(),
get_atom_by_atom_id
(
atoms
[
nr
+
2
]).
get_location
(),
get_atom_by_atom_id
(
atoms
[
nr
+
3
]).
get_location
()));
auto
atom_0
=
get_atom_by_atom_id
(
atoms
[
nr
+
0
]);
auto
atom_1
=
get_atom_by_atom_id
(
atoms
[
nr
+
1
]);
auto
atom_2
=
get_atom_by_atom_id
(
atoms
[
nr
+
2
]);
auto
atom_3
=
get_atom_by_atom_id
(
atoms
[
nr
+
3
]);
if
(
atom_0
and
atom_1
and
atom_2
and
atom_3
)
result
=
static_cast
<
float
>
(
dihedral_angle
(
atom_0
.
get_location
(),
atom_1
.
get_location
(),
atom_2
.
get_location
(),
atom_3
.
get_location
()));
}
}
catch
(
const
std
::
exception
&
e
)
...
...
src/pdb/cif2pdb.cpp
View file @
fb2ad7b7
...
...
@@ -3359,7 +3359,7 @@ std::tuple<int, int> WriteCoordinatesForModel(std::ostream &pdbFile, const datab
auto
&
atom_site_anisotrop
=
db
[
"atom_site_anisotrop"
];
auto
&
entity
=
db
[
"entity"
];
auto
&
pdbx_poly_seq_scheme
=
db
[
"pdbx_poly_seq_scheme"
];
auto
&
pdbx_nonpoly_scheme
=
db
[
"pdbx_nonpoly_scheme"
];
//
auto &pdbx_nonpoly_scheme = db["pdbx_nonpoly_scheme"];
auto
&
pdbx_branch_scheme
=
db
[
"pdbx_branch_scheme"
];
int
serial
=
1
;
...
...
@@ -3434,16 +3434,26 @@ std::tuple<int, int> WriteCoordinatesForModel(std::ostream &pdbFile, const datab
r
.
get
(
"id"
,
"group_PDB"
,
"label_atom_id"
,
"label_alt_id"
,
"auth_comp_id"
,
"auth_asym_id"
,
"auth_seq_id"
,
"pdbx_PDB_ins_code"
,
"Cartn_x"
,
"Cartn_y"
,
"Cartn_z"
,
"occupancy"
,
"B_iso_or_equiv"
,
"type_symbol"
,
"pdbx_formal_charge"
);
int
entity_id
=
r
.
get
<
int
>
(
"label_entity_id"
);
auto
type
=
entity
.
find1
<
std
::
string
>
(
"id"
_key
==
entity_id
,
"type"
);
if
(
type
==
"branched"
)
// find the real auth_seq_num, since sugars have their auth_seq_num reused as sugar number... sigh.
resSeq
=
pdbx_branch_scheme
.
find1
<
int
>
(
"asym_id"
_key
==
r
.
get
<
std
::
string
>
(
"label_asym_id"
)
and
"pdb_seq_num"
_key
==
resSeq
,
"auth_seq_num"
);
// else if (type == "non-polymer") // same for non-polymers
// resSeq = pdbx_nonpoly_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num");
else
if
(
type
==
"polymer"
)
resSeq
=
pdbx_poly_seq_scheme
.
find1
<
int
>
(
"asym_id"
_key
==
r
.
get
<
std
::
string
>
(
"label_asym_id"
)
and
"pdb_seq_num"
_key
==
resSeq
,
"auth_seq_num"
);
if
(
resName
!=
"HOH"
)
{
int
entity_id
=
r
.
get
<
int
>
(
"label_entity_id"
);
try
{
auto
type
=
entity
.
find1
<
std
::
string
>
(
"id"
_key
==
entity_id
,
"type"
);
if
(
type
==
"branched"
)
// find the real auth_seq_num, since sugars have their auth_seq_num reused as sugar number... sigh.
resSeq
=
pdbx_branch_scheme
.
find1
<
int
>
(
"asym_id"
_key
==
r
.
get
<
std
::
string
>
(
"label_asym_id"
)
and
"pdb_seq_num"
_key
==
resSeq
,
"auth_seq_num"
);
// else if (type == "non-polymer") // same for non-polymers
// resSeq = pdbx_nonpoly_scheme.find1<int>("asym_id"_key == r.get<std::string>("label_asym_id") and "pdb_seq_num"_key == resSeq, "auth_seq_num");
else
if
(
type
==
"polymer"
)
resSeq
=
pdbx_poly_seq_scheme
.
find1
<
int
>
(
"asym_id"
_key
==
r
.
get
<
std
::
string
>
(
"label_asym_id"
)
and
"pdb_seq_num"
_key
==
resSeq
,
"auth_seq_num"
);
}
catch
(
const
std
::
exception
&
ex
)
{
std
::
cerr
<<
"Oops, there was not exactly one entity with id "
<<
entity_id
<<
std
::
endl
;
}
}
if
(
chainID
.
length
()
>
1
)
throw
std
::
runtime_error
(
"Chain ID "
+
chainID
+
" won't fit into a PDB file"
);
...
...
src/pdb/pdb2cif_remark_3.cpp
View file @
fb2ad7b7
...
...
@@ -1233,7 +1233,9 @@ void Remark3Parser::storeCapture(const char *category, std::initializer_list<con
{
cat
.
emplace
({
// #warning("crystal id, diffrn id, what should be put here?")
{
"crystal_id"
,
1
},
{
"diffrn_id"
,
1
}
});
{
"diffrn_id"
,
1
},
{
"operator"
,
""
},
{
"fraction"
,
0.
f
}
});
}
else
if
(
iequals
(
category
,
"reflns"
))
cat
.
emplace
({
{
"pdbx_ordinal"
,
cat
.
size
()
+
1
},
...
...
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