From: Salvatore Mario Cosseddu (S.M.Cosseddu_at_warwick.ac.uk)
Date: Mon Feb 13 2012 - 08:03:43 CST

Dear Charbel,

You are welcome! Try this one:

--------------------------------
#!/bin/bash

for i in {65..71};
do
#NAMD call using
# coordA.pdb
# structA.psf
# binary output coord$iA.restart.coor
charmrun ++local +p8 /usr/local/NAMD_2.8_Linux-x86_64/namd2
step${i}_equilibration.inp > step${i}A.log;

# VMD call to create i_th step
echo "mol new struct${i}A.psf waitfor all;
mol addfile coord${i}A.restart.coor type namdbin waitfor all top;
[atomselect top all] writepdb coord${i}A.pdb
" | vmd -dispdev none -eofexit

done

exit 0

--------------------------------

You will need several NAMD configuration files, one each step.

Is it something similar to what you were thinking at?
This is a way to avoid to create a huge number of small vmd scripts to
do a very simple task.

If you are not happy with this solution, let me know, you could write a
small script using -args argument.

But in this case you really don't need it.

Regards
Salvatore

On 13/02/12 11:58, R. Charbel Maroun wrote:
> Dear Salvatore,
>
> Thanks for your reply. Indeed, "bincoordinates" is a binary coordinate
> restart file generated by an NAMD run, but "coordinates" is a pdb file
> not generated by an NAMD run, and NAMD cannot do without that file.
> So, in between NAMD runs, I have to convert coor files into pdb files.
>
> By script I meant actually a shell script and a VMD script. For the
> first one, I I came up with :
>
> #!/bin/bash
> charmrun ++local +p8 /usr/local/NAMD_2.8_Linux-x86_64/namd2
> step6.5_equilibration.inp > step65A.log;
> vmd -dispdev text -e vmd65A.com;
> charmrun ++local +p8 /usr/local/NAMD_2.8_Linux-x86_64/namd2
> step6.6_equilibration.inp > step66A.log;
> vmd -dispdev text -e vmd66A.com;
> charmrun ++local +p8 /usr/local/NAMD_2.8_Linux-x86_64/namd2
> step7.1_production.inp > step71A.log;
> vmd -dispdev text -e vmd71A.com;
>
> where vmd*.com are the VMD Tcl command files obtained by turning on
> the Log Tcl Commands option in VMD so as to be able to read coor and
> psf files from a previous run and save as pdb for the next run.
>
> Cheers,
>
> CM
>
> Salvatore Mario Cosseddu <S.M.Cosseddu_at_warwick.ac.uk> a écrit :
>
>> Dear Charbel
>>
>> This is the command
>> vmd -dispdev none
>> or
>> vmd -dispdev none
>>
>> for your purpose do you know "bincoordinates"? Have a look in the
>> NAMD guide.
>> You don't need a pdb file, NAMD can read its own binary files.
>>
>> Anyway, what do you mean by script? Bash script? Does something like
>> this look fine?
>>
>> #!/bin/sh
>>
>> ###############
>> #a lot of shell scripting here
>> ####################
>>
>> # VMD call
>> echo "animate read coor filename.coord waitfor all ;
>> [atomselect top all] writepdb filename.pdb
>> " | vmd -dispdev none -eofexit
>>
>> ###############
>> #a lot of more shell scripting here
>> ####################
>>
>> exit 0
>>
>>
>> Be careful to escape " and $
>>
>> To answer to your second question, look to this option "binaryoutput"
>> in the manual. Try if setting it as "no" is what you are looking for.
>> But you lose accuracy in case you'd like to restart your simulation.
>>
>>
>>
>> On 10/02/12 11:26, R. Charbel Maroun wrote:
>>> Hello VMDers,
>>>
>>> Is it possible to run VMD in stand-alone (non-graphical) mode ?
>>> Within a script, I just want to be able to read a .coor NAMD binary
>>> file and save it as an ASCII
>>> .pdb file for further use in NAMD.
>>>
>>> An alternative question is, how can I get NAMD to write a .pdb file
>>> after an MD ? I tried writepdb <filename> in an NAMD script and it
>>> gives the following error:
>>>
>>> ------------- Processor 7 Exiting: Called CmiAbort ------------
>>> Reason: FATAL ERROR: Setting parameter writepdb from script failed!
>>>
>>> I use VMD 1.9 and NAMD 2.8.
>>>
>>> Cheers,
>>>
>>> CM
>>>
>>>
>>>
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>>
>>
>> --
>> Salvatore Cosseddu
>> PhD student
>>
>> Centre for Scientific Computing and School of Engineering
>> University of Warwick
>> Coventry CV4 7AL
>> United Kingdom
>>
>> email: S.M.Cosseddu_at_warwick.ac.uk
>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>

-- 
Salvatore Cosseddu
PhD student
Centre for Scientific Computing and School of Engineering
University of Warwick
Coventry CV4 7AL
United Kingdom
email: S.M.Cosseddu_at_warwick.ac.uk