[emboss-dev] [EMBOSS] list and label values

Sebastien Moretti Sebastien.Moretti at unil.ch
Fri Apr 4 06:56:13 UTC 2008


>> Hi,
>>
>> I am looking for a way to use labels/alias for values in a list:
>>
>> variable: matrixpath "/usr/molbio/share"
>>
>> list: matrix [
>>         default: "$(matrixpath)/Hs.smat"
>>         minimum: 1
>>         maximum: 1
>>         values: "Human:$(matrixpath)/Hs.smat, 
>> Arabidopsis:$(matrixpath)/At.smat, Rat:$(matrixpath)/Rn.smat, 
>> Drosophila:$(matrixpath)/Dm.smat, Chicken:$(matrixpath)/Gga.smat, 
>> Mouse:$(matrixpath)/Mm.smat, Zebrafish:$(matrixpath)/Dr.smat"
>>         delimiter: ","
>>         codedelimiter: ":"
>>         comment: "defaults"
>>         prompt: "Score matrices file, species specific"
>>         information: "Score matrices file, species specific"
>>     ]
>>
>>
>> So, when I select 'Human', I would like that "$(matrixpath)/Hs.smat" 
>> appears in command line.
> 
> The values string is unchanged in EMBOSS 5.0.0 You need to resolve the
> variable (the $(matrixpath) in two places.
> 
> In ajax/ajacd.c function acdListPrompt add an extra acdVarResolve call
> once "value" has been assigned:
> 
>    ajStrAssignS(&value, acdAttrValue(thys, "value"));
>     acdVarResolve(&value);
> 
> .. this will resolve the variables for the prompt (if you define
> standard: "Y" for matrix)
> 
> and the same in acdListValue so the variables are resolved when the user
> value is tested.
> 
> The same changes are needed for acdSelectPrompt and acdSelectValue if
> you use a selection instead of a list.
> 
> But there is another way ... in general, we define the path separately
> as ACD type "directory" if we allow the user to change it, or hard code
> it and use a Unix environment variable if the user needs to customize 
> it. In
> your case you obviously have a fixed path, but it has to be hardcoded
> somewhere because what is passed to the application is the string "Human".
> 
> One more change ... with a long "short value" like "Arabidopsis" the
> printed list looks untidy. For the next release we can test for the
> longest name and adjust the margin.
> 
> Hope that helps
> 
> Peter

This, variable are interpreted in default attribute but not in values 
attribute.

Don't you think that variables should be interpreted in values 
attributes by default ?
I think it makes more sense.

I can easily make this changes but it is not long term consistent if 
EMBOSS is updated, or if someone else uses my files.



And I expected to be able to "print" Human during user choice but 
program parameter value would be $(matrixpath)/Hs.smat and not Human.

-- 
Sébastien Moretti
SIB, Quartier Sorge - Genopode
CH-1015 Lausanne, Switzerland
Tel.: +41 (21) 692 4056/4221



More information about the emboss-dev mailing list