From: Brian Radak (brian.radak_at_gmail.com)
Date: Thu Jan 16 2020 - 12:25:37 CST

The NAMD python interface could be useful for this. However, the
documentation is a bit sparse and would require experimentation. Several
years back I made a lightweight python package called pynamd (
https://github.com/radakb/pynamd) that handled inputs and outputs for a
similar purpose (it's a bit outdated now). Ultimately, scripting in Tcl is
the better way to go since you can access the output directly via
callbacks.

You might consider moving this discussion to namd-l.

Cheers,
Brian

On Thu, Jan 16, 2020, 11:46 AM Ackad, Edward <eackad_at_siue.edu> wrote:

> Thank you!
>
> On Thu, Jan 16, 2020 at 3:37 AM Paweł Kędzierski <
> pawel.kedzierski_at_pwr.edu.pl> wrote:
>
>> W dniu 15.01.2020 o 20:23, Ackad, Edward pisze:
>>
>> Hi all,
>> I'm trying to write a python script with minimal dependencies and that
>> uses namdEneriy to calculate the energy of a dcd file. Is there a better
>> way than externally calling vmd to load the psf+dcd and call namdEnergy
>> from within vmd?
>>
>> Have a look at the NAMD input script generated by NAMD Energy plugin and
>> generate something similar in your Python code. It's minimalistic and the
>> keywords are human readable, but of course you may find their description
>> in NAMD User Guide in case of doubts. Then, run NAMD from Python. You will
>> depend on NAMD only and also it will be much easier to debug than
>> Python->VMD->plugin->NAMD approach. You will need also to parse the namd
>> output yourself but this should be as easy as:
>>
>> for line in open('Eint.log'):
>> if line.startswith('ENERGY:'):
>> energy = float(line.split()[13]) # POTENTIAL
>> ...
>>
>>
>> HTH,
>> Pawel
>>
>>
>> Thanks!
>> Eddie
>>
>> --
>> _________________________________________________________
>> Edward Ackad, Ph.D <http://www.siue.edu/%7Eeackad>
>> Associate Professor of Physics
>> Computational Nanophotonics
>> Southern Illinois University Edwardsville
>> (618) 650-2390
>>
>>
>>
>
> --
> _________________________________________________________
> Edward Ackad, Ph.D <http://www.siue.edu/%7Eeackad>
> Associate Professor of Physics
> Computational Nanophotonics
> Southern Illinois University Edwardsville
> (618) 650-2390
>