I am not sure why the quotations marks are there in the first place, but I do see the problem. replace and strip return new strings, they don't modify the existing variable. This is demonstrated below: % python
x = ' "Moo Cow" ' x ' "Moo Cow" ' x.replace("\"", "").strip() 'Moo Cow' x ' "Moo Cow" ' x=x.replace("\"", "").strip() x 'Moo Cow'
You will want to change the line: modulePath.replace("\"", "").strip() to modulePath = modulePath.replace("\"", "").strip() You should also take a look at the Galaxy task splitting framework. It already has the ability to split up blast jobs into multiple tasks. I am not sure the dynamic job runner is what you want for that use case. -John On Wed, Aug 7, 2013 at 12:26 PM, Ganote, Carrie L <cganote@iu.edu> wrote:
Hi List,
I've run into a frustration recently with passing values to the dynamic job runner from a tool. Here's what's going on:
in ncbi_blastn_wrapper.xml: <param name="pathToModule" type="hidden" value="/abs/path/to/module" /> ...
in dynamic_runner.py: ... def blastn_wrapper(job): incoming = dict( [ ( p.name, p.value ) for p in job.parameters ] ) modulePath = incoming["pathToModule"] modulePath.replace("\"", "").strip()
dummy = '/abs/path/to/module' equals = (modulePath == dummy) log.debug( '\n~%s~\n~%s~\nsame? %s' % (mypath, dummy, equals) ) ... log: ~"/abs/path/to/module"~ ~/abs/path/to/module~ same? False
I have no idea why these "" are persisting, or if that is even the problem. I can't find the modulePath when using os.path.exists(modulePath). What I want to do is optionally (user checks a box) run another python script that splits up the blast queries into a bunch of jobs and submits each job separately - and I was just going to import this other script using sys.append(modulePath) in some poor attempt to keep the system cleaner.
If this is a problem with my understanding of python, please enlighten me - if there are other tools that pass around paths or if there's another way to do this in less hacky way, I'm open to advice.
Thanks!
Carrie Ganote
___________________________________________________________ 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/
To search Galaxy mailing lists use the unified search at: http://galaxyproject.org/search/mailinglists/