|
From: sunyeping <sun...@al...> - 2022-07-07 13:12:41
|
Dear all,
I want to label residues with the resn+resi, and I tried the following command
one_letter ={'VAL':'V', 'ILE':'I', 'LEU':'L', 'GLU':'E', 'GLN':'Q', \
'ASP':'D', 'ASN':'N', 'HIS':'H', 'TRP':'W', 'PHE':'F', 'TYR':'Y', \
'ARG':'R', 'LYS':'K', 'SER':'S', 'THR':'T', 'MET':'M', 'ALA':'A', \
'GLY':'G', 'PRO':'P', 'CYS':'C'}
select CAs, obj & n. CAs
label CAs, "%s%s" % (one_letter[resn],resi)
These work find. However, when I write these in a script and the last two commands are written as:
cmd.select('CAs', 'obj & n. CAs')
cmd.label('CAs', "%s%s" % (one_letter[resn],resi))
it gives the following error:
NameError: name 'resn' is not defined
So could anyone tell me how to correctly use the cmd.label command?
Thank you very much in advance
|