This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def renum_pdb_str(pdb_str, Ls=None, renum=True, offset=1): | |
from string import ascii_uppercase, ascii_lowercase | |
assert len(Ls) == 2 | |
Ls = [int(i) for i in Ls] | |
alphabet_list = list(ascii_uppercase+ascii_lowercase) | |
if Ls is not None: | |
L_init = 0 | |
new_chain = {} | |
for L,c in zip(Ls, alphabet_list): | |
new_chain.update({i:c for i in range(L_init,L_init+L)}) |