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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
88fd1fd1
Commit
88fd1fd1
authored
Mar 11, 2013
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Fixing PDBize
parent
103cf37e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/io/pymod/__init__.py
+94
-89
94 additions, 89 deletions
modules/io/pymod/__init__.py
modules/io/tests/test_io_mmcif.py
+1
-1
1 addition, 1 deletion
modules/io/tests/test_io_mmcif.py
with
95 additions
and
90 deletions
modules/io/pymod/__init__.py
+
94
−
89
View file @
88fd1fd1
...
...
@@ -357,14 +357,25 @@ def _PDBize(biounit, asu, seqres=None, min_polymer_size=10,
return
atom_pos_wrong
chain_names
=
'
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz
'
cur_chain_name
=
0
water_chain
=
mol
.
ChainHandle
()
ligand_chain
=
mol
.
ChainHandle
()
a_pos_wrong
=
False
pdb_bu
=
mol
.
CreateEntity
()
edi
=
pdb_bu
.
EditXCS
(
mol
.
BUFFERED_EDIT
)
chains
=
biounit
.
GetChainList
()
c_intvls
=
biounit
.
GetChainIntervalList
()
o_intvls
=
biounit
.
GetOperationsIntervalList
()
# create list of operations
# for cartesian products, operations are stored in a list, multiplied with
# the next list of operations and re-stored... until all lists of operations
# are multiplied in an all-against-all manner.
operations
=
biounit
.
GetOperations
()
for
i
in
range
(
0
,
len
(
c_intvls
)):
trans_matrices
=
list
()
if
len
(
operations
)
>
0
:
for
op
in
operations
[
0
]:
l_operations
=
operations
[
o_intvls
[
i
][
0
]:
o_intvls
[
i
][
1
]]
if
len
(
l_operations
)
>
0
:
for
op
in
l_operations
[
0
]:
rot
=
geom
.
Mat4
()
rot
.
PasteRotation
(
op
.
rotation
)
trans
=
geom
.
Mat4
()
...
...
@@ -372,9 +383,9 @@ def _PDBize(biounit, asu, seqres=None, min_polymer_size=10,
tr
=
geom
.
Mat4
()
tr
=
trans
*
rot
trans_matrices
.
append
(
tr
)
for
op_n
in
range
(
1
,
len
(
operations
)):
for
op_n
in
range
(
1
,
len
(
l_
operations
)):
tmp_ops
=
list
()
for
o
in
operations
[
op_n
]:
for
o
in
l_
operations
[
op_n
]:
rot
=
geom
.
Mat4
()
rot
.
PasteRotation
(
o
.
rotation
)
trans
=
geom
.
Mat4
()
...
...
@@ -386,15 +397,9 @@ def _PDBize(biounit, asu, seqres=None, min_polymer_size=10,
tmp_ops
.
append
(
tp
)
trans_matrices
=
tmp_ops
# select chains into a view as basis for each transformation
assu
=
asu
.
Select
(
'
cname=
'
+
'
,
'
.
join
(
biounit
.
GetChainList
()
))
assu
=
asu
.
Select
(
'
cname=
'
+
'
,
'
.
join
(
chains
[
c_intvls
[
i
][
0
]:
c_intvls
[
i
][
1
]]
))
# use each transformation on the view, store as entity and transform, PDBize
# the result while adding everything to one large entity
pdb_bu
=
mol
.
CreateEntity
()
edi
=
pdb_bu
.
EditXCS
(
mol
.
BUFFERED_EDIT
)
cur_chain_name
=
0
water_chain
=
mol
.
ChainHandle
()
ligand_chain
=
mol
.
ChainHandle
()
a_pos_wrong
=
False
for
tr
in
trans_matrices
:
# do a PDBize, add each new entity to the end product
for
chain
in
assu
.
chains
:
...
...
...
...
This diff is collapsed.
Click to expand it.
modules/io/tests/test_io_mmcif.py
+
1
−
1
View file @
88fd1fd1
...
...
@@ -201,7 +201,7 @@ class TestMMCifInfo(unittest.TestCase):
pdb_ent
,
t
=
info
.
GetBioUnits
()[
0
].
PDBize
(
ent
,
transformation
=
True
)
self
.
assertAlmostEquals
(
pdb_ent
.
GetCenterOfAtoms
()[
0
],
-
915.8
,
1
)
self
.
assertAlmostEquals
(
pdb_ent
.
GetCenterOfAtoms
()[
1
],
-
952.345
,
2
)
self
.
assertAlmostEquals
(
pdb_ent
.
GetCenterOfAtoms
()[
2
],
3221.7
4
,
2
)
self
.
assertAlmostEquals
(
pdb_ent
.
GetCenterOfAtoms
()[
2
],
3221.7
5
,
2
)
self
.
assertEquals
(
geom
.
Equal
(
t
,
geom
.
Mat4
(
1
,
0
,
0
,
-
920.462
,
0
,
1
,
0
,
-
966.654
,
...
...
...
...
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
sign in
to comment