Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-11-18 Thread Peter Cock
On Sun, Nov 17, 2013 at 8:30 AM, John Chilton wrote:
 On Thu, Apr 25, 2013 at 9:36 AM, Peter Cock wrote:
 ...

 As noted in my last email, for some reason when running the test case,
 the input FASTA file is being included on the command line TWICE.
 Curiously the -hash_index argument has been omitted. Linked maybe?

 Peter,

 I have fixed the double listing of the FASTA file. Putting min=1 on a
 repeat statement would result in two repeat instances when using
 functional tests without this bug fix.

 https://bitbucket.org/galaxy/galaxy-central/commits/5e534cc8da856ad598d63b8b9f03fe20629df05f

Thank you - such a little thing once you'd traced its cause.

 It is likely also the problem with your mira tests?


This should help for the MIRA4 tests too :)

 The hash_index
 missing was caused because to the param value you put in the test tag
 should be true or false, not the truevalue/falsevalue attributes as
 far as I can tell - those are used only by cheetah I guess. Adding the
 hash_index parameter creates and additional 5 files - including ones
 you listed in your test case.

I think I tried that too (true/false), but it was a while ago now. Hitting
multiple test framework issues at the same time made debugging
this hard.

 With these change, I was able to write working functional tests for
 your tool using the template you outlined in the Trello card. The .pin
 file doesn't match, I think there is something time-based in there so
 I had to set two lines of diff.

Yes, I agree the PIN file varies run to run, so the diff trick looks good.

 Also, since this e-mail, you now have
 two parameters named file, that doesn't go over well yet - so I
 renamed mask|file to mask|mask_file.

The makeblastdb wrapper on the main Tool Shed don't yet
have the masking file parameter, but does already on the
Test Tool Shed - so I'd prefer not to change this:
http://toolshed.g2.bx.psu.edu/view/devteam/ncbi_blast_plus
http://testtoolshed.g2.bx.psu.edu/view/devteam/ncbi_blast_plus

In principle the pipe-based fully specified parameter name
would work here too, to resolve the potential ambiguity?
(That is a separate Trello Card for handling potentially
ambiguous parameters in the test framework):
https://trello.com/c/zSTrfDOB/820-disambiguated-conditional-parameters-not-supported-in-functional-tests

 ...

 These changes should work right out of central, does not utilize my
 API driven variant on github.

 I discovered no problems with auto_primary versus basic composite
 types here, just the things listed above.

Not for me though, even if I rename the masking file param to
avoid the ambiguous file parameters, commits here:
https://github.com/peterjc/galaxy_blast/commit/2043cc813c2e138d93f8a940ea711ad7538a50c7
https://github.com/peterjc/galaxy_blast/commit/f4f74cd065921b069499a5fcc4209b299a403c96
and continuing on this branch:
https://github.com/peterjc/galaxy_blast/tree/test_makeblastdb
https://github.com/peterjc/galaxy_blast/commit/e828543539ab0a0ca8f8b16dbdce132812605282

That gave:

$ ./run_functional_tests.sh -id ncbi_makeblastdb
...
galaxy.jobs.runners.local DEBUG 2013-11-18 11:25:38,449 execution
finished: export GALAXY_SLOTS=1; makeblastdb -version 
/tmp/tmpF81TF5/tmpghF4ik/new_files_path_lVhJ4E/GALAXY_VERSION_STRING_2;
makeblastdb -out
/tmp/tmpF81TF5/tmpghF4ik/database/files/000/dataset_2_files/blastdb
-hash_index -in 
/tmp/tmpF81TF5/tmpghF4ik/database/files/000/dataset_1.dat
/tmp/tmpF81TF5/tmpghF4ik/database/files/000/dataset_1.dat  -title
Just 4 human proteins -dbtype prot
...
Composite file (blastdb.phr) of History item 2 different than
expected, difference (using diff):
Binary data detected, not displaying diff
...
FAILED (failures=1)
...

I find that changing the order of the extra_files tags in the test seems
to alter the failure - which supports my hunch that something is
scrambling the order of the extra files, so that it fails to compare the
generated blastdb.phr with the provided four_human_proteins.fasta.phd

e.g. Here it seems to compare to the (place holder) text I generate
when viewing a database in the Galaxy interface:
https://github.com/peterjc/galaxy_blast/commit/e828543539ab0a0ca8f8b16dbdce132812605282

$ ./run_functional_tests.sh -id ncbi_makeblastdb
...
galaxy.jobs.runners.local DEBUG 2013-11-18 12:23:24,812 execution
finished: export GALAXY_SLOTS=1; python
/mnt/galaxy/galaxy-central/tools/data_source/upload.py
/mnt/galaxy/galaxy-central
/tmp/tmph0YlBO/tmpRK7bhO/new_files_path_0SO6J0/tmpkPWlQd
/tmp/tmph0YlBO/tmpRK7bhO/new_files_path_0SO6J0/tmpr_xBCK
1:/tmp/tmph0YlBO/tmpRK7bhO/job_working_directory_Qh_YcY/000/1/dataset_1_files:/tmp/tmph0YlBO/tmpRK7bhO/database/files/000/dataset_1.dat
...
Composite file (blastdb.phd) of History item 2 different than
expected, difference (using diff):
--- local_file
+++ history_data
@@ -1,4 +1,1 @@
-7184492
-29249033410
-36665887501
-5392473183
+This is a BLAST protein database.
...
FAILED (failures=1)
...

