Skip to content

Commit

Permalink
refactor id_str() usage for finding altloc
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissciwilliams committed Sep 20, 2023
1 parent ac174dd commit d89e878
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mmtbx/validation/rna_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,18 +441,17 @@ def show_summary(self, out=sys.stdout, prefix=""):

def local_altloc_from_atoms(self, residue_1_deoxy_ribo_atom_dict, residue_1_c1p_outbound_atom, residue_2_p_atom):
#conformer.altloc masks whether a residue has true alternate conformations
#check atom.parent().altloc for whether any atoms have alt positions
#only run this if conformer.altloc != ''
#atom.id_str() looks like 'pdb=" C1'B G B -3 "' for a B alternate
#this format may change with mmCIF
for atom in [residue_1_c1p_outbound_atom, residue_2_p_atom]:
if atom is None: continue
altloc = atom.id_str()[9:10]
if altloc != " ":
altloc = atom.parent().altloc
if altloc != "":
return altloc
for atom in residue_1_deoxy_ribo_atom_dict.values():
if atom is None: continue
altloc = atom.id_str()[9:10]
if altloc != " ":
altloc = atom.parent().altloc
if altloc != "":
return altloc
return ""

Expand Down

0 comments on commit d89e878

Please sign in to comment.