Re: [galaxy-dev] Tool test question

2012-07-18 Thread christopher fletez-brant
Hi Nate,

The test XML is:

   tests
test
  param name=input value=nullseq_test.bed ftype=bed /
  param name=fold value=1 /
  param name=gc_err value=0.02 /
  param name=rpt_err value=0'02 /
  param name=rseed value=1 /
  param name=indices_path  value=hg19 /
  output name=output file=nullseq_output.bed /
/test
  /tests

And the XML for the problematic parameter, indices_path, is:

param name=indices_path type=select label=Available Datasets
  options from_file=nullseq_indices.loc
column name=dbkey index=0/
column name=value index=0/
column name=name index=1/
column name=path index=2/
!--filter type=data_meta ref=input key=dbkey column=0 /--
  /options
 /param

Thanks for the reply!
On Wed, Jul 18, 2012 at 3:55 PM, Nate Coraor n...@bx.psu.edu wrote:

 On Jul 18, 2012, at 2:55 PM, christopher fletez-brant wrote:

  Hi, just wondering if anyone has any insight into this issue, as it is
 driving me crazy, especially given that the correct list control element is
 selected (hg19).

 From the output you sent, it doesn't look like your tool is actually
 running, just the upload.  What does your test XML look like?

 --nate

 
  On Sat, Jul 14, 2012 at 8:54 PM, christopher fletez-brant 
 cafletezbr...@gmail.com wrote:
  Hi Nate,
 
  Thanks for the reply.  Error messages are output at the bottom of the
 message.  Setup is that the tool has a number of inputs, one of which is
 actually a directory containing reference files.  We pass the directory by
 allowing users to select from a menu the genome whose information is held
 in that directory; this is done by means of a *.loc file, whose value in
 the tool config is 'indices_path' below.  Run from the Galaxy server, this
 tool works perfectly.  However, I think that perhaps it cannot find the
 directory for some reason?  I just note that diff reports the values listed
 as missing, but no '+' values indicating what is in their place.  Any
 advice would be appreciated.
 
  Thank you,
  Kipper
 
  alaxy.tools.actions.upload_common INFO 2012-07-14 20:39:41,302 tool
 upload1 created job id 1
  galaxy.jobs.manager DEBUG 2012-07-14 20:39:47,663 (1) Job assigned to
 handler 'main'
  galaxy.jobs DEBUG 2012-07-14 20:39:52,828 (1) Working directory for job
 is: /home/fake/galaxy-dist/database/job_working_directory/000/1
  galaxy.jobs.handler DEBUG 2012-07-14 20:39:52,829 dispatching job 1 to
 local runner
  galaxy.jobs.handler INFO 2012-07-14 20:39:53,008 (1) Job dispatched
  galaxy.jobs.runners.local DEBUG 2012-07-14 20:39:53,255 executing:
 python /home/fake/galaxy-dist/tools/data_source/upload.py
 /home/fake/galaxy-dist /tmp/tmpeEp5KR/database/tmp/tmpfYngg0
 /tmp/tmpeEp5KR/database/tmp/tmpMKsPIL
 1:/home/fake/galaxy-dist/database/job_working_directory/000/1/dataset_1_files:/tmp/tmpeEp5KR/database/files/000/dataset_1.dat
  galaxy.jobs.runners.local DEBUG 2012-07-14 20:39:54,480 execution
 finished: python /home/fake/galaxy-dist/tools/data_source/upload.py
 /home/fake/galaxy-dist /tmp/tmpeEp5KR/database/tmp/tmpfYngg0
 /tmp/tmpeEp5KR/database/tmp/tmpMKsPIL
 1:/home/fake/galaxy-dist/database/job_working_directory/000/1/dataset_1_files:/tmp/tmpeEp5KR/database/files/000/dataset_1.dat
  galaxy.jobs DEBUG 2012-07-14 20:39:54,759 job 1 ended
  base.twilltestcase INFO 2012-07-14 20:39:55,782 ## files diff on
 /home/fake/galaxy-dist/test-data/nullseq_output.bed and
 /tmp/tmpeEp5KR/database/tmp/tmpuT588_nullseq_output.bed lines_diff=0, found
 diff = 200
  --  begin tool stdout  ---
 
  ---  end tool stdout  
 
  --  begin tool stderr  ---
 
  ---  end tool stderr  
 
  FAIL
 
  ==
  FAIL: test_tool_00
 (functional.test_toolbox.TestForTool_kmersvm_nullseq)
  Generate Null Sequence ( kmersvm_nullseq )  Test-1
  --
  Traceback (most recent call last):
File /home/fake/galaxy-dist/test/functional/test_toolbox.py, line
 171, in test_tool
  self.do_it( td, shed_tool_id=shed_tool_id )
File /home/fake/galaxy-dist/test/functional/test_toolbox.py, line
 102, in do_it
  self.verify_dataset_correctness( outfile, hid=elem_hid,
 maxseconds=testdef.maxseconds, attributes=attributes,
 shed_tool_id=shed_tool_id )
File /home/fake/galaxy-dist/test/base/twilltestcase.py, line 733, in
 verify_dataset_correctness
  raise AssertionError( errmsg )
  AssertionError: History item 1 different than expected, difference
 (using diff):
  --- local_file
  +++ history_data
  @@ -1,100 +1,100 @@
  -chr104522044 4522438
  -chr105650896 5651310
  -chr105772258 5772663
  -chr109135867 9136467
  -chr109946900 9947273
  -chr101079368910794313
  -chr10

Re: [galaxy-dev] Tool test question

2012-07-15 Thread christopher fletez-brant
23732373336353635363432323361323032323563323233313563323232323263323032323636366636633634323233613230323235633232333135633232323232633230323236393665363436393633363537333566373036313734363832323361323032323563323236643664333935633232323232633230323236353738363336633735363436353634323233613230323236653735366336633232326332303232363736333566363537323732323233613230323235633232333032653330333235633232323232633230323236393665373037353734323233613230323233313232376471002e)
(readonly)
control 2: TextControl(fold=1)
control 3: TextControl(gc_err=0.02)
control 4: TextControl(rpt_err=0.02)
control 5: TextControl(rseed=1)
control 6: SelectControl(input=[*1])
control 7: SelectControl(excluded=[1, *None])
control 8: SelectControl(indices_path=[*mm9, mm8, hg18, hg19])
control 9: SubmitControl(runtool_btn=Execute) (readonly)
page_inputs (0) {'rpt_err': [0'02], 'rseed': ['1'], 'fold': ['1'],
'indices_path': ['hg19'], 'gc_err': ['0.02'], 'input': ['nullseq_test.bed']}

-  end captured stdout  --
  begin captured logging  
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:8368/
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:8368/
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:8368/user/logout
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:8368/
galaxy.tools.actions.upload_common: INFO: tool upload1 created job id 1
galaxy.jobs.manager: DEBUG: (1) Job assigned to handler 'main'
galaxy.jobs: DEBUG: (1) Working directory for job is:
/home/fake/galaxy-dist/database/job_working_directory/000/1
galaxy.jobs.handler: DEBUG: dispatching job 1 to local runner
galaxy.jobs.handler: INFO: (1) Job dispatched
galaxy.jobs.runners.local: DEBUG: executing: python
/home/fake/galaxy-dist/tools/data_source/upload.py /home/fake/galaxy-dist
/tmp/tmpeEp5KR/database/tmp/tmpfYngg0 /tmp/tmpeEp5KR/database/tmp/tmpMKsPIL

1:/home/fake/galaxy-dist/database/job_working_directory/000/1/dataset_1_files:/tmp/tmpeEp5KR/database/files/000/dataset_1.dat
galaxy.jobs.runners.local: DEBUG: execution finished: python
/home/fake/galaxy-dist/tools/data_source/upload.py /home/fake/galaxy-dist
/tmp/tmpeEp5KR/database/tmp/tmpfYngg0 /tmp/tmpeEp5KR/database/tmp/tmpMKsPIL

1:/home/fake/galaxy-dist/database/job_working_directory/000/1/dataset_1_files:/tmp/tmpeEp5KR/database/files/000/dataset_1.dat
galaxy.jobs: DEBUG: job 1 ended
base.twilltestcase: INFO: ## files diff on
/home/fake/galaxy-dist/test-data/nullseq_output.bed and
/tmp/tmpeEp5KR/database/tmp/tmpuT588_nullseq_output.bed lines_diff=0, found
diff = 200
-  end captured logging  -

--
Ran 1 test in 16.540s

FAILED (failures=1)


On Thu, Jul 12, 2012 at 4:20 PM, Nate Coraor n...@bx.psu.edu wrote:

 On Jul 5, 2012, at 8:20 PM, christopher fletez-brant wrote:

  Dear Dev List,
 
  I am currently writing tests for a tool I am developing and am coming up
 short in understanding why it's failing.  Using the test data, I can
 generate output identical to the output provided for testing every time I
 run the tool from my local Galaxy server.  However, when I run the tool
 test through run_functional_tests.sh, it always fails, and apparently fails
 on every line.
 
  Because I consistently see the same output from the Galaxy server-based
 tool, I'm sure I'm missing something simple and want to look at the
 test-generated output.  Is there a way I can set run_functional_tests to
 print the generated tool output file in its entirety?

 Hi Kipper,

 It'd be helpful if you could provide the output of run_functional_tests.sh
 so we could see exactly what was failing.

 Thanks,
 --nate

 
  Thank you,
  Kipper Fletez-Brant
  ___
  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/


___
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/

[galaxy-dev] Tool test question

2012-07-06 Thread christopher fletez-brant
Dear Dev List,

I am currently writing tests for a tool I am developing and am coming up
short in understanding why it's failing.  Using the test data, I can
generate output identical to the output provided for testing every time I
run the tool from my local Galaxy server.  However, when I run the tool
test through run_functional_tests.sh, it always fails, and apparently fails
on every line.

Because I consistently see the same output from the Galaxy server-based
tool, I'm sure I'm missing something simple and want to look at the
test-generated output.  Is there a way I can set run_functional_tests to
print the generated tool output file in its entirety?

Thank you,
Kipper Fletez-Brant
___
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/

[galaxy-dev] Python/R Script Not Integrating with Galaxy Correctly

2012-01-09 Thread Christopher Fletez-Brant
Hello Galaxy-Dev List,

I am having some issues in getting a script to work correctly in Galaxy.  My 
script is written in Python, uses RPy2 to pass some data to the R environment 
and then calls a custom R function; the output of this function, and of the 
greater Python/R tool, is a file.  I am having 2 problems: the first is that R 
cannot find the R file holding the function, and the second is that Galaxy 
cannot find the output file.  Before I elaborate on these issues, I should 
point out that when called from the command line this script executes exactly 
as I intend it to.

First issue:

When called by Galaxy, the Python portion of the script runs fine, and the RPy2 
portion devoted to setting up the R environment so that the script can run 
seems to execute just fine.  The script fails when it tells R to call the 
custom function, with the following output:

Python output:

Traceback (most recent call last):
  File 
/Users/kipperfletez-brant/galaxy-dist/tools/myTools/svm_enh/svm_train_classify_cv.py,
 line 865, in module
if __name__=='__main__': main()
  File 
/Users/kipperfletez-brant/galaxy-dist/tools/myTools/svm_enh/svm_train_classify_cv.py,
 line 851, in main
robjects.r.source(current)
  File 
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rpy2/robjects/functions.py,
 line 82, in __call__
return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
  File 
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rpy2/robjects/functions.py,
 line 34, in __call__
res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in file(file, r, encoding = encoding) : 
  cannot open the connection

R output:

/Users/kipperfletez-brant/galaxy-dist/database/job_working_directory/106/rocprc.R
[1] /Users/kipperfletez-brant/galaxy-dist/database/job_working_directory/106

Error in file(file, r, encoding = encoding) : 
  cannot open the connection
In addition: Warning message:
In file(file, r, encoding = encoding) :
  cannot open file 
'/Users/kipperfletez-brant/galaxy-dist/database/job_working_directory/106/rocprc.R':
 No such file or directory

The first line of the R output is the return of a call to the Python function 
os.path.abspath('rocprc.R') (note that os.path.realpath('rocprc.R') returns the 
same path), while the second line, for comparison, is a call to R's getwd() - 
the R file is in the same directory as the R environment's setting, but for 
some reason R cannot find the file.  Because this works from the command line, 
I suspect that I am not taking some Galaxy setting into account.

Second issue:

Trying to identify even the kind of error, I hard-coded the directory in which 
I know the R file to reside in a call to R's setwd().  This time, the script 
runs correctly, but there is no file returned by Galaxy.  The script execution 
ends with the following output message:

empty
format: pdf, database: ?
Info: [1] /Users/kipperfletez-brant/galaxy-dist/tools/myTools/svm_enh

Watching the file in which the R script is held, I know that the output PDF is 
saved in the same file as that specified in my tool's XML, which, for other 
tools I've written, has resulted in an output file.  Looking at the log, the 
following DEBUG message is written:

galaxy.jobs DEBUG 2012-01-09 10:16:49,899 finish(): Could not move 
/Users/kipperfletez-brant/galaxy-dist/database/job_working_directory/111/rocprc.pdf
 to /Users/kipperfletez-brant/galaxy-dist/database/files/000/dataset_111.dat as 
directed by from_work_dir

As with the first issue, I suspect there is some sort of Galaxy setting I am 
unaware of.

Generally, because both issues relate to finding files not directly 
created/referenced by the caller Python script, I suspect that there will be 
some commonality between the resolutions of the two issues, but I am need help 
to see that.

Thank you for reading,
Kipper Fletez-Brant


___
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/


[galaxy-dev] Script can't find other script

2012-01-05 Thread Christopher Fletez-Brant
Good afternoon Galaxy list,

I've got a Python script which calls an R script.  When I run a job using 
Galaxy, I get the following output from R:

Error in file(file, r, encoding = encoding) : 
  cannot open the connection
In addition: Warning message:
In file(file, r, encoding = encoding) :
  cannot open file 'rocprc.R': No such file or directory

The difficult thing here is that both scripts are in the same directory.  I 
tried using os.path.realpath(PYTHON SCRIPT) to get the name of the current 
directory so that I could force R to operate in same; I still get this error.  
Telling Python to print the results from os.path.realpath(PYTHON SCRIPT) gave 
me ~/galaxy-dist/database/job_working_directory.  Also, the Python script 
works perfectly when called from the command line, so I know this is a Galaxy 
issue.

Please help,
Kipper Fletez-Brant
___
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/