From Sebastien.Moretti at unil.ch Fri Apr 4 02:56:13 2008 From: Sebastien.Moretti at unil.ch (Sebastien Moretti) Date: Fri, 04 Apr 2008 08:56:13 +0200 Subject: [emboss-dev] [EMBOSS] list and label values In-Reply-To: <47ED16D9.4020906@ebi.ac.uk> References: <47ECFE1B.30109@unil.ch> <47ED16D9.4020906@ebi.ac.uk> Message-ID: <47F5D10D.1060001@unil.ch> >> 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 From pmr at ebi.ac.uk Fri Apr 4 05:32:16 2008 From: pmr at ebi.ac.uk (Peter Rice) Date: Fri, 04 Apr 2008 10:32:16 +0100 Subject: [emboss-dev] [EMBOSS] list and label values In-Reply-To: <47F5D10D.1060001@unil.ch> References: <47ECFE1B.30109@unil.ch> <47ED16D9.4020906@ebi.ac.uk> <47F5D10D.1060001@unil.ch> Message-ID: <47F5F5A0.6060504@ebi.ac.uk> Sebastien Moretti wrote: > Don't you think that variables should be interpreted in values > attributes by default ? > I think it makes more sense. This will be included in the next release. It makes sense ... but it difficult for web interfaces and other GUIs so we avoid using variables in the values for the applications in EMBOSS. It is fine for your own applications. > I can easily make this changes but it is not long term consistent if > EMBOSS is updated, or if someone else uses my files. No problem - the next EMBOSS release will include the changes. > And I expected to be able to "print" Human during user choice but > program parameter value would be $(matrixpath)/Hs.smat and not Human. The program is passed the short name. We will add a function in the next release to also return the description. That way you can get the path variable into your program. regards, Peter From Sebastien.Moretti at unil.ch Fri Apr 4 08:23:36 2008 From: Sebastien.Moretti at unil.ch (Sebastien Moretti) Date: Fri, 04 Apr 2008 14:23:36 +0200 Subject: [emboss-dev] Empty value in list Message-ID: <47F61DC8.2090109@unil.ch> Hi, How can I make an empty choice in list values attribute ? Something like values: " , a, t" delimiter: ", " with 'a', 't' and '' (or ' ') as choices. Thanks -- S?bastien Moretti SIB, Quartier Sorge - Genopode CH-1015 Lausanne, Switzerland Tel.: +41 (21) 692 4056/4221 From pmr at ebi.ac.uk Fri Apr 4 09:12:16 2008 From: pmr at ebi.ac.uk (Peter Rice) Date: Fri, 04 Apr 2008 14:12:16 +0100 Subject: [emboss-dev] Empty value in list In-Reply-To: <47F61DC8.2090109@unil.ch> References: <47F61DC8.2090109@unil.ch> Message-ID: <47F62930.1060303@ebi.ac.uk> Hi Sebastian, > How can I make an empty choice in list values attribute ? > > Something like > values: " , a, t" > delimiter: ", " > with 'a', 't' and '' (or ' ') as choices. You need something for the user to choose, so you have to use a name like "none". EMBOSS tests the user's input by comparing it to all the list values and finding one that is unambiguous. For example, typing "a" is accepted if only one value starts with "a...". Typing nothing (just hitting return when prompted) is EMBOSS's way to accept the default value. There will be no way for the user to specify an empty choice. Can you give a little more information about why you want an empty choice in a list? regards, Peter From jison at ebi.ac.uk Fri Apr 4 09:26:26 2008 From: jison at ebi.ac.uk (Jon Ison) Date: Fri, 4 Apr 2008 14:26:26 +0100 (BST) Subject: [emboss-dev] Empty value in list In-Reply-To: <47F61DC8.2090109@unil.ch> References: <47F61DC8.2090109@unil.ch> Message-ID: <35207.84.92.187.247.1207315586.squirrel@webmail.ebi.ac.uk> Hi So far as I'm aware that is not allowed. Each list option must have an option label and description ("list" ACD datatype) or description ("select" ACD datatype). Cheers Jono > Hi, > > How can I make an empty choice in list values attribute ? > > Something like > values: " , a, t" > delimiter: ", " > with 'a', 't' and '' (or ' ') as choices. > > Thanks > > -- > S??bastien Moretti > SIB, Quartier Sorge - Genopode > CH-1015 Lausanne, Switzerland > Tel.: +41 (21) 692 4056/4221 > _______________________________________________ > emboss-dev mailing list > emboss-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/emboss-dev > From Sebastien.Moretti at unil.ch Fri Apr 4 10:06:10 2008 From: Sebastien.Moretti at unil.ch (Sebastien Moretti) Date: Fri, 04 Apr 2008 16:06:10 +0200 Subject: [emboss-dev] Empty value in list In-Reply-To: <47F62930.1060303@ebi.ac.uk> References: <47F61DC8.2090109@unil.ch> <47F62930.1060303@ebi.ac.uk> Message-ID: <47F635D2.2000501@unil.ch> > Hi Sebastian, > >> How can I make an empty choice in list values attribute ? >> >> Something like >> values: " , a, t" >> delimiter: ", " >> with 'a', 't' and '' (or ' ') as choices. > > You need something for the user to choose, so you have to use a name > like "none". > > EMBOSS tests the user's input by comparing it to all the list values and > finding one that is unambiguous. For example, typing "a" is accepted if > only one value starts with "a...". > > Typing nothing (just hitting return when prompted) is EMBOSS's way to > accept the default value. There will be no way for the user to specify > an empty choice. > > Can you give a little more information about why you want an empty > choice in a list? > > regards, > > Peter My application has different output modifiers which are parameters in fact: normal: '' full: '-a' short: '-t -' There is maybe a more efficient way to deal with this, e.g. with toggle. But list are more simple. Thus, if I use this default: " " values: "-a, -t -" delimiter: ", " I get what I want but it is not very 'clean'. -- S?bastien Moretti SIB, Quartier Sorge - Genopode CH-1015 Lausanne, Switzerland Tel.: +41 (21) 692 4056/4221 From Sebastien.Moretti at unil.ch Fri Apr 4 06:56:13 2008 From: Sebastien.Moretti at unil.ch (Sebastien Moretti) Date: Fri, 04 Apr 2008 08:56:13 +0200 Subject: [emboss-dev] [EMBOSS] list and label values In-Reply-To: <47ED16D9.4020906@ebi.ac.uk> References: <47ECFE1B.30109@unil.ch> <47ED16D9.4020906@ebi.ac.uk> Message-ID: <47F5D10D.1060001@unil.ch> >> 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 From pmr at ebi.ac.uk Fri Apr 4 09:32:16 2008 From: pmr at ebi.ac.uk (Peter Rice) Date: Fri, 04 Apr 2008 10:32:16 +0100 Subject: [emboss-dev] [EMBOSS] list and label values In-Reply-To: <47F5D10D.1060001@unil.ch> References: <47ECFE1B.30109@unil.ch> <47ED16D9.4020906@ebi.ac.uk> <47F5D10D.1060001@unil.ch> Message-ID: <47F5F5A0.6060504@ebi.ac.uk> Sebastien Moretti wrote: > Don't you think that variables should be interpreted in values > attributes by default ? > I think it makes more sense. This will be included in the next release. It makes sense ... but it difficult for web interfaces and other GUIs so we avoid using variables in the values for the applications in EMBOSS. It is fine for your own applications. > I can easily make this changes but it is not long term consistent if > EMBOSS is updated, or if someone else uses my files. No problem - the next EMBOSS release will include the changes. > And I expected to be able to "print" Human during user choice but > program parameter value would be $(matrixpath)/Hs.smat and not Human. The program is passed the short name. We will add a function in the next release to also return the description. That way you can get the path variable into your program. regards, Peter From Sebastien.Moretti at unil.ch Fri Apr 4 12:23:36 2008 From: Sebastien.Moretti at unil.ch (Sebastien Moretti) Date: Fri, 04 Apr 2008 14:23:36 +0200 Subject: [emboss-dev] Empty value in list Message-ID: <47F61DC8.2090109@unil.ch> Hi, How can I make an empty choice in list values attribute ? Something like values: " , a, t" delimiter: ", " with 'a', 't' and '' (or ' ') as choices. Thanks -- S?bastien Moretti SIB, Quartier Sorge - Genopode CH-1015 Lausanne, Switzerland Tel.: +41 (21) 692 4056/4221 From pmr at ebi.ac.uk Fri Apr 4 13:12:16 2008 From: pmr at ebi.ac.uk (Peter Rice) Date: Fri, 04 Apr 2008 14:12:16 +0100 Subject: [emboss-dev] Empty value in list In-Reply-To: <47F61DC8.2090109@unil.ch> References: <47F61DC8.2090109@unil.ch> Message-ID: <47F62930.1060303@ebi.ac.uk> Hi Sebastian, > How can I make an empty choice in list values attribute ? > > Something like > values: " , a, t" > delimiter: ", " > with 'a', 't' and '' (or ' ') as choices. You need something for the user to choose, so you have to use a name like "none". EMBOSS tests the user's input by comparing it to all the list values and finding one that is unambiguous. For example, typing "a" is accepted if only one value starts with "a...". Typing nothing (just hitting return when prompted) is EMBOSS's way to accept the default value. There will be no way for the user to specify an empty choice. Can you give a little more information about why you want an empty choice in a list? regards, Peter From jison at ebi.ac.uk Fri Apr 4 13:26:26 2008 From: jison at ebi.ac.uk (Jon Ison) Date: Fri, 4 Apr 2008 14:26:26 +0100 (BST) Subject: [emboss-dev] Empty value in list In-Reply-To: <47F61DC8.2090109@unil.ch> References: <47F61DC8.2090109@unil.ch> Message-ID: <35207.84.92.187.247.1207315586.squirrel@webmail.ebi.ac.uk> Hi So far as I'm aware that is not allowed. Each list option must have an option label and description ("list" ACD datatype) or description ("select" ACD datatype). Cheers Jono > Hi, > > How can I make an empty choice in list values attribute ? > > Something like > values: " , a, t" > delimiter: ", " > with 'a', 't' and '' (or ' ') as choices. > > Thanks > > -- > S??bastien Moretti > SIB, Quartier Sorge - Genopode > CH-1015 Lausanne, Switzerland > Tel.: +41 (21) 692 4056/4221 > _______________________________________________ > emboss-dev mailing list > emboss-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/emboss-dev > From Sebastien.Moretti at unil.ch Fri Apr 4 14:06:10 2008 From: Sebastien.Moretti at unil.ch (Sebastien Moretti) Date: Fri, 04 Apr 2008 16:06:10 +0200 Subject: [emboss-dev] Empty value in list In-Reply-To: <47F62930.1060303@ebi.ac.uk> References: <47F61DC8.2090109@unil.ch> <47F62930.1060303@ebi.ac.uk> Message-ID: <47F635D2.2000501@unil.ch> > Hi Sebastian, > >> How can I make an empty choice in list values attribute ? >> >> Something like >> values: " , a, t" >> delimiter: ", " >> with 'a', 't' and '' (or ' ') as choices. > > You need something for the user to choose, so you have to use a name > like "none". > > EMBOSS tests the user's input by comparing it to all the list values and > finding one that is unambiguous. For example, typing "a" is accepted if > only one value starts with "a...". > > Typing nothing (just hitting return when prompted) is EMBOSS's way to > accept the default value. There will be no way for the user to specify > an empty choice. > > Can you give a little more information about why you want an empty > choice in a list? > > regards, > > Peter My application has different output modifiers which are parameters in fact: normal: '' full: '-a' short: '-t -' There is maybe a more efficient way to deal with this, e.g. with toggle. But list are more simple. Thus, if I use this default: " " values: "-a, -t -" delimiter: ", " I get what I want but it is not very 'clean'. -- S?bastien Moretti SIB, Quartier Sorge - Genopode CH-1015 Lausanne, Switzerland Tel.: +41 (21) 692 4056/4221