VMD-L Mailing List
From: Ryan Woltz (rlwoltz_at_ucdavis.edu)
Date: Wed Jun 26 2024 - 18:29:44 CDT
- Next message: Ryan Woltz: "Re: loading multiple pdbs as frames and the filenames"
- Previous message: Diego Gomes: "Re: loading multiple pdbs as frames and the filenames"
- In reply to: Gianluca Interlandi: "Re: loading multiple pdbs as frames and the filenames"
- Next in thread: Ryan Woltz: "Re: loading multiple pdbs as frames and the filenames"
- Reply: Ryan Woltz: "Re: loading multiple pdbs as frames and the filenames"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Dear Diego and Gianluca,
Thank you both for your help. For anyone searching for this in the future,
modifying Diego's script seems to be the safest way to go. I made a list
using ls mode-*.pdb which organizes the names as expected. However, glob in
tcl to make a matching name list seems to make a random list of names. Here
is the output from a [glob model-*.pdb] ###same as ls in bash
model_0_unrelaxed_alphafold2_multimer_v3_model_1_seed_002.r4.pdb
model_0_unrelaxed_alphafold2_multimer_v3_model_5_seed_003.r1.pdb
model_0_unrelaxed_alphafold2_multimer_v3_model_2_seed_007.r2.pdb
model_0_unrelaxed_alphafold2_multimer_v3_model_3_seed_010.r1.pdb
model_0_unrelaxed_alphafold2_multimer_v3_model_1_seed_003.r2.pdb
So I'd advise to create a list in a file using Gianluca's advice and import
that list into vmd with the read command and Diego's script. If you do not
need to load in a specific order and just need to keep track of the file
names Diego's script works as is.
Thank you both for your assistance once again as both solutions was very
helpful.
Ryan
On Wed, Jun 26, 2024 at 2:10 PM Gianluca Interlandi <
gianluca_at_u.washington.edu> wrote:
> > vmd models-*.pdb -e modify.tcl
>
> I believe that the "*" on the command line acts the same as globbing. You
> can type
>
> ls models-*.pdb
>
> and this should give you the sequence how the "*" is replaced. If for
> example your models are numbered: models-1.pdb, models-2.pdb, ...,
> models-10.pdb, ..., models-100.pdb, ..., models-1000.pdb, and you want
> them to be read in increasing sequence, you may need to use:
>
> vmd models-?.pdb models-??.pdb models-???.pdb models-????.pdb -e
> modify.tcl
>
> But if you named them models-0001.pdb ... models-1000.pdb, then you
> shoudn't have to.
>
> Gianluca
>
> On Wed, 26 Jun 2024, Ryan Woltz wrote:
>
> > Dear community,
> > I think I can do this task with UCSF chimera and maybe it is
> better suited but I have all the
> > scripts already written for vmd and I like the results. I have 1000
> models I need to import into vmd
> > then save residues 190-350 and save each one with the same name. The
> name of the pdb is important to
> > preserve because I have a table with associated values to help rank the
> pdbs. I have scripts to
> > import and modify and save, however, I'm seeking advice on the safest
> method to preserve the name. I
> > can either
> >
> > A) develop a bash script loop to open vmd with a single pdb modify then
> save. i.e. for i - 1 to 1000
> > - do vmd model-$i.pdb -e modify.tcl done (where i is the model number
> and modify.tcl selects and
> > saves the desired region). The problem with this is that it'll be very
> heavy and time consuming
> > opening vmd that many times for a bigger batch of models. Also I don't
> know how to import the
> > model-$i.pdb name into the tcl so that it saves with the same name.
> >
> > B) (preferred since all my scripts currently use this) open vmd with all
> the models as frames. i.e.
> > vmd models-*.pdb -e modify.tcl. this is what I normally do to analyze my
> pdbs and have many scripts
> > either measuring bond distances, rmsd, or saving sections but the pdb
> names are associated with the
> > frame number. I can create a separate array that collects the file names
> (glob function) then moves
> > through the array at the same rate of the frames. My concern with this
> is "vmd model-*.jpdb" and the
> > tcl function "glob" might have a different sorting order. My model names
> are actually quite long and
> > complex with main deviations happening at a "." "r" or "0-9". My
> question for this one is does "*" in
> > the vmd loading protocol prioritize letters/numbers/special characters
> the same as "glob"? I've run
> > into this filename sorting issue a long time ago with a different
> program so I'm quite paranoid about
> > this now.
> >
> > Thanks for suggestions,
> >
> > Ryan
> >
> >
>
> -----------------------------------------------------
> Gianluca Interlandi, PhD gianluca_at_u.washington.edu
> +1 (206) 685 4435
> https://urldefense.com/v3/__http://gianluca.today/research/__;!!DZ3fjg!-_lQyft0O2eG7rDyhXgWEjtbf3pIiPqWSn4TU1aqmsYIgHwLWo83R1YVQ_7HuJgCdULSQ5HMK0hRzwS81WB9UQ$
>
> Department of Bioengineering
> University of Washington, Seattle WA U.S.A.
> -----------------------------------------------------
- Next message: Ryan Woltz: "Re: loading multiple pdbs as frames and the filenames"
- Previous message: Diego Gomes: "Re: loading multiple pdbs as frames and the filenames"
- In reply to: Gianluca Interlandi: "Re: loading multiple pdbs as frames and the filenames"
- Next in thread: Ryan Woltz: "Re: loading multiple pdbs as frames and the filenames"
- Reply: Ryan Woltz: "Re: loading multiple pdbs as frames and the filenames"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]