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
7a49a6cc
Commit
7a49a6cc
authored
10 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
when making a deep copy, the alternative atom positions should be
handled. This closes BZDNG-56
parent
81b1ace7
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/mol/base/src/impl/chain_impl.cc
+60
-7
60 additions, 7 deletions
modules/mol/base/src/impl/chain_impl.cc
with
60 additions
and
7 deletions
modules/mol/base/src/impl/chain_impl.cc
+
60
−
7
View file @
7a49a6cc
...
@@ -71,15 +71,68 @@ ResidueImplPtr ChainImpl::AppendResidue(const ResidueImplPtr& res, bool deep)
...
@@ -71,15 +71,68 @@ ResidueImplPtr ChainImpl::AppendResidue(const ResidueImplPtr& res, bool deep)
dst_res
->
SetProtein
(
res
->
IsProtein
());
dst_res
->
SetProtein
(
res
->
IsProtein
());
dst_res
->
SetChemType
(
res
->
GetChemType
());
dst_res
->
SetChemType
(
res
->
GetChemType
());
dst_res
->
SetIsLigand
(
res
->
IsLigand
());
dst_res
->
SetIsLigand
(
res
->
IsLigand
());
if
(
deep
)
{
if
(
deep
)
{
AtomImplList
::
iterator
it
=
res
->
GetAtomList
().
begin
(),
AtomImplList
::
iterator
it
=
res
->
GetAtomList
().
begin
(),
it_end
=
res
->
GetAtomList
().
end
();
it_end
=
res
->
GetAtomList
().
end
();
for
(;
it
!=
it_end
;
++
it
)
{
if
(
res
->
HasAltAtoms
()){
AtomHandle
atom
=*
it
;
dst_res
->
InsertAtom
(
atom
.
Impl
());
for
(;
it
!=
it_end
;
++
it
){
AtomImplPtr
atom
=*
it
;
std
::
vector
<
String
>
alt_gn
=
res
->
GetAltAtomGroupNames
(
atom
);
if
(
alt_gn
.
empty
()){
//there are no alternative locations for this atoms =>just add it
dst_res
->
InsertAtom
(
atom
);
}
else
{
AtomImplPtr
dst_atom
;
dst_atom
=
dst_res
->
InsertAltAtom
(
atom
->
GetName
(),
alt_gn
[
0
],
res
->
GetAltAtomPos
(
atom
,
alt_gn
[
0
]),
atom
->
GetElement
(),
res
->
GetAltAtomOcc
(
atom
,
alt_gn
[
0
]),
res
->
GetAltAtomBFactor
(
atom
,
alt_gn
[
0
]));
//in the InsertAltAtom function only name, position and
//element get passed when inserting the actual atom into the residue.
//All the rest we have to map by ourself as we would call the
//dst_res->InsertAtom(atom) function
dst_atom
->
Assign
(
*
atom
.
get
());
dst_atom
->
SetState
(
atom
->
GetState
());
dst_atom
->
SetBFactor
(
atom
->
GetBFactor
());
dst_atom
->
SetOccupancy
(
atom
->
GetOccupancy
());
dst_atom
->
SetHetAtom
(
atom
->
IsHetAtom
());
dst_atom
->
SetIndex
(
atom
->
GetIndex
());
if
(
!
atom
->
HasDefaultProps
())
{
dst_atom
->
SetRadius
(
atom
->
GetRadius
());
dst_atom
->
SetCharge
(
atom
->
GetCharge
());
dst_atom
->
SetMass
(
atom
->
GetMass
());
dst_atom
->
SetAnisou
(
atom
->
GetAnisou
());
}
//the pos for the first alt group name is already added in the
//InsertAltAtom function, all the others get added here
for
(
std
::
vector
<
String
>::
iterator
alt_gn_it
=
alt_gn
.
begin
()
+
1
,
alt_gn_it_e
=
alt_gn
.
end
();
alt_gn_it
!=
alt_gn_it_e
;
++
alt_gn_it
){
dst_res
->
AddAltAtomPos
(
*
alt_gn_it
,
dst_atom
,
res
->
GetAltAtomPos
(
atom
,
*
alt_gn_it
),
res
->
GetAltAtomOcc
(
atom
,
*
alt_gn_it
),
res
->
GetAltAtomBFactor
(
atom
,
*
alt_gn_it
));
}
}
}
}
}
else
{
for
(;
it
!=
it_end
;
++
it
){
dst_res
->
InsertAtom
(
*
it
);
}
}
}
}
return
dst_res
;
return
dst_res
;
}
}
...
...
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