From: Bassam Haddad (bhaddad_at_pdx.edu)
Date: Mon Jul 20 2020 - 12:58:36 CDT

Hi William,

While there is probably a better way to grep/glob the filenames from the
TK-Console, I have found input files containing a list of file names and
parameters helpful for this.

Below is a script I have for automating RMSD calculations of multiple
systems...

*proc autormsd {in} {*

* set infile [open $in r] set inread [read
-nonewline $infile] set inputs [split $inread "\n"]
 close $infile ## The input file will contain the: CryoEM
.psf/.pdb, .psf/.dcd, OUT ## The input file indeces:
           0 1 2 set
m 0 foreach line $inputs { mol new
[lindex $line 0].psf mol addfile [lindex $line 0].pdb
               mol new [lindex $line 1].psf mol
addfile [lindex $line 1].dcd waitfor all align $m
[expr $m + 1] run [lindex $line 2] animate delete all
               set m [expr $m + 2] } }*

Where the input file is just a text file with the lines containing the
information denoted in the script. You could generate an input file with
`ls *files* > input.txt` and modify the above script to just load the
pdb's, or what have you.

Hopefully, this is helpful!

Bassam

On Mon, Jul 20, 2020 at 10:49 AM William Howe <howew_at_mail.gvsu.edu> wrote:

> Hi, I'm new to TCL language, but have some experience with Python. I
> am wondering what would the TCL script be to iterate over a directory
> containing PDB files and create a binding pocket for each file
> iterated over.
>
> I know in VMD Graphical Representation I could use the atomselect
> command 'protein and within 4 of resname LIG', and then save
> coordinates to create a pdb file of the pocket but I would like to
> automate this process for several dozen pdb files I am working with.
>
> Say I have a Folder of PDB Files, here is the input and the desired
> output(output name should be in the same format):
> Receptor1.pdb --> Receptor1 Partial Pocket.pdb
> Receptor2.pdb --> Receptor2 Partial Pocket.pdb
> Receptor3.pdb --> Receptor3 Partial Pocket.pdb
>
> Heres the directory I'm Working From:
> C:\Users\Will\Desktop\School Junk\GABA Project\GABA Structures
>
> Within this folder are several subfolders and each subfolder has
> several other subfolders.
>
>
> Sorry for the long post, this is my first one, any help is greatly
> appreciated.
>
>