perturb and timeout

3 views
Skip to first unread message

Samuli

unread,
Aug 5, 2009, 8:01:18 AM8/5/09
to poy4
Hi POY users,

I am trying to use ratchet as a part of sensitivity analysis with
command:

perturb(transform(static_approx),iterations:10,ratchet:(0.25,3))

This, however, takes way too much time for some cost regimes, so I
tried to include timeout command to get the analyses done. I added the
timeout command in the end:

perturb(transform(static_approx),iterations:10,ratchet:(0.25,3),
timeout:20000)

but now it appears that the search is stopped after 20000 seconds, no
matter how many iterations are done, although my aim was to perform
all 10 iterations, but with limited time for each of them.

So, how to set a time limit for individual iterations in this kind of
a situation?

with best regards,

-Samuli

Andres Varon

unread,
Aug 5, 2009, 10:20:39 AM8/5/09
to po...@googlegroups.com
Hello Samuli,

On Aug 5, 2009, at 8:01 AM, Samuli wrote:

>
> Hi POY users,
>
> I am trying to use ratchet as a part of sensitivity analysis with
> command:
>
> perturb(transform(static_approx),iterations:10,ratchet:(0.25,3))
>
> This, however, takes way too much time for some cost regimes,

Yes, if your tcm requires a sankoff matrix, the program will take much
longer to execute that search with the static approximation. A way to
deal with this and not spend much time inside each perturb is to
transform the tcm too, to a simpler matrix that still has some of the
cost differences specified in the original matrix, for instance:

perturb (transform (tcm:(2,1), gap_opening:2, static_approx),
iterations:10, ratchet:(0.25, 3))

In this way inside the perturb the program will be able to use a
simpler cost regime with more efficient algorithms. This is one of the
methods used inside search ().


> so I
> tried to include timeout command to get the analyses done. I added the
> timeout command in the end:
>
> perturb(transform(static_approx),iterations:10,ratchet:(0.25,3),
> timeout:20000)
>
> but now it appears that the search is stopped after 20000 seconds, no
> matter how many iterations are done, although my aim was to perform
> all 10 iterations, but with limited time for each of them.
>
> So, how to set a time limit for individual iterations in this kind of
> a situation?


Good idea. You need each _swap_ to be performed with a timeout. That
means that you need to specify how you want the program to do the swap
inside perturb:

perturb (transform (static_approx), iterations:10, ratchet:(0.25, 3),
swap (timeout:20000))

that's it. Each swap will be allowed to run for at most 20000 seconds.
As you will have at most 11 rounds of swaps per perturbation, it might
be closer to what you want to divide the swap timeout by the number of
rounds. That yields 1818 seconds per swap, then change the timeout
parameter to 1818. You can still keep the perturb timeout that you
had before to limit the overall time, including that needed to perturb
the tree and calculate your transform.


best,

Andres
>
> with best regards,
>
> -Samuli
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "poy4" group.
> To post to this group, send email to po...@googlegroups.com
> To unsubscribe from this group, send email to poy4+uns...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/poy4?hl=en
> -~----------~----~----~----~------~----~------~--~---
>

Samuli

unread,
Aug 6, 2009, 4:37:43 AM8/6/09
to poy4

Hi Andres,

thanks a lot, this will help me a lot!

best wishes,

-Samuli
>  smime.p7s
> 3KViewDownload
Reply all
Reply to author
Forward
0 new messages