If it works for you then perhaps the filesystem is a 

Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-11-18 Thread Peter Cock
On Mon, Nov 18, 2013 at 12:35 PM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Sun, Nov 17, 2013 at 8:30 AM, John Chilton wrote:
 With these change, I was able to write working functional tests for
 your tool using the template you outlined in the Trello card. ...
 I discovered no problems with auto_primary versus basic composite
 types here, just the things listed above.

 Not for me though, even if I rename the masking file param to
 avoid the ambiguous file parameters ...

 I find that changing the order of the extra_files tags in the test seems
 to alter the failure - which supports my hunch that something is
 scrambling the order of the extra files, so that it fails to compare the
 generated blastdb.phr with the provided four_human_proteins.fasta.phd

John's replies via Twitter:

https://twitter.com/jmchilton/status/402436500131807232
 @pjacock Hard to argue with @travisci but your makeblastdb
 test works unmodified on my box and I can reorder the extras.
 I'm still looking..

https://twitter.com/jmchilton/status/402446372231581696
 @pjacock Got it, you are overriding display_data in blast DB
 datatypes. This breaks much! Is how the test framework/API/etc
 access datasets.

There may be trouble ahead... the current display_data override
is to give some meaningful output to the user when they click
the eye ball icon for a BLAST database - rather than something
unhelpful and scary like a blank page.

A more slick option would be to override display_data to run
blastdbcmd live, but that means a run time dependency of the
datatype definition on (a specific version of) the BLAST+ binaries
- which could be problematic.

I had considered capturing the makeblastdb stdout to a file as
blastdb.log and having that as the (human viewable) primary
file of a composite datatype - but that would cause trouble if and
when I manage to support user uploaded BLAST databases.

Thanks,

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-11-18 Thread John Chilton
On Mon, Nov 18, 2013 at 9:55 AM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Mon, Nov 18, 2013 at 12:35 PM, Peter Cock p.j.a.c...@googlemail.com 
 wrote:
 On Sun, Nov 17, 2013 at 8:30 AM, John Chilton wrote:
 With these change, I was able to write working functional tests for
 your tool using the template you outlined in the Trello card. ...
 I discovered no problems with auto_primary versus basic composite
 types here, just the things listed above.

 Not for me though, even if I rename the masking file param to
 avoid the ambiguous file parameters ...

 I find that changing the order of the extra_files tags in the test seems
 to alter the failure - which supports my hunch that something is
 scrambling the order of the extra files, so that it fails to compare the
 generated blastdb.phr with the provided four_human_proteins.fasta.phd

 John's replies via Twitter:

 https://twitter.com/jmchilton/status/402436500131807232
 @pjacock Hard to argue with @travisci but your makeblastdb
 test works unmodified on my box and I can reorder the extras.
 I'm still looking..

 https://twitter.com/jmchilton/status/402446372231581696
 @pjacock Got it, you are overriding display_data in blast DB
 datatypes. This breaks much! Is how the test framework/API/etc
 access datasets.

 There may be trouble ahead... the current display_data override
 is to give some meaningful output to the user when they click
 the eye ball icon for a BLAST database - rather than something
 unhelpful and scary like a blank page.

I didn't implement any of this composite dataset stuff so I am just
guessing on best practices here, but is the right thing to do here
switch from 'basic' to 'auto_primary_file' ? Just generate a file that
just includes the content you want to display and set that as the
primary file - I think this might be better practice than overriding
display_data. If you want that file to a log if it is available that
is fine, if files are uploaded an optional log could be available and
you can provide a default fallback if unavailable in
generate_primary_file/regenerate_primary_file. If you do insist on
overriding display data, than you should at least allow fallback to
what the super class would do if (filename and filename != 'index').

-John


 A more slick option would be to override display_data to run
 blastdbcmd live, but that means a run time dependency of the
 datatype definition on (a specific version of) the BLAST+ binaries
 - which could be problematic.

 I had considered capturing the makeblastdb stdout to a file as
 blastdb.log and having that as the (human viewable) primary
 file of a composite datatype - but that would cause trouble if and
 when I manage to support user uploaded BLAST databases.

 Thanks,

 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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-11-18 Thread Peter Cock
On Mon, Nov 18, 2013 at 4:02 PM, John Chilton chil...@msi.umn.edu wrote:
 On Mon, Nov 18, 2013 at 9:55 AM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Mon, Nov 18, 2013 at 12:35 PM, Peter Cock p.j.a.c...@googlemail.com 
 wrote:
 On Sun, Nov 17, 2013 at 8:30 AM, John Chilton wrote:
 With these change, I was able to write working functional tests for
 your tool using the template you outlined in the Trello card. ...
 I discovered no problems with auto_primary versus basic composite
 types here, just the things listed above.

 Not for me though, even if I rename the masking file param to
 avoid the ambiguous file parameters ...

 I find that changing the order of the extra_files tags in the test seems
 to alter the failure - which supports my hunch that something is
 scrambling the order of the extra files, so that it fails to compare the
 generated blastdb.phr with the provided four_human_proteins.fasta.phd

 John's replies via Twitter:

 https://twitter.com/jmchilton/status/402436500131807232
 @pjacock Hard to argue with @travisci but your makeblastdb
 test works unmodified on my box and I can reorder the extras.
 I'm still looking..

 https://twitter.com/jmchilton/status/402446372231581696
 @pjacock Got it, you are overriding display_data in blast DB
 datatypes. This breaks much! Is how the test framework/API/etc
 access datasets.

 There may be trouble ahead... the current display_data override
 is to give some meaningful output to the user when they click
 the eye ball icon for a BLAST database - rather than something
 unhelpful and scary like a blank page.

 I didn't implement any of this composite dataset stuff so I am just
 guessing on best practices here, but is the right thing to do here
 switch from 'basic' to 'auto_primary_file' ? Just generate a file that
 just includes the content you want to display and set that as the
 primary file - I think this might be better practice than overriding
 display_data. If you want that file to a log if it is available that
 is fine, if files are uploaded an optional log could be available and
 you can provide a default fallback if unavailable in
 generate_primary_file/regenerate_primary_file. If you do insist on
 overriding display data, than you should at least allow fallback to
 what the super class would do if (filename and filename != 'index').


I see, so my (dummy) primary file could just a small text file
saying This is a BLAST protein database. or similar - and
that would let me reproduce the current behaviour?

The only possible downside I can see right now is wondering
what happens to existing histories containing old BLAST
databases created with the current code... but that will sort
itself out eventually with some user inconvenience.

Who is the composite file architect (for their thoughts)?

Regards,

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-11-17 Thread John Chilton
On Thu, Apr 25, 2013 at 9:36 AM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Fri, Apr 5, 2013 at 3:08 PM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Thu, Apr 4, 2013 at 7:19 PM, Daniel Blankenberg d...@bx.psu.edu wrote:
 Hi Peter,

 What is the test error given when you do have a value defined for name in 
 output?


 Can you try using 'empty_file.dat'?

 e.g.

