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
6cf9d55f
Commit
6cf9d55f
authored
12 years ago
by
Bienchen
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfix-1.2.3' into develop
parents
127bcc69
7640c993
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.txt
+6
-1
6 additions, 1 deletion
CHANGELOG.txt
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
modules/io/src/mol/pdb_writer.cc
+15
-0
15 additions, 0 deletions
modules/io/src/mol/pdb_writer.cc
modules/io/tests/test_io_pdb.cc
+18
-0
18 additions, 0 deletions
modules/io/tests/test_io_pdb.cc
with
40 additions
and
2 deletions
CHANGELOG.txt
+
6
−
1
View file @
6cf9d55f
Changes in Release 1.2.2
Changes In Release 1.2.3
--------------------------------------------------------------------------------
* PDBWriter: Prevent writing of out-of-bounds atom coordinates.
Changes in Release 1.2.2
--------------------------------------------------------------------------------
* Fixed loop indentation in the PDBize function for bio units, leading to
* Fixed loop indentation in the PDBize function for bio units, leading to
exponential running time/ memory consumption. This problem only affected a
exponential running time/ memory consumption. This problem only affected a
fraction of PDB entries.
fraction of PDB entries.
...
...
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
1
−
1
View file @
6cf9d55f
...
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
...
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
project
(
OpenStructure CXX C
)
project
(
OpenStructure CXX C
)
set
(
OST_VERSION_MAJOR 1
)
set
(
OST_VERSION_MAJOR 1
)
set
(
OST_VERSION_MINOR 2
)
set
(
OST_VERSION_MINOR 2
)
set
(
OST_VERSION_PATCH
2
)
set
(
OST_VERSION_PATCH
3
)
set
(
OST_VERSION_STRING
${
OST_VERSION_MAJOR
}
.
${
OST_VERSION_MINOR
}
.
${
OST_VERSION_PATCH
}
)
set
(
OST_VERSION_STRING
${
OST_VERSION_MAJOR
}
.
${
OST_VERSION_MINOR
}
.
${
OST_VERSION_PATCH
}
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
PROJECT_SOURCE_DIR
}
/cmake_support
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
PROJECT_SOURCE_DIR
}
/cmake_support
)
include
(
OST
)
include
(
OST
)
...
...
This diff is collapsed.
Click to expand it.
modules/io/src/mol/pdb_writer.cc
+
15
−
0
View file @
6cf9d55f
...
@@ -69,6 +69,15 @@ bool shift_left(const String& atom_name, bool is_hetatm,
...
@@ -69,6 +69,15 @@ bool shift_left(const String& atom_name, bool is_hetatm,
element
==
"MG"
||
element
==
"LI"
);
element
==
"MG"
||
element
==
"LI"
);
}
}
bool
atom_pos_ok
(
geom
::
Vec3
p
)
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
p
[
i
]
<=-
1000
||
p
[
i
]
>=
10000
)
{
return
false
;
}
}
return
true
;
}
void
write_atom
(
std
::
ostream
&
ostr
,
FormattedLine
&
line
,
void
write_atom
(
std
::
ostream
&
ostr
,
FormattedLine
&
line
,
const
mol
::
AtomHandle
&
atom
,
int
atomnum
,
const
mol
::
AtomHandle
&
atom
,
int
atomnum
,
bool
is_pqr
,
bool
charmm_style
)
bool
is_pqr
,
bool
charmm_style
)
...
@@ -132,6 +141,9 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
...
@@ -132,6 +141,9 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
// deal with alternative atom locations
// deal with alternative atom locations
if
(
names
.
empty
())
{
if
(
names
.
empty
())
{
if
(
!
atom_pos_ok
(
p
))
{
throw
IOException
(
"Atom position outside of bounds supported by PDB format"
);
}
line
(
30
,
8
)
=
fmt
::
LPaddedFloat
(
p
[
0
],
3
);
line
(
30
,
8
)
=
fmt
::
LPaddedFloat
(
p
[
0
],
3
);
line
(
38
,
8
)
=
fmt
::
LPaddedFloat
(
p
[
1
],
3
);
line
(
38
,
8
)
=
fmt
::
LPaddedFloat
(
p
[
1
],
3
);
line
(
46
,
8
)
=
fmt
::
LPaddedFloat
(
p
[
2
],
3
);
line
(
46
,
8
)
=
fmt
::
LPaddedFloat
(
p
[
2
],
3
);
...
@@ -162,6 +174,9 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
...
@@ -162,6 +174,9 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
p
=
atom
.
GetEntity
().
GetTransform
().
Apply
(
atom
.
GetAltPos
(
*
i
));
p
=
atom
.
GetEntity
().
GetTransform
().
Apply
(
atom
.
GetAltPos
(
*
i
));
line
(
30
,
50
).
Clear
();
line
(
30
,
50
).
Clear
();
if
(
!
atom_pos_ok
(
p
))
{
throw
IOException
(
"Atom position outside of bounds supported by PDB format"
);
}
if
(
i
->
size
()
>
1
)
{
if
(
i
->
size
()
>
1
)
{
throw
IOException
(
"Alternative atom indicator '"
+
atom
.
GetQualifiedName
()
+
throw
IOException
(
"Alternative atom indicator '"
+
atom
.
GetQualifiedName
()
+
"("
+*
i
+
")' too long for PDB output. At most 1 "
"("
+*
i
+
")' too long for PDB output. At most 1 "
...
...
This diff is collapsed.
Click to expand it.
modules/io/tests/test_io_pdb.cc
+
18
−
0
View file @
6cf9d55f
...
@@ -1035,6 +1035,24 @@ BOOST_AUTO_TEST_CASE(test_pqr_read_atom)
...
@@ -1035,6 +1035,24 @@ BOOST_AUTO_TEST_CASE(test_pqr_read_atom)
BOOST_CHECK_CLOSE
(
a2
.
GetRadius
(),
Real
(
1.7503
),
Real
(
1e-4
));
BOOST_CHECK_CLOSE
(
a2
.
GetRadius
(),
Real
(
1.7503
),
Real
(
1e-4
));
}
}
BOOST_AUTO_TEST_CASE
(
checks_for_atom_pos_overflow
)
{
std
::
stringstream
out
;
PDBWriter
writer
(
out
,
IOProfile
());
writer
.
SetIsPQR
(
true
);
mol
::
EntityHandle
ent
=
mol
::
CreateEntity
();
mol
::
XCSEditor
edi
=
ent
.
EditXCS
();
mol
::
ChainHandle
ch
=
edi
.
InsertChain
(
"A"
);
mol
::
ResidueHandle
r
=
edi
.
AppendResidue
(
ch
,
"GLY"
);
mol
::
AtomHandle
a
=
edi
.
InsertAtom
(
r
,
"CA"
,
geom
::
Vec3
(
0
,
-
1000
,
0
),
"C"
);
BOOST_CHECK_THROW
(
writer
.
Write
(
ent
),
IOException
);
edi
.
SetAtomPos
(
a
,
geom
::
Vec3
(
10000
,
0
,
0
));
BOOST_CHECK_THROW
(
writer
.
Write
(
ent
),
IOException
);
}
BOOST_AUTO_TEST_CASE
(
test_pqr_write_atom
)
BOOST_AUTO_TEST_CASE
(
test_pqr_write_atom
)
{
{
std
::
stringstream
out
;
std
::
stringstream
out
;
...
...
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