Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
4e15e70b
Commit
4e15e70b
authored
1 year ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
mmcif writer: better checking for valid resnums in resnum based alignments
parent
a7553694
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/io/src/mol/mmcif_writer.cc
+17
-3
17 additions, 3 deletions
modules/io/src/mol/mmcif_writer.cc
with
17 additions
and
3 deletions
modules/io/src/mol/mmcif_writer.cc
+
17
−
3
View file @
4e15e70b
...
...
@@ -559,12 +559,26 @@ namespace {
int
num_mon_ids
=
info
.
mon_ids
.
size
();
for
(
auto
res
:
res_list
)
{
int
num
=
res
.
GetNumber
().
GetNum
();
char
ins_code
=
res
.
GetNumber
().
GetInsCode
();
if
(
num
<
1
)
{
std
::
stringstream
ss
;
ss
<<
"Cannot perform resnum based alignment with invalid resnum in "
;
ss
<<
"residue "
<<
res
;
ss
<<
"Try to construct resnum based alignments. Negative residue "
;
ss
<<
"numbers are not allowed in this case. Got: "
;
ss
<<
num
<<
" in residue "
<<
res
;
ss
<<
". You may set mmcif_conform flag to False to write something "
;
ss
<<
"but be aware of the consequences..."
;
throw
ost
::
io
::
IOException
(
ss
.
str
());
}
else
if
(
num
>
num_mon_ids
)
{
}
if
(
ins_code
!=
'\0'
)
{
std
::
stringstream
ss
;
ss
<<
"Try to construct resnum based alignments. Insertion codes "
;
ss
<<
"are not allowed in this case. Got: "
;
ss
<<
ins_code
<<
" in residue "
<<
res
;
ss
<<
". You may set mmcif_conform flag to False to write something "
;
ss
<<
"but be aware of the consequences..."
;
throw
ost
::
io
::
IOException
(
ss
.
str
());
}
if
(
num
>
num_mon_ids
)
{
++
n_beyond
;
}
else
{
if
(
info
.
mon_ids
[
num
-
1
]
==
"-"
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment