Re: [galaxy-dev] code example for improved error handling

2012-08-17 Thread Scott McManus
I'm writing documentation now - I'll have something this afternoon. 
Sorry for the delay. 

-Scott 

- Original Message -

 No, I call the executable directly from the xml. It kept failing
 although it seemed to finish the job and I realized that on success
 the executable prints a summary message to stderror, because it's
 using stdout for the actual results so they can be pipped to another
 command.
 From the July news brief I understood that you can now add code to
 the xml to check the stdout and std error for messages and I was
 wondering if you have any documentation or sample code for that in
 any published tool.

 Thanks

 Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete
 Genomics, Inc.
 (650) 428-6023 office | (408) 605-3938 mobile
 bcr...@completegenomics.com

 From: John Patterson  jmpa...@g.uky.edu 
 Date: Thursday, August 16, 2012 12:29 PM
 To:  galaxy-dev@lists.bx.psu.edu   galaxy-dev@lists.bx.psu.edu 
 Subject: Re: [galaxy-dev] code example for improved error handling

 On 08/16/2012 03:02 PM, Birgit Crain wrote:

  Hi
 

  I'm writing a tools for an executable that writes results to stdout
  and reports success message to stderr, so it really need the
  improved error handling. Is there any sample code or documentation
  available?
 

  Thanks
 

  Birgit Crain, Ph.D. | Sr. Professional Services Scientist |
  Complete
  Genomics, Inc.
 
  (650) 428-6023 office | (408) 605-3938 mobile
 
  bcr...@completegenomics.com
 

  From: Nicole Rockweiler  n.rockwei...@gmail.com 
 
  Date: Friday, July 20, 2012 10:53 AM
 
  To: Brian Haas  bh...@broadinstitute.org 
 
  Cc:  galaxy-...@bx.psu.edu   galaxy-...@bx.psu.edu 
 
  Subject: Re: [galaxy-dev] pipeline execution succeeds but galaxy
  shows failure
 

  Hi Brian,
 

  A couple of days ago, smcmanus pushed the following change to the
  repo:
 

   Tools can now specify their own handling of stderr and stdout
   regular
   expressions as well as exit code ranges.
  
 
  https://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-decide-whether-to-use-return-codes-or-stderr-for-detecting-job
 

  It looks like the documentation has yet to be written.
 

  Hope this helps,
 
  Nicole
 

  On Fri, Jul 20, 2012 at 12:46 PM, Brad Chapman 
  chapm...@50mail.com
   wrote:
 

   Brian;
  
 

I wrote a pipeline (xml attached) that, from what I can gather,
  
 
succeeds, but galaxy shows it as an error and doesn't make the
output
  
 
file accessible as a new data set.
  
 

   Is it possible the software is writing to standard error? Galaxy
   doesn't
  
 
   check status codes, but rather check for stderr and assumes that
   output
  
 
   indicates a problem. You can wrap the problematic programs with a
   little
  
 
   script to eat up stderr and check that everything is okay:
  
 

   http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr
  
 

   Brad
  
 

   
  
 
   From the server log, I can see that the command line is being
  
 
constructed correctly, and it even indicates that it's captured
the
  
 
output, but in the display of the web browser, it just shows up
in
the
  
 
error state. The script being run exits (0) on success. Any
ideas?
  
 
   
  
 
Here's what the output section of my xml file looks like:
  
 
   
  
 
outputs
  
 
data format=bam name=coordSortedBam label=${ tool.name }
  
 
on ${on_string}: coord-sorted read alignments
  
 
from_work_dir=alignment/alignment.coordSorted.bam/
  
 
/outputs
  
 
   
  
 
and here's what the server log states:
  
 
   
  
 
galaxy.jobs.handler INFO 2012-07-20 09:52:05,240 (30) Job
dispatched
  
 
galaxy.jobs.runners.local DEBUG 2012-07-20 09:52:05,453
executing:
  
 
alignReads.pl --target
  
 
/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_26.dat
  
 
-o alignment --aligner bowtie --single
  
 
/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_23.dat
  
 
--seqType fq
  
 
   
  
 
galaxy.jobs DEBUG 2012-07-20 09:52:16,673 finish(): Moved
  
 
/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/job_working_directory/000/30/alignment/alignment.coordSorted.bam
  
 
to
/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_50.dat
  
 
as directed by from_work_dir
  
 
   
  
 
Again, as far as I can tell, everything worked - but the
browser
  
 
doesn't think so.
  
 
   
  
 
I've run the exact command above on the command-line, and it
exits(0)
  
 
indicating success.
  
 
Also, I've verified that when run through my galaxy instance,
the
  
 
galaxy-relocated output file is as expected.
  
 
   
  
 
Many thanks for your help. I'm still getting my feet wet with
  
 
galaxy, reading through all the documentation and searching the
  
 
mailing list for additional help.
  
 
   
  
 
best regards,
  
 
   
  
 
-brian

Re: [galaxy-dev] code example for improved error handling

2012-08-17 Thread Birgit Crain
Thanks,  greatly appreciated!

Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete Genomics, 
Inc.
(650) 428-6023 office | (408) 605-3938 mobile
bcr...@completegenomics.commailto:bcr...@completegenomics.com


From: Scott McManus scottmcma...@gatech.edumailto:scottmcma...@gatech.edu
Date: Friday, August 17, 2012 11:02 AM
To: Birgit Crain 
bcr...@completegenomics.commailto:bcr...@completegenomics.com
Cc: galaxy-dev@lists.bx.psu.edumailto:galaxy-dev@lists.bx.psu.edu 
galaxy-dev@lists.bx.psu.edumailto:galaxy-dev@lists.bx.psu.edu
Subject: Re: [galaxy-dev] code example for improved error handling

I'm writing documentation now - I'll have something this afternoon.
Sorry for the delay.

-Scott


No, I call the executable directly from the xml. It kept failing although it 
seemed to finish the job and I realized that on success the executable prints a 
summary message to stderror, because it's using stdout for the actual results 
so they can be pipped to another command.
From the July news brief I understood that you can now add code to the xml to 
check the stdout and std error for messages and I was wondering if you have 
any documentation or sample code for that in any published tool.

Thanks

Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete Genomics, 
Inc.
(650) 428-6023 office | (408) 605-3938 mobile
bcr...@completegenomics.commailto:bcr...@completegenomics.com


From: John Patterson jmpa...@g.uky.edumailto:jmpa...@g.uky.edu
Date: Thursday, August 16, 2012 12:29 PM
To: galaxy-dev@lists.bx.psu.edumailto:galaxy-dev@lists.bx.psu.edu 
galaxy-dev@lists.bx.psu.edumailto:galaxy-dev@lists.bx.psu.edu
Subject: Re: [galaxy-dev] code example for improved error handling

On 08/16/2012 03:02 PM, Birgit Crain wrote:
Hi

I'm writing a tools for an executable that writes results to stdout and reports 
success message to stderr, so it really need the improved error handling. Is 
there any sample code or documentation available?

Thanks

Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete Genomics, 
Inc.
(650) 428-6023 office | (408) 605-3938 mobile
bcr...@completegenomics.commailto:bcr...@completegenomics.com


From: Nicole Rockweiler n.rockwei...@gmail.commailto:n.rockwei...@gmail.com
Date: Friday, July 20, 2012 10:53 AM
To: Brian Haas bh...@broadinstitute.orgmailto:bh...@broadinstitute.org
Cc: galaxy-...@bx.psu.edumailto:galaxy-...@bx.psu.edu 
galaxy-...@bx.psu.edumailto:galaxy-...@bx.psu.edu
Subject: Re: [galaxy-dev] pipeline execution succeeds but galaxy shows failure

Hi Brian,

A couple of days ago, smcmanushttps://bitbucket.org/smcmanus pushed the 
following change to the repo:

Tools can now specify their own handling of stderr and stdout regular 
expressions as well as exit code ranges.

https://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-decide-whether-to-use-return-codes-or-stderr-for-detecting-job

It looks like the documentation has yet to be written.


Hope this helps,
Nicole

On Fri, Jul 20, 2012 at 12:46 PM, Brad Chapman 
chapm...@50mail.commailto:chapm...@50mail.com wrote:

Brian;

 I wrote a pipeline (xml attached) that, from what I can gather,
 succeeds, but galaxy shows it as an error and doesn't make the output
 file accessible as a new data set.

Is it possible the software is writing to standard error? Galaxy doesn't
check status codes, but rather check for stderr and assumes that output
indicates a problem. You can wrap the problematic programs with a little
script to eat up stderr and check that everything is okay:

http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr

Brad



From the server log, I can see that the command line is being
 constructed correctly, and it even indicates that it's captured the
 output, but in the display of the web browser, it just shows up in the
 error state.   The script being run exits (0) on success.  Any ideas?

 Here's what the output section of my xml file looks like:

 outputs
 data format=bam name=coordSortedBam 
 label=${tool.namehttp://tool.name}
 on ${on_string}: coord-sorted read alignments
 from_work_dir=alignment/alignment.coordSorted.bam/
 /outputs

 and here's what the server log states:

 galaxy.jobs.handler INFO 2012-07-20 09:52:05,240 (30) Job dispatched
 galaxy.jobs.runners.local DEBUG 2012-07-20 09:52:05,453 executing:
 alignReads.pl --target
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_26.dat
 -o alignment --aligner bowtie --single
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_23.dat
   --seqType fq

 galaxy.jobshttp://galaxy.jobs DEBUG 2012-07-20 09:52:16,673 finish(): Moved
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/job_working_directory/000/30/alignment/alignment.coordSorted.bam
 to /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_50.dat
 as directed by from_work_dir

 Again, as far as I can tell, everything worked - but the browser
 doesn't think so

Re: [galaxy-dev] code example for improved error handling

2012-08-17 Thread Scott McManus
Please see http://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Config%20Syntax . 
There is a section for stdio, regex, and exit_code tag sets. The 
documentation 
applies to the latest galaxy-dist, though most of what's mentioned (aside from 
updating 
stdout and stderr with warning messages) is supported in galaxy-central. 

(You can also use the fairly ugly URL 
http://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Config%20Syntax#A.3Cstdio.3E.2C_.3Cregex.3E.2C_and_.3Cexit_code.3E_tag_sets
 ). 

-Scott 

- Original Message -

 Hi

 I'm writing a tools for an executable that writes results to stdout
 and reports success message to stderr, so it really need the
 improved error handling. Is there any sample code or documentation
 available?

 Thanks

 Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete
 Genomics, Inc.
 (650) 428-6023 office | (408) 605-3938 mobile
 bcr...@completegenomics.com

 From: Nicole Rockweiler  n.rockwei...@gmail.com 
 Date: Friday, July 20, 2012 10:53 AM
 To: Brian Haas  bh...@broadinstitute.org 
 Cc:  galaxy-...@bx.psu.edu   galaxy-...@bx.psu.edu 
 Subject: Re: [galaxy-dev] pipeline execution succeeds but galaxy
 shows failure

 Hi Brian,

 A couple of days ago, smcmanus pushed the following change to the
 repo:

  Tools can now specify their own handling of stderr and stdout
  regular
  expressions as well as exit code ranges.
 
 https://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-decide-whether-to-use-return-codes-or-stderr-for-detecting-job

 It looks like the documentation has yet to be written.

 Hope this helps,
 Nicole

 On Fri, Jul 20, 2012 at 12:46 PM, Brad Chapman  chapm...@50mail.com
  wrote:

  Brian;
 

   I wrote a pipeline (xml attached) that, from what I can gather,
 
   succeeds, but galaxy shows it as an error and doesn't make the
   output
 
   file accessible as a new data set.
 

  Is it possible the software is writing to standard error? Galaxy
  doesn't
 
  check status codes, but rather check for stderr and assumes that
  output
 
  indicates a problem. You can wrap the problematic programs with a
  little
 
  script to eat up stderr and check that everything is okay:
 

  http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr
 

  Brad
 

  
 
  From the server log, I can see that the command line is being
 
   constructed correctly, and it even indicates that it's captured
   the
 
   output, but in the display of the web browser, it just shows up
   in
   the
 
   error state. The script being run exits (0) on success. Any
   ideas?
 
  
 
   Here's what the output section of my xml file looks like:
 
  
 
   outputs
 
   data format=bam name=coordSortedBam label=${ tool.name }
 
   on ${on_string}: coord-sorted read alignments
 
   from_work_dir=alignment/alignment.coordSorted.bam/
 
   /outputs
 
  
 
   and here's what the server log states:
 
  
 
   galaxy.jobs.handler INFO 2012-07-20 09:52:05,240 (30) Job
   dispatched
 
   galaxy.jobs.runners.local DEBUG 2012-07-20 09:52:05,453
   executing:
 
   alignReads.pl --target
 
   /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_26.dat
 
   -o alignment --aligner bowtie --single
 
   /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_23.dat
 
   --seqType fq
 
  
 
   galaxy.jobs DEBUG 2012-07-20 09:52:16,673 finish(): Moved
 
   /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/job_working_directory/000/30/alignment/alignment.coordSorted.bam
 
   to
   /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_50.dat
 
   as directed by from_work_dir
 
  
 
   Again, as far as I can tell, everything worked - but the browser
 
   doesn't think so.
 
  
 
   I've run the exact command above on the command-line, and it
   exits(0)
 
   indicating success.
 
   Also, I've verified that when run through my galaxy instance, the
 
   galaxy-relocated output file is as expected.
 
  
 
   Many thanks for your help. I'm still getting my feet wet with
 
   galaxy, reading through all the documentation and searching the
 
   mailing list for additional help.
 
  
 
   best regards,
 
  
 
   -brian
 
  
 
  
 
   --
 
   --
 
   Brian J. Haas
 
   Manager, Genome Annotation and Analysis, Research and Development
 
   The Broad Institute
 
   http://broad.mit.edu/~bhaas
 
   tool id=alignreads name=alignReads version=0.0.1
 
  
 
   descriptionalignReads: short read alignment tool
   wrapper/description
 
   requirements
 
   requirement type=packagetrinity/requirement
 
   /requirements
 
   command
 
  
 
   alignReads.pl --target $target -o alignment --aligner
   $aligner_selection.aligner
 
  
 
  
 
   ## Inputs.
 
   #if str($inputs.paired_or_single) == paired:
 
   --left $inputs.left_input --right $inputs.right_input
 
   #if $inputs.left_input.ext == 'fa':
 
   --seqType fa
 
   #else:
 
   --seqType fq
 
   #end if
 
   #if str($inputs.library_type) != None:
 
   --SS_lib_type $inputs.library_type
 
   #end if
 
   

[galaxy-dev] code example for improved error handling

2012-08-16 Thread Birgit Crain
Hi

I'm writing a tools for an executable that writes results to stdout and reports 
success message to stderr, so it really need the improved error handling. Is 
there any sample code or documentation available?

Thanks

Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete Genomics, 
Inc.
(650) 428-6023 office | (408) 605-3938 mobile
bcr...@completegenomics.commailto:bcr...@completegenomics.com


From: Nicole Rockweiler n.rockwei...@gmail.commailto:n.rockwei...@gmail.com
Date: Friday, July 20, 2012 10:53 AM
To: Brian Haas bh...@broadinstitute.orgmailto:bh...@broadinstitute.org
Cc: galaxy-...@bx.psu.edumailto:galaxy-...@bx.psu.edu 
galaxy-...@bx.psu.edumailto:galaxy-...@bx.psu.edu
Subject: Re: [galaxy-dev] pipeline execution succeeds but galaxy shows failure

Hi Brian,

A couple of days ago, smcmanushttps://bitbucket.org/smcmanus pushed the 
following change to the repo:

Tools can now specify their own handling of stderr and stdout regular 
expressions as well as exit code ranges.

https://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-decide-whether-to-use-return-codes-or-stderr-for-detecting-job

It looks like the documentation has yet to be written.


Hope this helps,
Nicole

On Fri, Jul 20, 2012 at 12:46 PM, Brad Chapman 
chapm...@50mail.commailto:chapm...@50mail.com wrote:

Brian;

 I wrote a pipeline (xml attached) that, from what I can gather,
 succeeds, but galaxy shows it as an error and doesn't make the output
 file accessible as a new data set.

Is it possible the software is writing to standard error? Galaxy doesn't
check status codes, but rather check for stderr and assumes that output
indicates a problem. You can wrap the problematic programs with a little
script to eat up stderr and check that everything is okay:

http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr

Brad