output name=out_file file=empty_file.dat 

 or

 output name=out_file file=empty_file.dat compare=contains

 etc

 Hi Daniel,

 That seems to help (plus fixing a typo in one of my child file extensions).
 However there is something else amiss, but my Galaxy is a little out of date:

 ...

 I will have to checkout the latest Galaxy code and retest in case this
 is something already fixed...

 OK, I've updated to the latest galaxy-central default branch. Here's
 the slightly revised test for ncbi_makeblastdb.xml,

 tests
 test
 !-- makeblastdb -in four_human_proteins.fasta -dbtype prot
 -hash_index -title Just 4 human proteins -out
 four_human_proteins.fasta --
 param name=dbtype value=prot/
 param name=file value=four_human_proteins.fasta/
 param name=title value=Just 4 human proteins/
 param name=parse_seqids value=/
 param name=hash_index value=-hash_index/
 output name=out_file file=empty_file.dat ftype=blastdbp
 extra_files type=file
 value=four_human_proteins.fasta.phd name=blastdb.pdb/
 extra_files type=file
 value=four_human_proteins.fasta.phi name=blastdb.phi/
 extra_files type=file
 value=four_human_proteins.fasta.phr name=blastdb.phr/
 extra_files type=file
 value=four_human_proteins.fasta.pin name=blastdb.pin/
 extra_files type=file
 value=four_human_proteins.fasta.pog name=blastdb.pog/
 extra_files type=file
 value=four_human_proteins.fasta.psd name=blastdb.psd/
 extra_files type=file
 value=four_human_proteins.fasta.psi name=blastdb.psi/
 extra_files type=file
 value=four_human_proteins.fasta.psq name=blastdb.psq/
 /output
 /test
 /tests

 Here's some of the Galaxy log when I run this example manually through the
 web interface:

 galaxy.jobs.handler INFO 2013-04-25 15:17:43,820 (43) Job dispatched
 galaxy.jobs.runners.local DEBUG 2013-04-25 15:17:44,377 (43)
 executing: makeblastdb -version 
 /mnt/galaxy/galaxy-central/database/tmp/GALAXY_VERSION_STRING_43;
 makeblastdb -out
 /mnt/galaxy/galaxy-central/database/files/000/dataset_46_files/blastdb
  -hash_index -in 
 /mnt/galaxy/galaxy-central/database/files/000/dataset_45.dat   -title
 Just 4 human proteins -dbtype prot
 galaxy.jobs DEBUG 2013-04-25 15:17:44,436 (43) Persisting job
 destination (destination id: local:///)
 galaxy.jobs.runners.local DEBUG 2013-04-25 15:17:44,751 execution
 finished: makeblastdb -version 
 /mnt/galaxy/galaxy-central/database/tmp/GALAXY_VERSION_STRING_43;
 makeblastdb -out
 /mnt/galaxy/galaxy-central/database/files/000/dataset_46_files/blastdb
  -hash_index -in 
 /mnt/galaxy/galaxy-central/database/files/000/dataset_45.dat   -title
 Just 4 human proteins -dbtype prot
 galaxy.jobs DEBUG 2013-04-25 15:17:45,456 job 43 ended

 Now a snippets from the test run (unedited version at end of email).

 $ ./run_functional_tests.sh -id ncbi_makeblastdb
 ...
 galaxy.jobs.handler DEBUG 2013-04-25 15:12:44,214 (2) Dispatching to
 local runner
 galaxy.jobs DEBUG 2013-04-25 15:12:45,599 (2) Persisting job
 destination (destination id: local:///)
 galaxy.jobs.handler INFO 2013-04-25 15:12:45,711 (2) Job dispatched
 galaxy.jobs.runners.local DEBUG 2013-04-25 15:12:46,345 (2) executing:
 makeblastdb -version 
 /tmp/tmpovUM3w/database/tmp/GALAXY_VERSION_STRING_2; makeblastdb -out
 /tmp/tmpovUM3w/database/files/000/dataset_2_files/blastdb   -in 
 /tmp/tmpovUM3w/database/files/000/dataset_1.dat
 /tmp/tmpovUM3w/database/files/000/dataset_1.dat   -title Just 4
 human proteins -dbtype prot
 galaxy.jobs DEBUG 2013-04-25 15:12:46,409 (2) Persisting job
 destination (destination id: local:///)
 galaxy.jobs.runners.local DEBUG 2013-04-25 15:12:46,897 execution
 finished: makeblastdb -version 
 /tmp/tmpovUM3w/database/tmp/GALAXY_VERSION_STRING_2; makeblastdb -out
 /tmp/tmpovUM3w/database/files/000/dataset_2_files/blastdb   -in 
 /tmp/tmpovUM3w/database/files/000/dataset_1.dat
 /tmp/tmpovUM3w/database/files/000/dataset_1.dat   -title Just 4
 human proteins -dbtype prot
 galaxy.jobs DEBUG 2013-04-25 15:12:47,502 job 2 ended
 ...

 As noted in my last email, for some reason when running the test case,
 the input FASTA file is being included on the command line TWICE.
 Curiously the -hash_index argument has been omitted. Linked maybe?

Peter,

I have fixed the double listing of the FASTA file. Putting min=1 on a
repeat statement would result in two repeat instances when using
functional tests without this bug fix.


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-07-10 Thread Peter Cock
On Tue, Apr 30, 2013 at 4:30 PM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Thu, Apr 25, 2013 at 3:36 PM, Peter Cock p.j.a.c...@googlemail.com wrote:

 OK, I've updated to the latest galaxy-central default branch. Here's
 the slightly revised test for ncbi_makeblastdb.xml,

 ...

 In the absence of any fresh feedback, I've filed an issue on Trello for this
 to make sure it gets tracked:

 https://trello.com/card/basic-composite-datatypes-not-working-as-test-outputs/506338ce32ae458f6d15e4b3/819
 Composite datatypes like HTML seem to work (with a primary file).
 Basic composite datatypes seem not to work (with no primary file).

 Regards,

 Peter

Hi guys,

Has anything changed in this area of the test framework since April?

Thanks,

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-04-30 Thread Peter Cock
On Thu, Apr 25, 2013 at 3:36 PM, Peter Cock p.j.a.c...@googlemail.com wrote:

 OK, I've updated to the latest galaxy-central default branch. Here's
 the slightly revised test for ncbi_makeblastdb.xml,

 ...

In the absence of any fresh feedback, I've filed an issue on Trello for this
to make sure it gets tracked:

https://trello.com/card/basic-composite-datatypes-not-working-as-test-outputs/506338ce32ae458f6d15e4b3/819
Composite datatypes like HTML seem to work (with a primary file).
Basic composite datatypes seem not to work (with no primary file).

Regards,

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-04-25 Thread Peter Cock
On Fri, Apr 5, 2013 at 3:08 PM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Thu, Apr 4, 2013 at 7:19 PM, Daniel Blankenberg d...@bx.psu.edu wrote:
 Hi Peter,

 What is the test error given when you do have a value defined for name in 
 output?


 Can you try using 'empty_file.dat'?

 e.g.

output name=out_file file=empty_file.dat 

 or

 output name=out_file file=empty_file.dat compare=contains

 etc

 Hi Daniel,

 That seems to help (plus fixing a typo in one of my child file extensions).
 However there is something else amiss, but my Galaxy is a little out of date:

 ...

 I will have to checkout the latest Galaxy code and retest in case this
 is something already fixed...

OK, I've updated to the latest galaxy-central default branch. Here's
the slightly revised test for ncbi_makeblastdb.xml,

tests
test
!-- makeblastdb -in four_human_proteins.fasta -dbtype prot
-hash_index -title Just 4 human proteins -out
four_human_proteins.fasta --
param name=dbtype value=prot/
param name=file value=four_human_proteins.fasta/
param name=title value=Just 4 human proteins/
param name=parse_seqids value=/
param name=hash_index value=-hash_index/
output name=out_file file=empty_file.dat ftype=blastdbp
extra_files type=file
value=four_human_proteins.fasta.phd name=blastdb.pdb/
extra_files type=file
value=four_human_proteins.fasta.phi name=blastdb.phi/
extra_files type=file
value=four_human_proteins.fasta.phr name=blastdb.phr/
extra_files type=file
value=four_human_proteins.fasta.pin name=blastdb.pin/
extra_files type=file
value=four_human_proteins.fasta.pog name=blastdb.pog/
extra_files type=file
value=four_human_proteins.fasta.psd name=blastdb.psd/
extra_files type=file
value=four_human_proteins.fasta.psi name=blastdb.psi/
extra_files type=file
value=four_human_proteins.fasta.psq name=blastdb.psq/
/output
/test
/tests

Here's some of the Galaxy log when I run this example manually through the
web interface:

galaxy.jobs.handler INFO 2013-04-25 15:17:43,820 (43) Job dispatched
galaxy.jobs.runners.local DEBUG 2013-04-25 15:17:44,377 (43)
executing: makeblastdb -version 
/mnt/galaxy/galaxy-central/database/tmp/GALAXY_VERSION_STRING_43;
makeblastdb -out
/mnt/galaxy/galaxy-central/database/files/000/dataset_46_files/blastdb
 -hash_index -in 
/mnt/galaxy/galaxy-central/database/files/000/dataset_45.dat   -title
Just 4 human proteins -dbtype prot
galaxy.jobs DEBUG 2013-04-25 15:17:44,436 (43) Persisting job
destination (destination id: local:///)
galaxy.jobs.runners.local DEBUG 2013-04-25 15:17:44,751 execution
finished: makeblastdb -version 
/mnt/galaxy/galaxy-central/database/tmp/GALAXY_VERSION_STRING_43;
makeblastdb -out
/mnt/galaxy/galaxy-central/database/files/000/dataset_46_files/blastdb
 -hash_index -in 
/mnt/galaxy/galaxy-central/database/files/000/dataset_45.dat   -title
Just 4 human proteins -dbtype prot
galaxy.jobs DEBUG 2013-04-25 15:17:45,456 job 43 ended

Now a snippets from the test run (unedited version at end of email).

$ ./run_functional_tests.sh -id ncbi_makeblastdb
...
galaxy.jobs.handler DEBUG 2013-04-25 15:12:44,214 (2) Dispatching to
local runner
galaxy.jobs DEBUG 2013-04-25 15:12:45,599 (2) Persisting job
destination (destination id: local:///)
galaxy.jobs.handler INFO 2013-04-25 15:12:45,711 (2) Job dispatched
galaxy.jobs.runners.local DEBUG 2013-04-25 15:12:46,345 (2) executing:
makeblastdb -version 
/tmp/tmpovUM3w/database/tmp/GALAXY_VERSION_STRING_2; makeblastdb -out
/tmp/tmpovUM3w/database/files/000/dataset_2_files/blastdb   -in 
/tmp/tmpovUM3w/database/files/000/dataset_1.dat
/tmp/tmpovUM3w/database/files/000/dataset_1.dat   -title Just 4
human proteins -dbtype prot
galaxy.jobs DEBUG 2013-04-25 15:12:46,409 (2) Persisting job
destination (destination id: local:///)
galaxy.jobs.runners.local DEBUG 2013-04-25 15:12:46,897 execution
finished: makeblastdb -version 
/tmp/tmpovUM3w/database/tmp/GALAXY_VERSION_STRING_2; makeblastdb -out
/tmp/tmpovUM3w/database/files/000/dataset_2_files/blastdb   -in 
/tmp/tmpovUM3w/database/files/000/dataset_1.dat
/tmp/tmpovUM3w/database/files/000/dataset_1.dat   -title Just 4
human proteins -dbtype prot
galaxy.jobs DEBUG 2013-04-25 15:12:47,502 job 2 ended
...

As noted in my last email, for some reason when running the test case,
the input FASTA file is being included on the command line TWICE.
Curiously the -hash_index argument has been omitted. Linked maybe?

And then once this has run, as before, the file comparison is hard to
fathom (it is not comparing the correct files to each other).

The example rgClean.xml which Dave Bouvier pointed me at uses
a composite datatypes with a central file ('pbed' which is a subclass
of 'html') while the other examples I've found are 'html'.
i.e. composite_type='auto_primary_file'

It does seem likely at this point that I could be the first 

Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-04-05 Thread Peter Cock
On Thu, Apr 4, 2013 at 7:19 PM, Daniel Blankenberg d...@bx.psu.edu wrote:
 Hi Peter,

 What is the test error given when you do have a value defined for name in 
 output?


 Can you try using 'empty_file.dat'?

 e.g.

output name=out_file file=empty_file.dat 

 or

 output name=out_file file=empty_file.dat compare=contains

 etc

Hi Daniel,

That seems to help (plus fixing a typo in one of my child file extensions).
However there is something else amiss, but my Galaxy is a little out of date:

  begin captured logging  
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:9486/
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:9486/
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:9486/user/logout
galaxy.web.framework: DEBUG: Error: this request returned None from
get_history(): http://localhost:9486/
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:
/mnt/galaxy/galaxy-central/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: Local runner: starting job 1
galaxy.jobs.runners.local: DEBUG: executing: python
/mnt/galaxy/galaxy-central/tools/data_source/upload.py
/mnt/galaxy/galaxy-central /tmp/tmpOBsw3s/database/tmp/tmpshAqc4
/tmp/tmpOBsw3s/database/tmp/tmpjPyydZ
1:/mnt/galaxy/galaxy-central/database/job_working_directory/000/1/dataset_1_files:/tmp/tmpOBsw3s/database/files/000/dataset_1.dat
galaxy.jobs.runners.local: DEBUG: execution finished: python
/mnt/galaxy/galaxy-central/tools/data_source/upload.py
/mnt/galaxy/galaxy-central /tmp/tmpOBsw3s/database/tmp/tmpshAqc4
/tmp/tmpOBsw3s/database/tmp/tmpjPyydZ
1:/mnt/galaxy/galaxy-central/database/job_working_directory/000/1/dataset_1_files:/tmp/tmpOBsw3s/database/files/000/dataset_1.dat
galaxy.jobs: DEBUG: Tool did not define exit code or stdio handling;
checking stderr for success
galaxy.jobs: DEBUG: job 1 ended
galaxy.jobs.manager: DEBUG: (2) Job assigned to handler 'main'
galaxy.jobs: DEBUG: (2) Working directory for job is:
/mnt/galaxy/galaxy-central/database/job_working_directory/000/2
galaxy.jobs.handler: DEBUG: dispatching job 2 to local runner
galaxy.jobs.handler: INFO: (2) Job dispatched
galaxy.jobs.runners.local: DEBUG: Local runner: starting job 2
galaxy.jobs.runners.local: DEBUG: executing: makeblastdb -version 
/tmp/tmpOBsw3s/database/tmp/GALAXY_VERSION_STRING_2; makeblastdb -out
/tmp/tmpOBsw3s/database/files/000/dataset_2_files/blastdb   -in 
/tmp/tmpOBsw3s/database/files/000/dataset_1.dat
/tmp/tmpOBsw3s/database/files/000/dataset_1.dat   -title Just 4
human proteins -dbtype prot
galaxy.jobs.runners.local: DEBUG: execution finished: makeblastdb
-version  /tmp/tmpOBsw3s/database/tmp/GALAXY_VERSION_STRING_2;
makeblastdb -out
/tmp/tmpOBsw3s/database/files/000/dataset_2_files/blastdb   -in 
/tmp/tmpOBsw3s/database/files/000/dataset_1.dat
/tmp/tmpOBsw3s/database/files/000/dataset_1.dat   -title Just 4
human proteins -dbtype prot
galaxy.tools: DEBUG: Error opening galaxy.json file: [Errno 2] No such
file or directory:
'/mnt/galaxy/galaxy-central/database/job_working_directory/000/2/galaxy.json'
galaxy.jobs: DEBUG: job 2 ended
base.twilltestcase: INFO: ## files diff
/mnt/galaxy/galaxy-central/test-data/four_human_proteins.fasta.phd (51
bytes, 4 lines) and /tmp/tmpOBsw3s/database/tmp/tmpPaxnAGblastdb.phd
(33 bytes, 1 lines)
base.twilltestcase: INFO: ## file
/mnt/galaxy/galaxy-central/test-data/four_human_proteins.fasta.phd
line 1 is '718449\x022\n'
base.twilltestcase: INFO: ## file
/mnt/galaxy/galaxy-central/test-data/four_human_proteins.fasta.phd
line 2 is '2924903341\x020\n'
base.twilltestcase: INFO: ## file
/mnt/galaxy/galaxy-central/test-data/four_human_proteins.fasta.phd
line 3 is '3666588750\x021\n'
base.twilltestcase: INFO: ## file
/mnt/galaxy/galaxy-central/test-data/four_human_proteins.fasta.phd
line 4 is '539247318\x023\n'
base.twilltestcase: INFO: ## file
/tmp/tmpOBsw3s/database/tmp/tmpPaxnAGblastdb.phd line 1 is 'This is a
BLAST protein database.'
base.twilltestcase: INFO: ## sibling files to
/tmp/tmpOBsw3s/database/tmp/tmpPaxnAGblastdb.phd in same directory:
base.twilltestcase: INFO: ## sibling file: tmpUMWHqD
base.twilltestcase: INFO: ## sibling file: twilltestcase-MDnhZ1.html
base.twilltestcase: INFO: ## sibling file: twilltestcase-_vAVc9.html
base.twilltestcase: INFO: ## sibling file: tmpyiy0Kvempty_file.dat
base.twilltestcase: INFO: ## sibling file: twilltestcase-MHWm9w.html
base.twilltestcase: INFO: ## sibling file: tmpPaxnAGblastdb.phd
base.twilltestcase: INFO: ## sibling file: twilltestcase-dVKyqw.html
base.twilltestcase: INFO: ## sibling file: tmpshAqc4

Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-04-04 Thread Peter Cock
On Wed, Apr 3, 2013 at 2:48 PM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Wed, Apr 3, 2013 at 2:37 PM, Dave Bouvier d...@bx.psu.edu wrote:
 For the outputs, rgClean.xml provides an example of comparing a
 composite output dataset with the expected test data.

 Here there is a tag extra_files used within the output tag.

 Many thanks Dave - those should be enough to get me started, and
 maybe I can update the wiki once I'm happy with how this works...

I'm trying this for makeblastdb which produces a single output,
a composite datatype which is a BLAST database.

The examples I found all seemed to be composite datatypes with
a central file (e.g. HTML plus images), i.e.
composite_type='auto_primary_file'

In the case of the BLAST databases, this is a composite datatype
without a primary file, aka composite_type='basic'. Leaving the
param without a file gives:

Exception: Test output does not have a 'file'

Using a empty value doesn't work,

Traceback (most recent call last):
  File /mnt/galaxy/galaxy-central/test/functional/test_toolbox.py,
line 171, in test_tool
self.do_it( td, shed_tool_id=shed_tool_id )
  File /mnt/galaxy/galaxy-central/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 /mnt/galaxy/galaxy-central/test/base/twilltestcase.py, line
828, in verify_dataset_correctness
self.files_diff( local_name, temp_name, attributes=attributes )
  File /mnt/galaxy/galaxy-central/test/base/twilltestcase.py, line
66, in files_diff
local_file = open( file1, 'U' ).readlines()
IOError: [Errno 21] Is a directory: '/mnt/galaxy/galaxy-central/test-data'

Using /dev/null gets a bit further but something is confusing the
comparisons.

My current experimental test looks like this:

tests
test
param name=dbtype value=prot/
param name=file value=four_human_proteins.fasta/
param name=title value=Just 4 human proteins/
param name=parse_seqids value=/
param name=hash_index value=-hash_index/
output name=out_file file=/dev/null ftype=blastdbp
extra_files type=file
value=four_human_proteins.fasta.phd name=blastdb.pdb/
extra_files type=file
value=four_human_proteins.fasta.phi name=blastdb.phi/
extra_files type=file
value=four_human_proteins.fasta.phr name=blastdb.phr/
extra_files type=file
value=four_human_proteins.fasta.pin name=blastdb.pin/
extra_files type=file
value=four_human_proteins.fasta.pog name=blastdb.pog/
extra_files type=file
value=four_human_proteins.fasta.psd name=blastdb.psd/
extra_files type=file
value=four_human_proteins.fasta.psi name=blastdb.psi/
extra_files type=file
value=four_human_proteins.fasta.psq name=blastdb.psq/
/output
/test
/tests

Any advice?

Thanks,

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-04-04 Thread Daniel Blankenberg
Hi Peter,

What is the test error given when you do have a value defined for name in 
output?


Can you try using 'empty_file.dat'?

e.g.

   output name=out_file file=empty_file.dat 

or

output name=out_file file=empty_file.dat compare=contains

etc




Thanks for using Galaxy,


Dan


On Apr 4, 2013, at 1:34 PM, Peter Cock wrote:

 On Wed, Apr 3, 2013 at 2:48 PM, Peter Cock p.j.a.c...@googlemail.com wrote:
 On Wed, Apr 3, 2013 at 2:37 PM, Dave Bouvier d...@bx.psu.edu wrote:
 For the outputs, rgClean.xml provides an example of comparing a
 composite output dataset with the expected test data.
 
 Here there is a tag extra_files used within the output tag.
 
 Many thanks Dave - those should be enough to get me started, and
 maybe I can update the wiki once I'm happy with how this works...
 
 I'm trying this for makeblastdb which produces a single output,
 a composite datatype which is a BLAST database.
 
 The examples I found all seemed to be composite datatypes with
 a central file (e.g. HTML plus images), i.e.
 composite_type='auto_primary_file'
 
 In the case of the BLAST databases, this is a composite datatype
 without a primary file, aka composite_type='basic'. Leaving the
 param without a file gives:
 
 Exception: Test output does not have a 'file'
 
 Using a empty value doesn't work,
 
 Traceback (most recent call last):
  File /mnt/galaxy/galaxy-central/test/functional/test_toolbox.py,
 line 171, in test_tool
self.do_it( td, shed_tool_id=shed_tool_id )
  File /mnt/galaxy/galaxy-central/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 /mnt/galaxy/galaxy-central/test/base/twilltestcase.py, line
 828, in verify_dataset_correctness
self.files_diff( local_name, temp_name, attributes=attributes )
  File /mnt/galaxy/galaxy-central/test/base/twilltestcase.py, line
 66, in files_diff
local_file = open( file1, 'U' ).readlines()
 IOError: [Errno 21] Is a directory: '/mnt/galaxy/galaxy-central/test-data'
 
 Using /dev/null gets a bit further but something is confusing the
 comparisons.
 
 My current experimental test looks like this:
 
 tests
test
param name=dbtype value=prot/
param name=file value=four_human_proteins.fasta/
param name=title value=Just 4 human proteins/
param name=parse_seqids value=/
param name=hash_index value=-hash_index/
output name=out_file file=/dev/null ftype=blastdbp
extra_files type=file
 value=four_human_proteins.fasta.phd name=blastdb.pdb/
extra_files type=file
 value=four_human_proteins.fasta.phi name=blastdb.phi/
extra_files type=file
 value=four_human_proteins.fasta.phr name=blastdb.phr/
extra_files type=file
 value=four_human_proteins.fasta.pin name=blastdb.pin/
extra_files type=file
 value=four_human_proteins.fasta.pog name=blastdb.pog/
extra_files type=file
 value=four_human_proteins.fasta.psd name=blastdb.psd/
extra_files type=file
 value=four_human_proteins.fasta.psi name=blastdb.psi/
extra_files type=file
 value=four_human_proteins.fasta.psq name=blastdb.psq/
/output
/test
 /tests
 
 Any advice?
 
 Thanks,
 
 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/
 
 To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


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


[galaxy-dev] Tool unit tests using composite datatypes

2013-04-03 Thread Peter Cock
Hello all,

I'd like to be able to write some simple test entries for
some of the BLAST+ tools using composite datatypes
as input or output (i.e. small BLAST databases). This
doesn't seem to be mentioned or hinted at on the wiki:

http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax?action=showredirect=Admin%2FTools%2FTool+Config+Syntax#A.3Ctest.3E_tag_set

Is it possible to use a composite datatype as a test input?
If so how? Normal datatypes are loaded into the test history
using using the upload tool - does that mean I first need to
extend the relevant datatypes to allow them to be uploaded?

Example: Run blastp using a small query FASTA file and
a small database, check the output (eg tabular).

Is it possible to use a composite datatype as a test output?
If so how?

Example: Run makeblastdb using a small FASTA file, and
check the output (a small BLAST database).

Thanks,

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-04-03 Thread Dave Bouvier

Peter,

Yes, it is definitely possible to use a composite datatype in functional 
tests, and a number of tools in the Galaxy distribution do so. For 
examples on how to define composite inputs, you can look at the tools in 
tools/rgenetics/, such as rgGLM.xml or rgHaploView.xml. For the outputs, 
rgClean.xml provides an example of comparing a composite output dataset 
with the expected test data.


   --Dave B.

On 4/3/13 09:24:34.000, Peter Cock wrote:

Hello all,

I'd like to be able to write some simple test entries for
some of the BLAST+ tools using composite datatypes
as input or output (i.e. small BLAST databases). This
doesn't seem to be mentioned or hinted at on the wiki:

http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax?action=showredirect=Admin%2FTools%2FTool+Config+Syntax#A.3Ctest.3E_tag_set

Is it possible to use a composite datatype as a test input?
If so how? Normal datatypes are loaded into the test history
using using the upload tool - does that mean I first need to
extend the relevant datatypes to allow them to be uploaded?

Example: Run blastp using a small query FASTA file and
a small database, check the output (eg tabular).

Is it possible to use a composite datatype as a test output?
If so how?

Example: Run makeblastdb using a small FASTA file, and
check the output (a small BLAST database).

Thanks,

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/

To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/


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


Re: [galaxy-dev] Tool unit tests using composite datatypes

2013-04-03 Thread Peter Cock
On Wed, Apr 3, 2013 at 2:37 PM, Dave Bouvier d...@bx.psu.edu wrote:
 Peter,

 Yes, it is definitely possible to use a composite datatype in functional
 tests, and a number of tools in the Galaxy distribution do so.

Hooray - I was hoping this functionality already existed but was just
undocumented.

 For examples
 on how to define composite inputs, you can look at the tools in
 tools/rgenetics/, such as rgGLM.xml or rgHaploView.xml.

Got it - I see that uses the tag composite_data within the param tag.

 For the outputs, rgClean.xml provides an example of comparing a
 composite output dataset with the expected test data.

Here there is a tag extra_files used within the output tag.

Many thanks Dave - those should be enough to get me started, and
maybe I can update the wiki once I'm happy with how this works...

Cheers,

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/