Closed duboism closed 4 years ago
made a pull request for an utd ps_scan.pl version with do_profile_scan method compatible with pfscanV3 >=3.2 + added a check for child error ($?) after waitpid ('didn't even knew/realised that perl ps_scan.pl was included within pftools v3!)
Thanks @euphemizm, pull request merged. @duboism could you retry?
Sorry for the delay. My idea was to build the code and replace pfscan
with a script that just return 1 and see if it's detected. However, I'm not sure how can I launch ps_scan.pl
.
I have tried ./src/Perl/ps_scan.pl -d ./data/FamilyProfile/sh2.prf test.fna
(from the base directory): I see no output but the return code is 141
(which is not the case when I use the compiled pfscan
). I was exepecting to see the error messages added in the commit.
OK, after some trials and error, I was able to test the new ps_scan
and compare it to d37b3754230a1255d0f300c0dc24dac39d30e526 (I use the prosite motif file from InterPro and a fasta file):
pfscan
, both versions agree.pfscan
(which just exit 1
), the previous version seems to work like a charm but produces a different result while the new one detects the problem (the error message is Could not execute pfscan -flxz -v -C-1 - /home/mdubois/Code/interproscan/./core/io/src/test/resources/data/prosite/prosite.dat: at ./src/Perl/ps_scan.pl line 1780.
.)So I think that we can say it works.
However, IIUC, $!
is the perl variable for errno
which is only meaningfull for syscalls. When calling a regular program fails, I would print the return code (and maybe capture stderr and print it). Note sure how to do it in Perl.
p.s. by default ps_scan.pl expects pfscan "v1" (the fortran version) pfscan should be found in the current PATH, or the path+progname could be specified via some option:
--pfscan
if ps_scan.pl sees "V3" in the path+progname, it will then use it with the appropriate v3 options (I know, it's...)
p.s. use ps_scan.pl if you want to scan prosite patterns (& profiles) (and / or have prosite "post-processing" between match results), but if you want to (or if it is enough 4u to) scan only against prosite profiles you could just use pfscan(V3)
@euphemizm Thanks for your answer but I'm not sure to understand what you mean (I don't know about the biological meaning of pftools
, I am just an humble developer ;).
I think that I found a way to test that pfscan
errors are caught by ps_scan.pl
now by forcing pfscan
to fail. The errors are caught so this is a good news. Do you agree on the method (i.e. replacing pfscan
by a script that return non-0 to see if ps_scan
detects it) ? It was based on the FORTRAN version of pfscan
(because it's what we use) but I will do the same with pfscanV3
to be sure.
The last part of my answer was an humble suggestion (as I'm not familiar with Perl) on how to inform the user about the failure.
'just did a pull request for "sub do_profile_scan; when using pipe (IPC::Open2), upon child process errors show (child) return code '$?' (instead of system error str '$!')" ...
Merged in master branch
Thanks for the correction. The error message is now Could not execute pfscan -flxz -v -C-1 - /home/mdubois/Code/interproscan/./core/io/src/test/resources/data/prosite/prosite.dat; returned: 256 at /home/mdubois/Code/pftools3/build/bin/ps_scan.pl line 1780.
which is what is expected (as $?
is the exit code of the process - 1 in this case - shifted by 8).
So this is issue is closed.
Just a question: do you plan to release a new version including this update soon ?
I have just released version 3.2.5 to freeze ps_scan fix for interproscan
As reported here,
ps_scan.pl
doesn't check ifpfscan
properly executed.This is because open2, doesn't detect errors produced by the child. I would suggest to use IPC::Run which seems to handle this quite simply.