From: Akash Mondal (akmondal1013_at_gmail.com)
Date: Sat Aug 20 2022 - 01:11:34 CDT

Dear Community,
I wanted to mutate a specific amino acid (AA) residue of a protein. I found
a tcl script in the VMD script library
<https://www.ks.uiuc.edu/Research/vmd/script_library/scripts/mutate_res/> to
do the same and edited according to my requirements. The script is as
follows

package require psfgen

proc mutate_res {pos mut prot} {
# in pdb file $prot.pdb, mutate the residue at position $pos to a
# residue of type $mut
set pos 11
set mut TRP
set prot enzyme-center

set file_in $prot.pdb
set file_tmp $prot.temp.pdb
set file_out_pdb $prot.mut.pdb
set file_out_psf $prot.mut.psf

set str "all and not (resid $pos and sidechain)"

mol new enzyme-center.pdb type pdb

set sel [atomselect top $str]
$sel writepdb $file_tmp

resetpsf

package require psfgen
topology top_all36_prot.rtf
alias residue HIS HSD
alias atom ILE CD1 CD

segment ENZ {
         pdb $file_tmp
         mutate $pos $mut
}
coordpdb $file_tmp ENZ
guesscoord

writepdb $file_out_pdb
writepsf $file_out_psf

mol delete top
mol new $file_out_pdb type pdb
}

So when I call this tcl file in vmd tkconsole, it is not generating
anything.
Can you please let me know what mistake I'm making?

Thank you
Akash