Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

Adam Sjøgren-2
  Hi.

I just noticed a problem with the temporary file names that
Bio::Tools::Run::StandAloneWUBlast uses.

wublast automatically tries to ungzip files that have names that match
certain patterns - noticably files ending in "_Z".

B:T:R:StandAloneWUBlast uses B:T:R:StandAloneBlast::_setinput() to
generate a temporary file for the query sequence.

_setinput() calls File::Temp::tempfile() without a SUFFIX (or a
TEMPLATE), which means that when you are (un)lucky, the temporary file
name becomes something like /tmp/i0311ckB_Z - which wublastp then tries
to ungzip, which fails.

I have created a pull request to add TEMPLATE and SUFFIX to
B:T:R:StandAloneBlast::_setinput()'s calls to tempfile():

 * https://github.com/bioperl/bioperl-run/pull/15

  Best regards,

    Adam

--
                                                          Adam Sjøgren
                                                    [hidden email]

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

Brian Osborne-3
Adam,

All tests pass with the patched code?

Thanks again,

Brian O.

> On May 26, 2015, at 4:34 AM, Adam Sjøgren <[hidden email]> wrote:
>
>  Hi.
>
> I just noticed a problem with the temporary file names that
> Bio::Tools::Run::StandAloneWUBlast uses.
>
> wublast automatically tries to ungzip files that have names that match
> certain patterns - noticably files ending in "_Z".
>
> B:T:R:StandAloneWUBlast uses B:T:R:StandAloneBlast::_setinput() to
> generate a temporary file for the query sequence.
>
> _setinput() calls File::Temp::tempfile() without a SUFFIX (or a
> TEMPLATE), which means that when you are (un)lucky, the temporary file
> name becomes something like /tmp/i0311ckB_Z - which wublastp then tries
> to ungzip, which fails.
>
> I have created a pull request to add TEMPLATE and SUFFIX to
> B:T:R:StandAloneBlast::_setinput()'s calls to tempfile():
>
> * https://github.com/bioperl/bioperl-run/pull/15
>
>  Best regards,
>
>    Adam
>
> --
>                                                          Adam Sjøgren
>                                                    [hidden email]
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

Fields, Christopher J
This might argue for setting up bioperl-run on travis-ci :)

chris

> On May 27, 2015, at 11:24 AM, Brian Osborne <[hidden email]> wrote:
>
> Adam,
>
> All tests pass with the patched code?
>
> Thanks again,
>
> Brian O.
>
>> On May 26, 2015, at 4:34 AM, Adam Sjøgren <[hidden email]> wrote:
>>
>> Hi.
>>
>> I just noticed a problem with the temporary file names that
>> Bio::Tools::Run::StandAloneWUBlast uses.
>>
>> wublast automatically tries to ungzip files that have names that match
>> certain patterns - noticably files ending in "_Z".
>>
>> B:T:R:StandAloneWUBlast uses B:T:R:StandAloneBlast::_setinput() to
>> generate a temporary file for the query sequence.
>>
>> _setinput() calls File::Temp::tempfile() without a SUFFIX (or a
>> TEMPLATE), which means that when you are (un)lucky, the temporary file
>> name becomes something like /tmp/i0311ckB_Z - which wublastp then tries
>> to ungzip, which fails.
>>
>> I have created a pull request to add TEMPLATE and SUFFIX to
>> B:T:R:StandAloneBlast::_setinput()'s calls to tempfile():
>>
>> * https://github.com/bioperl/bioperl-run/pull/15
>>
>> Best regards,
>>
>>   Adam
>>
>> --
>>                                                         Adam Sjøgren
>>                                                   [hidden email]
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> [hidden email]
>> http://mailman.open-bio.org/mailman/listinfo/bioperl-l
>
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

Mark A. Jensen

Nooooooooo.......

On Wed, May 27, 2015 at 2:36 PM, Fields, Christopher J <[hidden email]> wrote:

This might argue for setting up bioperl-run on travis-ci :)

chris

> On May 27, 2015, at 11:24 AM, Brian Osborne <[hidden email]> wrote:
>
> Adam,
>
> All tests pass with the patched code?
>
> Thanks again,
>
> Brian O.
>
>> On May 26, 2015, at 4:34 AM, Adam Sjøgren <[hidden email]> wrote:
>>
>> Hi.
>>
>> I just noticed a problem with the temporary file names that
>> Bio::Tools::Run::StandAloneWUBlast uses.
>>
>> wublast automatically tries to ungzip files that have names that match
>> certain patterns - noticably files ending in "_Z".
>>
>> B:T:R:StandAloneWUBlast uses B:T:R:StandAloneBlast::_setinput() to
>> generate a temporary file for the query sequence.
>>
>> _setinput() calls File::Temp::tempfile() without a SUFFIX (or a
>> TEMPLATE), which means that when you are (un)lucky, the temporary file
>> name becomes something like /tmp/i0311ckB_Z - which wublastp then tries
>> to ungzip, which fails.
>>
>> I have created a pull request to add TEMPLATE and SUFFIX to
>> B:T:R:StandAloneBlast::_setinput()'s calls to tempfile():
>>
>> * https://github.com/bioperl/bioperl-run/pull/15
>>
>> Best regards,
>>
>>   Adam
>>
>> --
>>                                                         Adam Sjøgren
>>                                                   [hidden email]
>>
>> _______________________________________________
>> Bioperl-l mailing list
>> [hidden email]
>> http://mailman.open-bio.org/mailman/listinfo/bioperl-l
>
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

