From 358a3355fac813da1bfab509aea15c85c4282683 Mon Sep 17 00:00:00 2001 From: Shintaro Minami Date: Fri, 4 Aug 2023 16:00:52 -0700 Subject: [PATCH] fix bug pdb_selaltloc.py --- pdbtools/pdb_selaltloc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pdbtools/pdb_selaltloc.py b/pdbtools/pdb_selaltloc.py index 70676721..ab3e6cd4 100644 --- a/pdbtools/pdb_selaltloc.py +++ b/pdbtools/pdb_selaltloc.py @@ -150,7 +150,7 @@ def select_altloc(fhandle, selloc=None, byocc=False): prev_altloc = '' prev_resname = '' - prev_resnum = '' + prev_resnum = -float('inf') # uses the same function names in the loop below. However, depending # on the input options, the functions used are different. One is @@ -170,7 +170,7 @@ def select_altloc(fhandle, selloc=None, byocc=False): # captures the relevant parameters altloc = line[16] resname = line[17:20] - resnum = line[22:26].strip() + resnum = int(line[22:26].strip()) if is_another_altloc_group( altloc, prev_altloc, resnum, prev_resnum, @@ -219,14 +219,14 @@ def select_altloc(fhandle, selloc=None, byocc=False): prev_altloc = '' prev_resname = '' - prev_resnum = '' + prev_resnum = -float('inf') yield line # the terminator line else: prev_altloc = '' prev_resname = '' - prev_resnum = '' + prev_resnum = -float('inf') yield line # end of for loop