From: Marcos Sotomayor (
Date: Mon Aug 28 2006 - 10:55:50 CDT

I put below a script that will load the structure in VMD, create a
selection of the "protein" you want to delete, then load psf and pdb file
in psfgen, and finally remove the protein and save the new psf/pdb files.
Let me know if you have any questions.


In the tkcon type (or source a file containing the script; note that you
need to change some variables and the location of your topology file,
which may not be needed actually)

set psffile yourpsf.psf
set pdbfile yourpdb.pdb
set prefix youroutput

mol load psf $psffile pdb $pdbfile

set prot [atomselect top "protein"]
set notprot [atomselect top "not protein"]

package require psfgen
topology ../../toppar2/top_all22_prot_cmap.inp
readpsf $psffile
coordpdb $pdbfile
foreach seg [$prot get segname] res [$prot get resid] {
         delatom $seg $res
writepsf $prefix.psf
writepdb $prefix.pdb

On Fri, 25 Aug 2006, Thomas Caulfield wrote:

> Hello All:
> Does anyone have a handy script that can remove a particular molecule from a
> psf & pdb and resave the psf and pdb? I tried using tkCON, but it only made
> a list of the bonds, and skipped the angels, dihedrals, etc.
> Thanks,
> -Tom
> ****************************************
> Tom Caulfield, Ph.D. Candidate
> School of Chemistry & Biochemistry
> Cherry Emerson Bldg., RM 329
> Georgia Institute
> of Technology
> Atlanta, GA 30332-0400
> ****************************************