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
12f78739
Commit
12f78739
authored
14 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
fix pdb output for alt atom locations
parent
619babe6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/io/src/mol/pdb_writer.cc
+2
-1
2 additions, 1 deletion
modules/io/src/mol/pdb_writer.cc
modules/io/tests/test_io_pdb.cc
+25
-0
25 additions, 0 deletions
modules/io/tests/test_io_pdb.cc
with
27 additions
and
1 deletion
modules/io/src/mol/pdb_writer.cc
+
2
−
1
View file @
12f78739
...
...
@@ -136,7 +136,8 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
}
else
{
for
(
std
::
vector
<
String
>::
const_iterator
i
=
names
.
begin
(),
e
=
names
.
end
();
i
!=
e
;
++
i
)
{
p
=
atom
.
GetAltPos
(
*
i
);
geom
::
Mat4
tf
=
atom
.
GetEntity
().
GetTransformationMatrix
();
p
=
geom
::
Vec3
(
tf
*
geom
::
Vec4
(
atom
.
GetAltPos
(
*
i
)));
line
(
30
,
50
).
Clear
();
if
(
i
->
size
()
>
1
)
{
...
...
This diff is collapsed.
Click to expand it.
modules/io/tests/test_io_pdb.cc
+
25
−
0
View file @
12f78739
...
...
@@ -364,6 +364,31 @@ BOOST_AUTO_TEST_CASE(write_conect)
"testfiles/pdb/conect-out.pdb"
));
}
BOOST_AUTO_TEST_CASE
(
alt_loc_tf
)
{
String
fname
(
"testfiles/pdb/alt-loc.pdb"
);
// this scope is required to force the writer stream to be closed before
// opening the file again in compare_files. Avoids a race condition.
mol
::
EntityHandle
ent
=
mol
::
CreateEntity
();
PDBReader
reader
(
fname
);
reader
.
Import
(
ent
);
String
out_name
(
"testfiles/pdb/alt-loc-tf-out.pdb"
);
{
PDBWriter
writer
(
out_name
);
geom
::
Mat4
shift
;
shift
.
PasteTranslation
(
geom
::
Vec3
(
10
,
20
,
30
));
ent
.
RequestXCSEditor
().
ApplyTransform
(
shift
);
writer
.
Write
(
ent
);
}
PDBReader
r2
(
out_name
);
mol
::
EntityHandle
ent2
=
mol
::
CreateEntity
();
r2
.
Import
(
ent2
);
mol
::
ResidueHandle
res1
=
ent2
.
FindResidue
(
"A"
,
mol
::
ResNum
(
1
));
mol
::
AtomHandle
a1
=
res1
.
FindAtom
(
"N"
);
BOOST_CHECK_EQUAL
(
res1
.
GetAltAtomPos
(
a1
,
"A"
),
geom
::
Vec3
(
26
,
84
,
30
));
BOOST_CHECK_EQUAL
(
res1
.
GetAltAtomPos
(
a1
,
"B"
),
geom
::
Vec3
(
18
,
-
108
,
30
));
}
BOOST_AUTO_TEST_CASE
(
res_name_too_long
)
{
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