Hi Peter, Thanks very much for you answer, this was exactly the problem, I thought I was dealing with a Python string and the Cheetah error was not as clear as the Python error that you'd get when calling a function from an unsupported object.
I also joined in with one of the Breakout sessions at the Galaxy conference in which Dan also explained my error (https://bitbucket.org/galaxy/galaxy-central/wiki/2011_Galaxy_Community_Conference/Complex_Tools_and_Datasources:_Parameters,_Datatypes_and_Metadata) I've been toying with Cheetah a bit more now, and it's getting better real fast once you get the grips with it! Thanks again, also for your nice presentation (worked very well!) - Marcel ________________________________________ Van: Peter Cock [p.j.a.c...@googlemail.com] Verzonden: donderdag 26 mei 2011 15:25 Aan: Kempenaar, M (med) CC: email@example.com Onderwerp: Re: [galaxy-dev] The powers of Cheetah, how? On Thu, May 26, 2011 at 1:22 PM, Kempenaar, M (med) <m.kempen...@med.umcg.nl> wrote: > Hi list, > I've been working on a single Galaxy tool for a while now, and I'm running > into all sorts of difficulties that can probably all be fixed using Cheetah. > However I've been trying several ways of utilizing the (enormous) powers of > Cheetah but so far I'm not successful. I'll try to ask my questions as clear > as possible, please let me know if anything is unclear. > In my tool I use the following input parameter: > ----------------------- > <param name="report_options" type="select" multiple="True" > display="checkboxes"> > <option value="overview">phyla distribution</option> > <option value="phyladend">phyla dendograms</option> > <option value="heatmap">heatmap</option> > <option value="dendogram">dendogram</option> > <option value="pca">principal component analysis</option> > <option value="mds">multi dimensional scaling</option> > </param> > ----------------------- > Each of these options corresponds to a function in my R script, thus I want > to do an if-else if-else to execute these functions that the user selected > (note that multiple="True"). > Now the problem is, I also use R Sweave (sweaving R output (text/graphics) > into LaTeX) to generate a nice looking PDF report, and since that's not a > 'real' programming/ scripting language, I can't for instance split the > string (as I used to do in R) and check for the boxes a user selected, so my > questions are: > I planned on using Cheetah to include sections of Sweave LaTeX code for each > box checked by the user, perfectly doable with an #if-#elif you'd think, > however since the $report_options contains a comma-separated single string, > I would need to split (or use regular expressions) to be able to do such an > #if-#elif like: > #if "heatmap" in $report_options.split(",") > results in: "NotFound: cannot find 'split' while searching for 'split'" Try changing this: #if "heatmap" in $report_options.split(",") to: #if "heatmap" in str($report_options).split(",") Although $report_options acts a bit like a Python string, it isn't one, and lacks lots of useful string methods. We can turn it into a string using the Python str function. > Q: Followup from previous question, where within the sections of my tool XML > file can I actually use Cheetah? This of course has to do with the order in > which a tool is executed. I believe only within the <command>...</command> tag. Peter ________________________________ De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/