From the server log, I can see that the command line is being
 constructed correctly, and it even indicates that it's captured the
 output, but in the display of the web browser, it just shows up in the
 error state.   The script being run exits (0) on success.  Any ideas?

 Here's what the output section of my xml file looks like:

 outputs
 data format=bam name=coordSortedBam 
 label=${tool.namehttp://tool.name}
 on ${on_string}: coord-sorted read alignments
 from_work_dir=alignment/alignment.coordSorted.bam/
 /outputs

 and here's what the server log states:

 galaxy.jobs.handler INFO 2012-07-20 09:52:05,240 (30) Job dispatched
 galaxy.jobs.runners.local DEBUG 2012-07-20 09:52:05,453 executing:
 alignReads.pl --target
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_26.dat
 -o alignment --aligner bowtie --single
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_23.dat
   --seqType fq

 galaxy.jobshttp://galaxy.jobs DEBUG 2012-07-20 09:52:16,673 finish(): Moved
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/job_working_directory/000/30/alignment/alignment.coordSorted.bam
 to /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_50.dat
 as directed by from_work_dir

 Again, as far as I can tell, everything worked - but the browser
 doesn't think so.

 I've run the exact command above on the command-line, and it exits(0)
 indicating success.
 Also, I've verified that when run through my galaxy instance, the
 galaxy-relocated output file is as expected.

 Many thanks for your help.   I'm still getting my feet wet with
 galaxy, reading through all the documentation and searching the
 mailing list for additional help.

 best regards,

 -brian


 --
 --
 Brian J. Haas
 Manager, Genome Annotation and Analysis, Research and Development
 The Broad Institute
 http://broad.mit.edu/~bhaas
 tool id=alignreads name=alignReads version=0.0.1

 descriptionalignReads: short read alignment tool wrapper/description
 requirements
 requirement type=packagetrinity/requirement
 /requirements
 command

 alignReads.pl --target $target -o alignment --aligner 
 $aligner_selection.aligner


 ## Inputs.
 #if str($inputs.paired_or_single) == paired:
 --left $inputs.left_input --right $inputs.right_input
 #if  $inputs.left_input.ext == 'fa':
 --seqType fa
 #else:
 --seqType fq
 #end if
 #if str($inputs.library_type) != None:
 --SS_lib_type $inputs.library_type
 #end if
   --max_dist_between_pairs $inputs.max_dist_between_pairs
 #else:
 --single $inputs.input
 #if  str($inputs.input.ext) == 'fa':
 --seqType fa
 #else:
 --seqType fq
 #end if
 #if str($inputs.library_type) != None:
 --SS_lib_type $inputs.library_type
 #end if
 #end if

 ## Additional parameters.
   ##if str($inputs.use_additional) == yes:
   

Re: [galaxy-dev] code example for improved error handling

2012-08-16 Thread John Patterson

On 08/16/2012 03:02 PM, Birgit Crain wrote:

Hi

I'm writing a tools for an executable that writes results to stdout 
and reports success message to stderr, so it really need the improved 
error handling. Is there any sample code or documentation available?


Thanks

*Birgit Crain, Ph.D.*| Sr. Professional Services Scientist | Complete 
Genomics, Inc.


(650) 428-6023 office | (408) 605-3938 mobile

bcr...@completegenomics.com mailto:bcr...@completegenomics.com



From: Nicole Rockweiler n.rockwei...@gmail.com 
mailto:n.rockwei...@gmail.com

Date: Friday, July 20, 2012 10:53 AM
To: Brian Haas bh...@broadinstitute.org 
mailto:bh...@broadinstitute.org
Cc: galaxy-...@bx.psu.edu mailto:galaxy-...@bx.psu.edu 
galaxy-...@bx.psu.edu mailto:galaxy-...@bx.psu.edu
Subject: Re: [galaxy-dev] pipeline execution succeeds but galaxy shows 
failure


Hi Brian,

A couple of days ago, smcmanus https://bitbucket.org/smcmanus pushed 
the following change to the repo:


Tools can now specify their own handling of stderr and stdout
regular expressions as well as exit code ranges. 



https://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-decide-whether-to-use-return-codes-or-stderr-for-detecting-job

It looks like the documentation has yet to be written.


Hope this helps,
Nicole

On Fri, Jul 20, 2012 at 12:46 PM, Brad Chapman chapm...@50mail.com 
mailto:chapm...@50mail.com wrote:



Brian;

 I wrote a pipeline (xml attached) that, from what I can gather,
 succeeds, but galaxy shows it as an error and doesn't make the
output
 file accessible as a new data set.

Is it possible the software is writing to standard error? Galaxy
doesn't
check status codes, but rather check for stderr and assumes that
output
indicates a problem. You can wrap the problematic programs with a
little
script to eat up stderr and check that everything is okay:

http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr

Brad



From the server log, I can see that the command line is being
 constructed correctly, and it even indicates that it's captured the
 output, but in the display of the web browser, it just shows up
in the
 error state.   The script being run exits (0) on success.  Any
ideas?

 Here's what the output section of my xml file looks like:

 outputs
 data format=bam name=coordSortedBam
label=${tool.name http://tool.name}
 on ${on_string}: coord-sorted read alignments
 from_work_dir=alignment/alignment.coordSorted.bam/
 /outputs

 and here's what the server log states:

 galaxy.jobs.handler INFO 2012-07-20 09:52:05,240 (30) Job dispatched
 galaxy.jobs.runners.local DEBUG 2012-07-20 09:52:05,453 executing:
 alignReads.pl --target

/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_26.dat
 -o alignment --aligner bowtie --single

/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_23.dat
   --seqType fq

 galaxy.jobs http://galaxy.jobs DEBUG 2012-07-20 09:52:16,673
finish(): Moved


/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/job_working_directory/000/30/alignment/alignment.coordSorted.bam
 to
/Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_50.dat
 as directed by from_work_dir

 Again, as far as I can tell, everything worked - but the browser
 doesn't think so.

 I've run the exact command above on the command-line, and it
exits(0)
 indicating success.
 Also, I've verified that when run through my galaxy instance, the
 galaxy-relocated output file is as expected.

 Many thanks for your help.   I'm still getting my feet wet with
 galaxy, reading through all the documentation and searching the
 mailing list for additional help.

 best regards,

 -brian


 --
 --
 Brian J. Haas
 Manager, Genome Annotation and Analysis, Research and Development
 The Broad Institute
 http://broad.mit.edu/~bhaas http://broad.mit.edu/%7Ebhaas
 tool id=alignreads name=alignReads version=0.0.1

 descriptionalignReads: short read alignment tool
wrapper/description
 requirements
 requirement type=packagetrinity/requirement
 /requirements
 command

 alignReads.pl --target $target -o alignment --aligner
$aligner_selection.aligner


 ## Inputs.
 #if str($inputs.paired_or_single) == paired:
 --left $inputs.left_input --right $inputs.right_input
 #if  $inputs.left_input.ext == 'fa':
 --seqType fa
 #else:
 --seqType fq
 #end if
 #if str($inputs.library_type) != None:
 --SS_lib_type $inputs.library_type
 #end if
 

Re: [galaxy-dev] code example for improved error handling

2012-08-16 Thread Peter Cock
On Thu, Aug 16, 2012 at 8:02 PM, Birgit Crain
bcr...@completegenomics.com wrote:
 Hi

 I'm writing a tools for an executable that writes results to stdout and
 reports success message to stderr, so it really need the improved error
 handling. Is there any sample code or documentation available?

 Thanks

No documentation yet that I know of - I'm waiting too, but the
code to support this has been committed, see:
https://bitbucket.org/galaxy/galaxy-central/issue/325/

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


Re: [galaxy-dev] code example for improved error handling

2012-08-16 Thread Birgit Crain
No, I call the executable directly from the xml. It kept failing although it 
seemed to finish the job and I realized that on success the executable prints a 
summary message to stderror, because it's using stdout for the actual results 
so they can be pipped to another command.
From the July news brief I understood that you can now add code to the xml to 
check the stdout and std error for messages and I was wondering if you have 
any documentation or sample code for that in any published tool.

Thanks

Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete Genomics, 
Inc.
(650) 428-6023 office | (408) 605-3938 mobile
bcr...@completegenomics.commailto:bcr...@completegenomics.com


From: John Patterson jmpa...@g.uky.edumailto:jmpa...@g.uky.edu
Date: Thursday, August 16, 2012 12:29 PM
To: galaxy-dev@lists.bx.psu.edumailto:galaxy-dev@lists.bx.psu.edu 
galaxy-dev@lists.bx.psu.edumailto:galaxy-dev@lists.bx.psu.edu
Subject: Re: [galaxy-dev] code example for improved error handling

On 08/16/2012 03:02 PM, Birgit Crain wrote:
Hi

I'm writing a tools for an executable that writes results to stdout and reports 
success message to stderr, so it really need the improved error handling. Is 
there any sample code or documentation available?

Thanks

Birgit Crain, Ph.D. | Sr. Professional Services Scientist | Complete Genomics, 
Inc.
(650) 428-6023 office | (408) 605-3938 mobile
bcr...@completegenomics.commailto:bcr...@completegenomics.com


From: Nicole Rockweiler n.rockwei...@gmail.commailto:n.rockwei...@gmail.com
Date: Friday, July 20, 2012 10:53 AM
To: Brian Haas bh...@broadinstitute.orgmailto:bh...@broadinstitute.org
Cc: galaxy-...@bx.psu.edumailto:galaxy-...@bx.psu.edu 
galaxy-...@bx.psu.edumailto:galaxy-...@bx.psu.edu
Subject: Re: [galaxy-dev] pipeline execution succeeds but galaxy shows failure

Hi Brian,

A couple of days ago, smcmanushttps://bitbucket.org/smcmanus pushed the 
following change to the repo:

Tools can now specify their own handling of stderr and stdout regular 
expressions as well as exit code ranges.

https://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-decide-whether-to-use-return-codes-or-stderr-for-detecting-job

It looks like the documentation has yet to be written.


Hope this helps,
Nicole

On Fri, Jul 20, 2012 at 12:46 PM, Brad Chapman 
chapm...@50mail.commailto:chapm...@50mail.com wrote:

Brian;

 I wrote a pipeline (xml attached) that, from what I can gather,
 succeeds, but galaxy shows it as an error and doesn't make the output
 file accessible as a new data set.

Is it possible the software is writing to standard error? Galaxy doesn't
check status codes, but rather check for stderr and assumes that output
indicates a problem. You can wrap the problematic programs with a little
script to eat up stderr and check that everything is okay:

http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr

Brad



From the server log, I can see that the command line is being
 constructed correctly, and it even indicates that it's captured the
 output, but in the display of the web browser, it just shows up in the
 error state.   The script being run exits (0) on success.  Any ideas?

 Here's what the output section of my xml file looks like:

 outputs
 data format=bam name=coordSortedBam 
 label=${tool.namehttp://tool.name}
 on ${on_string}: coord-sorted read alignments
 from_work_dir=alignment/alignment.coordSorted.bam/
 /outputs

 and here's what the server log states:

 galaxy.jobs.handler INFO 2012-07-20 09:52:05,240 (30) Job dispatched
 galaxy.jobs.runners.local DEBUG 2012-07-20 09:52:05,453 executing:
 alignReads.pl --target
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_26.dat
 -o alignment --aligner bowtie --single
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_23.dat
   --seqType fq

 galaxy.jobshttp://galaxy.jobs DEBUG 2012-07-20 09:52:16,673 finish(): Moved
 /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/job_working_directory/000/30/alignment/alignment.coordSorted.bam
 to /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_50.dat
 as directed by from_work_dir

 Again, as far as I can tell, everything worked - but the browser
 doesn't think so.

 I've run the exact command above on the command-line, and it exits(0)
 indicating success.
 Also, I've verified that when run through my galaxy instance, the
 galaxy-relocated output file is as expected.

 Many thanks for your help.   I'm still getting my feet wet with
 galaxy, reading through all the documentation and searching the
 mailing list for additional help.

 best regards,

 -brian


 --
 --
 Brian J. Haas
 Manager, Genome Annotation and Analysis, Research and Development
 The Broad Institute
 http://broad.mit.edu/~bhaashttp://broad.mit.edu/%7Ebhaas
 tool id=alignreads name=alignReads version=0.0.1

 descriptionalignReads: short read alignment tool wrapper/description
 requirements
 requirement type=packagetrinity