From: Joaquim Rui de Castro Rodrigues (joaquim.rodrigues_at_ipleiria.pt)
Date: Fri Sep 21 2012 - 13:04:59 CDT

Hi,

You want to prepend C (or N) to *each* element of list rnmC (or rnmN). This should do the job:
set newrnmC [list]
foreach res $rnmC {
  lappend newrnmC "C$res"
}
$Cter set resname $newrnmC

Hope this helps,
Rui Rodrigues

________________________________________
De: owner-vmd-l_at_ks.uiuc.edu [owner-vmd-l_at_ks.uiuc.edu] Em Nome De Martin, Erik W [Erik.Martin_at_stjude.org]
Enviado: sexta-feira, 21 de Setembro de 2012 16:23
Para: vmd-l_at_ks.uiuc.edu
Assunto: vmd-l: changing name of N and C term residues

I wanted to append "N" and "C" to these renames and was going about it this way:

set temp [atomselect top "protein and chain A"]
set resnum [llength [lsort -unique [$temp get resid]]]
set Cter [atomselect top "resid $resnum"]
set rnmC [$Cter get resname]
set Nter [atomselect top "resid 1"]
set rnmN [$Nter get resname]
$Cter set resname "C$rnmC"
$Nter set resname "N$rnmN"

Yet, for some reason this only renames the first atom of the residue… can anyone tell me what the problem is? I'm at a loss… (or if there's an easier way to do this)

Thanks a lot,
Erik

________________________________
Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer