transform() syntax

9 views
Skip to first unread message

Buz Wilson

unread,
Aug 15, 2009, 5:38:37 AM8/15/09
to po...@googlegroups.com
Hello POY team

You would think that the following command would be legal
transform((names:("S2004.fas:1"),tcm:(2,1),gap_opening:1))
but poy complains that it is expecting a right parenthesis.
My work-around is to put the gap_opening at the end of the transform
statements
transform((names:("S2004.fas:1"),tcm:(2,1)))
transform((all,gap_opening:1)

Incidently, the bit about having redundant parenthesis in the transform
command in some places but not others costs me around a half hour of
testing command files every time I do this. I suppose this has a logical
reason but I haven't seen it yet.

Cheers

Buz Wilson
Australian Museum

Andres Varon

unread,
Aug 15, 2009, 7:30:58 PM8/15/09
to po...@googlegroups.com

On Aug 15, 2009, at 5:38 AM, Buz Wilson wrote:

>
> Hello POY team
>
> You would think that the following command would be legal
> transform((names:("S2004.fas:1"),tcm:(2,1),gap_opening:1))
> but poy complains that it is expecting a right parenthesis.

I didn't think it would be legal .... ;-)

> My work-around is to put the gap_opening at the end of the transform
> statements
> transform((names:("S2004.fas:1"),tcm:(2,1)))
> transform((all,gap_opening:1)


This is a workaround, so you want only that fragment to use tcm:(2,1)
and every fragment to use gap_opening:1.

>
> Incidently, the bit about having redundant parenthesis in the
> transform
> command in some places but not others costs me around a half hour of
> testing command files every time I do this. I suppose this has a
> logical
> reason but I haven't seen it yet.

The manual need editorial work because the transform introduction is
unreadable as it is :-). So let me explain the logic:

Basically a transform () command accepts a list of transformations.
Those transformations can be applied to particular characters.
Therefore, a transform is a _pair_ of items:

(CHARACTERS, METHOD)

The characters that should be transformed, and how should they be
transformed. Let's suppose that a character has name A and another one
has name B. Then we could change the weight of characters A and B as
follows:

transform ((names:("A"), weight:2), (names:("B"), weight:4))

we have written here:

transform ((CHARCTERS, METHOD), (CHARACTERS, METHOD))

As a shortcut, if a transform should be applied to all characters,
then you don't need to specify a pair, but only the transform. For
example:

transform (weight:10)

is the same as

transform ((all, weight:10))

that is:

transform (METHOD) = transform ((all, METHOD))

So you could write what you wanted in one line with:

transform ((names:("S2004.fas:1"),tcm:(2,1)), gap_opening:1)

that is:

transform ((CHARACTER, METHOD), METHOD)


I hope this clarifies things for you.

best,

Andres

>
> Cheers
>
> Buz Wilson
> Australian Museum
>
>

> --~--~---------~--~----~------------~-------~--~----~
> 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
> -~----------~----~----~----~------~----~------~--~---
>

Reply all
Reply to author
Forward
0 new messages