Re: colvars selecting frames

From: Jérôme Hénin (jerome.henin_at_ibpc.fr)
Date: Thu Feb 01 2018 - 06:32:00 CST

true, i's probably not trivial to write out a custom selection of frames to
a file. The easiest I can think of is to go through all the frames
backwards from the end, and delete those you don't want. Then write those
that are left. The point of starting from the end is that the frame numbers
don't change when you delete later frames.

Jerome

On 1 February 2018 at 13:06, Stefano Guglielmo <stefano.guglielmo_at_unito.it>
wrote:

> Jerome, thanks for hint.
> I must say that I'm far from being expert in scripting; I tried the
> following one, but it just write one frame in the output dcd file. Is
> somebody that patient to provide some more suggestions?
>
> Thanks in advance
> Stefano
>
> package require bigdcd
> proc metadynamics_colvars { frame } {
> global all
> if {$frame == 1} {
> cv molid 0
> cv configfile colvar4.txt
> cv load cdk_8bS_cv4_replica1_250.restart
> }
> cv update
> set energy [cv bias metadynamics1 energy]
> set dist [cv colvar Dist value]
> set sel [atomselect top all]
> set n [molinfo top get numframes]
> #set ang [cv colvar angle value]
> if { $dist > 15 } {
> if { $energy > 8 } {
> for { set i 0 } { $i < $n } { incr i } {
> $sel frame $i
> $sel update
> animate write dcd cdk2_8bS_min.dcd $sel
> }
> }
> }
> }
> set mol [mol new cdk2_8bS_pocket_wb_ion.psf type psf waitfor all]
> set all [atomselect $mol all]
> $all global
> bigdcd metadynamics_colvars auto cdk_8bS_cv4_210.dcd
> bigdcd_wait
> quit
>
> 2018-01-31 10:22 GMT+01:00 Jérôme Hénin <jerome.henin_at_ibpc.fr>:
>
>> Dear Stefano,
>>
>> You can do that with a VMD script using the colvars interface.
>>
>> Best,
>> Jerome
>>
>> On 31 January 2018 at 02:37, Stefano Guglielmo <
>> stefano.guglielmo_at_unito.it> wrote:
>>
>>> Dear all,
>>> I was wondering if it is possible to select and ouput/save frames having
>>> collective variable values in a user defined range (or in alternative
>>> metadynamics energy value) out of a metadynamics trajectory obtained with
>>> the colvars module in NAMD.
>>> Thanks in advance
>>> Stefano
>>>
>>> --
>>> Stefano GUGLIELMO PhD
>>> Assistant Professor of Medicinal Chemistry
>>> Department of Drug Science and Technology
>>> Via P. Giuria 9
>>> <https://maps.google.com/?q=Via+P.+Giuria+9+10125+Turin,+ITALY+ph.+%2B39&entry=gmail&source=g>
>>> 10125 Turin, ITALY
>>> <https://maps.google.com/?q=Via+P.+Giuria+9+10125+Turin,+ITALY+ph.+%2B39&entry=gmail&source=g>
>>> ph. +39
>>> <https://maps.google.com/?q=Via+P.+Giuria+9+10125+Turin,+ITALY+ph.+%2B39&entry=gmail&source=g>
>>> (0)11 6707178
>>>
>>>
>>
>
>
> --
> Stefano GUGLIELMO PhD
> Assistant Professor of Medicinal Chemistry
> Department of Drug Science and Technology
> Via P. Giuria 9
> <https://maps.google.com/?q=Via+P.+Giuria+9+10125+Turin,+ITALY+%3Chttps://maps.google.com/?q%3DVia%2BP.%2BGiuria%2B9%2B10125%2BTurin,%2BITALY%2Bph.%2B%252B39%26entry%3Dgmail%26source%3Dg%3E+ph.+%2B39+%3Chttps://maps.google.com/?q%3DVia%2BP.%2BGiuria%2B9%2B10125%2BTurin,%2BITALY%2Bph.%2B%252B39%26entry%3Dgmail%26source%3Dg%3E&entry=gmail&source=g>
> 10125 Turin, ITALY
> <https://maps.google.com/?q=Via+P.+Giuria+9+10125+Turin,+ITALY+%3Chttps://maps.google.com/?q%3DVia%2BP.%2BGiuria%2B9%2B10125%2BTurin,%2BITALY%2Bph.%2B%252B39%26entry%3Dgmail%26source%3Dg%3E+ph.+%2B39+%3Chttps://maps.google.com/?q%3DVia%2BP.%2BGiuria%2B9%2B10125%2BTurin,%2BITALY%2Bph.%2B%252B39%26entry%3Dgmail%26source%3Dg%3E&entry=gmail&source=g>
> ph. +39
> <https://maps.google.com/?q=Via+P.+Giuria+9+10125+Turin,+ITALY+%3Chttps://maps.google.com/?q%3DVia%2BP.%2BGiuria%2B9%2B10125%2BTurin,%2BITALY%2Bph.%2B%252B39%26entry%3Dgmail%26source%3Dg%3E+ph.+%2B39+%3Chttps://maps.google.com/?q%3DVia%2BP.%2BGiuria%2B9%2B10125%2BTurin,%2BITALY%2Bph.%2B%252B39%26entry%3Dgmail%26source%3Dg%3E&entry=gmail&source=g>
> (0)11 6707178
>
>

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2019 - 23:19:39 CST