Adam Sjøgren-2
In reply to this post by Brian Osborne-3
Brian writes:

> All tests pass with the patched code?

Well, I cannot claim that. What I can say, is that the number of tests
that pass/fail for me are unchanged.

Before (perl Build.sh && ./Build test):

  Files=83, Tests=1504, 50 wallclock secs ( 0.48 usr  0.12 sys + 45.10 cusr  6.33 csys = 52.03 CPU)
  Result: FAIL
  Failed 49/83 test programs. 14/1504 subtests failed.

After:

  Files=83, Tests=1504, 50 wallclock secs ( 0.45 usr  0.17 sys + 44.99 cusr  6.45 csys = 52.06 CPU)
  Result: FAIL
  Failed 49/83 test programs. 14/1504 subtests failed.

The test that mentions StandAloneWUBlast is
t/Tools/Run/StandAloneBlast.t, which for me ran like this before:

  $ prove -Ilib t/Tools/Run/StandAloneBlast.t
  t/Tools/Run/StandAloneBlast.t .. 1/45 Use of uninitialized value $input1 in -e at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneBlast.pm line 474.
  Use of uninitialized value $input1 in concatenation (.) or string at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm line 306.

  ------------- EXCEPTION: Bio::Root::Exception -------------
  MSG:  not Bio::Seq object or array of Bio::Seq objects or file name!
  STACK: Error::throw
  STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:472
  STACK: Bio::Tools::Run::StandAloneNCBIBlast::blastpgp /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm:306
  STACK: t/Tools/Run/StandAloneBlast.t:175
  -----------------------------------------------------------
  # Looks like you planned 45 tests but ran 43.
  # Looks like your test exited with 2 just after 43.
  t/Tools/Run/StandAloneBlast.t .. Dubious, test returned 2 (wstat 512, 0x200)
  Failed 2/45 subtests
          (less 8 skipped subtests: 35 okay)

  Test Summary Report
  -------------------
  t/Tools/Run/StandAloneBlast.t (Wstat: 512 Tests: 43 Failed: 0)
    Non-zero exit status: 2
    Parse errors: Bad plan.  You planned 45 tests but ran 43.
  Files=1, Tests=43,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.12 cusr  0.01 csys =  0.15 CPU)
  Result: FAIL

and like this (same result) after:

  $ prove -Ilib t/Tools/Run/StandAloneBlast.t
  t/Tools/Run/StandAloneBlast.t .. 1/45 Use of uninitialized value $input1 in -e at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneBlast.pm line 474.
  Use of uninitialized value $input1 in concatenation (.) or string at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm line 306.

  ------------- EXCEPTION: Bio::Root::Exception -------------
  MSG:  not Bio::Seq object or array of Bio::Seq objects or file name!
  STACK: Error::throw
  STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:472
  STACK: Bio::Tools::Run::StandAloneNCBIBlast::blastpgp /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm:306
  STACK: t/Tools/Run/StandAloneBlast.t:175
  -----------------------------------------------------------
  # Looks like you planned 45 tests but ran 43.
  # Looks like your test exited with 2 just after 43.
  t/Tools/Run/StandAloneBlast.t .. Dubious, test returned 2 (wstat 512, 0x200)
  Failed 2/45 subtests
          (less 8 skipped subtests: 35 okay)

  Test Summary Report
  -------------------
  t/Tools/Run/StandAloneBlast.t (Wstat: 512 Tests: 43 Failed: 0)
    Non-zero exit status: 2
    Parse errors: Bad plan.  You planned 45 tests but ran 43.
  Files=1, Tests=43,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.13 cusr  0.00 csys =  0.15 CPU)
  Result: FAIL


  Best regards,

    Adam

--
                                                          Adam Sjøgren
                                                    [hidden email]

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

Fields, Christopher J
Hi Adam,

I have pulled this one in.  We could feasibly add tests for this (e.g. check whether the temp files exist in the format specified after the BLAST run) but IMO this might be a bit overkill, as this functionality is something that File::Temp provides and very likely tests for already.

chris

> On May 28, 2015, at 2:17 AM, Adam Sjøgren <[hidden email]> wrote:
>
> Brian writes:
>
>> All tests pass with the patched code?
>
> Well, I cannot claim that. What I can say, is that the number of tests
> that pass/fail for me are unchanged.
>
> Before (perl Build.sh && ./Build test):
>
>  Files=83, Tests=1504, 50 wallclock secs ( 0.48 usr  0.12 sys + 45.10 cusr  6.33 csys = 52.03 CPU)
>  Result: FAIL
>  Failed 49/83 test programs. 14/1504 subtests failed.
>
> After:
>
>  Files=83, Tests=1504, 50 wallclock secs ( 0.45 usr  0.17 sys + 44.99 cusr  6.45 csys = 52.06 CPU)
>  Result: FAIL
>  Failed 49/83 test programs. 14/1504 subtests failed.
>
> The test that mentions StandAloneWUBlast is
> t/Tools/Run/StandAloneBlast.t, which for me ran like this before:
>
>  $ prove -Ilib t/Tools/Run/StandAloneBlast.t
>  t/Tools/Run/StandAloneBlast.t .. 1/45 Use of uninitialized value $input1 in -e at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneBlast.pm line 474.
>  Use of uninitialized value $input1 in concatenation (.) or string at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm line 306.
>
>  ------------- EXCEPTION: Bio::Root::Exception -------------
>  MSG:  not Bio::Seq object or array of Bio::Seq objects or file name!
>  STACK: Error::throw
>  STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:472
>  STACK: Bio::Tools::Run::StandAloneNCBIBlast::blastpgp /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm:306
>  STACK: t/Tools/Run/StandAloneBlast.t:175
>  -----------------------------------------------------------
>  # Looks like you planned 45 tests but ran 43.
>  # Looks like your test exited with 2 just after 43.
>  t/Tools/Run/StandAloneBlast.t .. Dubious, test returned 2 (wstat 512, 0x200)
>  Failed 2/45 subtests
>          (less 8 skipped subtests: 35 okay)
>
>  Test Summary Report
>  -------------------
>  t/Tools/Run/StandAloneBlast.t (Wstat: 512 Tests: 43 Failed: 0)
>    Non-zero exit status: 2
>    Parse errors: Bad plan.  You planned 45 tests but ran 43.
>  Files=1, Tests=43,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.12 cusr  0.01 csys =  0.15 CPU)
>  Result: FAIL
>
> and like this (same result) after:
>
>  $ prove -Ilib t/Tools/Run/StandAloneBlast.t
>  t/Tools/Run/StandAloneBlast.t .. 1/45 Use of uninitialized value $input1 in -e at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneBlast.pm line 474.
>  Use of uninitialized value $input1 in concatenation (.) or string at /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm line 306.
>
>  ------------- EXCEPTION: Bio::Root::Exception -------------
>  MSG:  not Bio::Seq object or array of Bio::Seq objects or file name!
>  STACK: Error::throw
>  STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:472
>  STACK: Bio::Tools::Run::StandAloneNCBIBlast::blastpgp /var/local/work/bioperl/bioperl-run/lib/Bio/Tools/Run/StandAloneNCBIBlast.pm:306
>  STACK: t/Tools/Run/StandAloneBlast.t:175
>  -----------------------------------------------------------
>  # Looks like you planned 45 tests but ran 43.
>  # Looks like your test exited with 2 just after 43.
>  t/Tools/Run/StandAloneBlast.t .. Dubious, test returned 2 (wstat 512, 0x200)
>  Failed 2/45 subtests
>          (less 8 skipped subtests: 35 okay)
>
>  Test Summary Report
>  -------------------
>  t/Tools/Run/StandAloneBlast.t (Wstat: 512 Tests: 43 Failed: 0)
>    Non-zero exit status: 2
>    Parse errors: Bad plan.  You planned 45 tests but ran 43.
>  Files=1, Tests=43,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.13 cusr  0.00 csys =  0.15 CPU)
>  Result: FAIL
>
>
>  Best regards,
>
>    Adam
>
> --
>                                                          Adam Sjøgren
>                                                    [hidden email]
>
> _______________________________________________
> Bioperl-l mailing list
> [hidden email]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l


_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Temporary file names in Bio::Tools::Run::StandAlonwWUBlast

Adam Sjøgren-2
Christopher writes:

> I have pulled this one in.

Cool, thanks!

> We could feasibly add tests for this (e.g. check whether the temp
> files exist in the format specified after the BLAST run)

I'm not sure I understand...

If you mean adding a test that checks that the SUFFIX argument works as
expected in File::Temp, I agree, that would probably be overkill for
BioPerl.


  Best regards,

    Adam

--
                                                          Adam Sjøgren
                                                    [hidden email]

_______________________________________________
Bioperl-l mailing list
[hidden email]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l
Loading...