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
b3496f4e
Unverified
Commit
b3496f4e
authored
Jan 03, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes in pdbx validation, compound one letter code
parent
e866228a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
src/compound.cpp
+6
-1
src/pdb/validate-pdbx.cpp
+14
-3
No files found.
src/compound.cpp
View file @
b3496f4e
...
...
@@ -136,9 +136,14 @@ compound::compound(cif::datablock &db)
if
(
chemComp
.
size
()
!=
1
)
throw
std
::
runtime_error
(
"Invalid compound file, chem_comp should contain a single row"
);
cif
::
tie
(
m_id
,
m_name
,
m_type
,
m_formula
,
m_formula_weight
,
m_formal_charge
,
m_one_letter_code
,
m_parent_id
)
=
std
::
string
one_letter_code
;
cif
::
tie
(
m_id
,
m_name
,
m_type
,
m_formula
,
m_formula_weight
,
m_formal_charge
,
one_letter_code
,
m_parent_id
)
=
chemComp
.
front
().
get
(
"id"
,
"name"
,
"type"
,
"formula"
,
"formula_weight"
,
"pdbx_formal_charge"
,
"one_letter_code"
,
"mon_nstd_parent_comp_id"
);
if
(
one_letter_code
.
length
()
==
1
)
m_one_letter_code
=
one_letter_code
.
front
();
// The name should not contain newline characters since that triggers validation errors later on
cif
::
replace_all
(
m_name
,
"
\n
"
,
""
);
...
...
src/pdb/validate-pdbx.cpp
View file @
b3496f4e
...
...
@@ -188,7 +188,7 @@ bool is_valid_pdbx_file(const file &file, std::string_view dictionary)
}
}
const
auto
&
[
seq
,
seq_can
]
=
entity_poly
.
find1
<
std
::
optional
<
std
::
string
>
,
std
::
optional
<
std
::
string
>>
(
"entity_id"
_key
==
entity_id
,
auto
&
&
[
seq
,
seq_can
]
=
entity_poly
.
find1
<
std
::
optional
<
std
::
string
>
,
std
::
optional
<
std
::
string
>>
(
"entity_id"
_key
==
entity_id
,
"pdbx_seq_one_letter_code"
,
"pdbx_seq_one_letter_code_can"
);
std
::
string
::
const_iterator
si
,
sci
,
se
,
sce
;
...
...
@@ -245,18 +245,29 @@ bool is_valid_pdbx_file(const file &file, std::string_view dictionary)
if
(
cif
::
VERBOSE
>
0
)
std
::
clog
<<
"Warning: entity_poly has no sequence for entity_id "
<<
entity_id
<<
'\n'
;
}
else
if
(
not
seq_match
(
false
,
seq
->
begin
(),
seq
->
end
()))
else
{
seq
->
erase
(
std
::
remove_if
(
seq
->
begin
(),
seq
->
end
(),
[](
char
ch
)
{
return
std
::
isspace
(
ch
);
}),
seq
->
end
());
if
(
not
seq_match
(
false
,
seq
->
begin
(),
seq
->
end
()))
throw
validation_error
(
"Sequences do not match for entity "
+
entity_id
);
}
if
(
not
seq_can
.
has_value
())
{
if
(
cif
::
VERBOSE
>
0
)
std
::
clog
<<
"Warning: entity_poly has no sequence for entity_id "
<<
entity_id
<<
'\n'
;
}
else
if
(
not
seq_match
(
true
,
seq_can
->
begin
(),
seq_can
->
end
()))
else
{
seq_can
->
erase
(
std
::
remove_if
(
seq_can
->
begin
(),
seq_can
->
end
(),
[](
char
ch
)
{
return
std
::
isspace
(
ch
);
}),
seq_can
->
end
());
if
(
not
seq_match
(
true
,
seq_can
->
begin
(),
seq_can
->
end
()))
throw
validation_error
(
"Canonical sequences do not match for entity "
+
entity_id
);
}
}
result
=
true
;
}
catch
(
const
std
::
exception
&
ex
)
...
...
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