Skip to content
Snippets Groups Projects
Commit 31b48b44 authored by marco's avatar marco
Browse files

improve RepresentativeAtoms

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2679 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent a0993008
No related branches found
No related tags found
No related merge requests found
......@@ -69,14 +69,12 @@ def RepresentativeAtoms(ent, chain=None, alpha_and_beta=False):
If chain is not equal to None, only atoms of the chain with that chain name
will be added to the view.
"""
if isinstance(ent,mol.EntityHandle):
e_view = ent.CreateEmptyView()
elif isinstance(ent,mol.EntityView):
e_view = ent.GetHandle().CreateEmptyView()
e_view=ent.CreateEmptyView()
if ent.IsValid():
# all chains:
if chain==None:
for res in ent.residues:
res=res.handle
if res.IsPeptideLinking():
atom = res.FindAtom('CB')
if atom.IsValid():
......@@ -99,7 +97,8 @@ def RepresentativeAtoms(ent, chain=None, alpha_and_beta=False):
elif chain != "" and ent.FindChain(chain).IsValid():
for res in ent.FindChain(chain).GetResidueList():
if res.IsPeptideLinking():
res=res.handle
if res.IsPeptideLinking():
atom = res.FindAtom('CB')
if atom.IsValid():
e_view.AddAtom(atom)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment