sib-swiss / pftools3

A suite of tools to build and search generalized profiles
GNU General Public License v2.0
10 stars 7 forks source link

Build time test issues for version 3.2.6 #18

Closed tillea closed 3 years ago

tillea commented 3 years ago

Hi, I'm trying to update the Debian package of pftools3. Unfortunately some of the tests are failing:

Running tests...
/usr/bin/ctest --force-new-ctest-process -j4
Test project /build/pftools-3.2.6/obj-x86_64-linux-gnu
    Start 1: execute_test_V2.sh
    Start 2: execute_test_V3.sh
    Start 3: check_output_of_test_V3.sh
    Start 4: execute_test_scan_search.pl
1/5 Test #2: execute_test_V3.sh .................***Failed    0.24 sec
#!/bin/sh -ve

#----------------------------------------------------------------------#
# PATHS declaration (set by cmake/make: do not modify them here)
#----------------------------------------------------------------------#
PFSEARCH=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/pfsearch
PFSCAN=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/pfscan
PFSEARCHV3=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/C/pfsearchV3
PFSCANV3=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/C/pfscanV3
PFCALIBRATEV3=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/C/pfcalibrateV3
PFINDEX=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/C/pfindex

GTOP=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/gtop
HTOP=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/htop
PFSCALE=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/pfscale
PFMAKE=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/pfmake
PSA2MSA=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/psa2msa
PFW=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/pfw
PTOH=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/ptoh
PTOF=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/ptof
P2FT=/build/pftools-3.2.6/obj-x86_64-linux-gnu/src/Fortran/2ft # NB: sh does not allow variable name starting with a digit

SORT_PSA=/build/pftools-3.2.6/src/Perl/sort_fasta.pl # FIXME: use cmake syntax
MAKE_IUPAC_CMP=/build/pftools-3.2.6/src/Perl/make_iupac_cmp.pl # FIXME: use cmake syntax
SCRAMBLE=/build/pftools-3.2.6/src/Perl/scramble_fasta.pl # FIXME: use cmake syntax

CMPDIR=/build/pftools-3.2.6/data/Matrices
TMPDIR=/tmp/test_V3
mkdir -p $TMPDIR

#----------------------------------------------------------------------#
# The PFTOOLS is a powerful software to align biological sequences.
# Owing to the 'generalized profile syntax', it allows the fine-tuning
# of an alignent scoring system, beyond what is feasible by most other
# software. Despite the PFTOOLS are crippled by a lot of legacy code,
# they are still extremely useful for precision work .
#
# Nota bene to use this script as a testsuite:
# (1) The output order of pfsearch is reproducible, as well as the one of
#     pfsearchV3 with -t 1.
# (2) Refrain using any pipe.
#----------------------------------------------------------------------#

#----------------------------------------------------------------------#
# Searching for the occurence of the SH3 domain within the VAV oncogene,
# using pfsearch V2 ...
#----------------------------------------------------------------------#
$PFSEARCH -f ./sh3.prf ./VAV_HUMAN.seq
  11.796    663 pos.      617 -     660 sp|P15498|VAV_HUMAN Proto-oncogene vav OS=Homo sapiens OX=9606 GN=VAV1 PE=1 SV=4
  17.560   1015 pos.      782 -     842 sp|P15498|VAV_HUMAN Proto-oncogene vav OS=Homo sapiens OX=9606 GN=VAV1 PE=1 SV=4

#----------------------------------------------------------------------#
# ...and using pfsearch V3:
#----------------------------------------------------------------------#
$PFSEARCHV3 -n -t 1 -f ./sh3.prf ./VAV_HUMAN.seq
  11.796     663 pos.     617 -     660 sp|P15498|VAV_HUMAN Proto-oncogene vav OS=Homo sapiens OX=9606 GN=VAV1 PE=1 SV=4
  17.560    1015 pos.     782 -     842 sp|P15498|VAV_HUMAN Proto-oncogene vav OS=Homo sapiens OX=9606 GN=VAV1 PE=1 SV=4

#----------------------------------------------------------------------#
# Create a database of sequences and a database of profiles, each one
# with two entries.
#----------------------------------------------------------------------#
cat ./VAV_HUMAN.seq ./VAV_RAT.seq > $TMPDIR/VAV.seq
cat ./sh2.prf       ./sh3.prf     > $TMPDIR/SHX.prf

#----------------------------------------------------------------------#
# The following commands must all produce the same final results
#
# (1) pfsearch (V2) expects ONE profile and MANY sequences:
# (2) pfscan (V2) expects MANY profile and ONE sequences:
# (3) pfsearch (V3) expects ONE profile and MANY sequences:
# (4) pfscan (V3) supports MANY profiles and MANY sequences:
#----------------------------------------------------------------------#
$PFSEARCH -fkxz ./sh2.prf $TMPDIR/VAV.seq > $TMPDIR/SHX.pfsearch2.hit
$PFSEARCH -fkxz ./sh3.prf $TMPDIR/VAV.seq >> $TMPDIR/SHX.pfsearch2.hit

$PFSCAN -fkxz ./VAV_HUMAN.seq $TMPDIR/SHX.prf > $TMPDIR/SHX.pfscan2.hit
$PFSCAN -fkxz ./VAV_RAT.seq $TMPDIR/SHX.prf >> $TMPDIR/SHX.pfscan2.hit

$PFSEARCHV3 -f -n -t 2 -o 6 ./sh2.prf -f $TMPDIR/VAV.seq > $TMPDIR/SHX.pfsearch3.hit
$PFSEARCHV3 -f -n -t 2 -o 6 ./sh3.prf -f $TMPDIR/VAV.seq >> $TMPDIR/SHX.pfsearch3.hit

$PFSCANV3 -f -n -o 6 $TMPDIR/SHX.prf $TMPDIR/VAV.seq > $TMPDIR/SHX.pfscan3.hit

#----------------------------------------------------------------------#
# All these commands produces exactly the same list of matched
# sequences, with the same raw scores and coordinates.
#
# However the output order is not necessarily preserved here.
#
# Let's verify that the output are comparable after fixing FASTA headers
#----------------------------------------------------------------------#
$SORT_PSA -s $TMPDIR/SHX.pfscan2.hit   > $TMPDIR/SHX.pfscan2.out
$SORT_PSA -s $TMPDIR/SHX.pfscan3.hit   > $TMPDIR/SHX.pfscan3.out
$SORT_PSA -s $TMPDIR/SHX.pfsearch2.hit > $TMPDIR/SHX.pfsearch2.out
$SORT_PSA -s $TMPDIR/SHX.pfsearch3.hit > $TMPDIR/SHX.pfsearch3.out
diff $TMPDIR/SHX.pfscan2.out $TMPDIR/SHX.pfscan3.out    # expecting no difference
12,13c12
< YVH-------------------LRLNPGDIVELTKAeAEHTWWEGRNTATNEVGWFPCNR
< VRPYVH
---
> YVH
16,18c15
< ITEKKAFRGLPELVEFYQQNSLKDCFksldtTLQFPYWYAGPMERAGAEGILTNRSD-GT
< YLVRQRVKDTAEFAISIKYNVEVKHIKIMTSE-GLYRITEKKAFRGLPELVEFYQQNSLK
< DCFksldtTLQFPY
---
> ITEKKAFRGLPELVEFYQQNSLKDCFksldtTLQFPY
21,22c18
< DYSKYFGTAKARYDFCARDRSELSLKEGDIIKILNKkGQQGWWRGEIY--GRIGWFPSNY
< VEEDYS
---
> DYS

    Start 5: execute_test_pfsearchV3_iupac.pl
2/5 Test #3: check_output_of_test_V3.sh .........***Failed    0.25 sec

3/5 Test #1: execute_test_V2.sh .................   Passed    0.69 sec
4/5 Test #4: execute_test_scan_search.pl ........   Passed   17.77 sec
5/5 Test #5: execute_test_pfsearchV3_iupac.pl ...   Passed   38.41 sec

60% tests passed, 2 tests failed out of 5

Total Test time (real) =  38.65 sec

The following tests FAILED:
          2 - execute_test_V3.sh (Failed)
          3 - check_output_of_test_V3.sh (Failed)
Errors while running CTest

Any idea what might be wrong here?

Kind regards, Andreas.

smoretti commented 3 years ago

Hi

I think we got a similar issue with the Dockerfile. We started with a mini linux and something was missing. Never really found what is was, but moving to Ubuntu solves the issue.

So could you run manually the test_V3.sh script to see which step fails?

After the cmake step the script should be in the Tests/examples/ folder

tillea commented 3 years ago

Hi, I tried to run this command and attached the output. The strangest thing at the end of the log is the

test_V3.sh: 201: /build/pftools-3.2.6/src/Perl/make_iupac_cmp.pl: not found
 Error: Unexpected end of matrix file. Unable to find '..                              ' keyword.
Segmentation fault

I can confirm that

ls -l /build/pftools-3.2.6/src/Perl/make_iupac_cmp.pl
-rwxr-xr-x 1 pbuilder pbuilder 2278 Oct  8 10:56 /build/pftools-3.2.6/src/Perl/make_iupac_cmp.pl

exists. I think an issue is definitely

 $ /build/pftools-3.2.6/src/Perl/scramble_fasta.pl
 bash: /build/pftools-3.2.6/src/Perl/scramble_fasta.pl: /bin/env: bad interpreter: No such file or directory

On Debian it is

$ which env
/usr/bin/env

The interesting thing is that I tried to patch this script (to /usr/bin/perl as interpreter) but the exit code remained 1. :-(

Just let me know if I can provide more detailed information. Andreas.

test_V3.sh.output.zip

smoretti commented 3 years ago

I have harmonized the bin/env path in the master branch.

Is it better for you?

tillea commented 3 years ago

On Wed, Dec 16, 2020 at 09:11:02AM -0800, smoretti wrote:

I have harmonized the bin/env path in the master branch.

Is it better for you?

Well, ich I call test_V3.sh manually now it works and the exit code is

  1. However, the test suite keeps on failing. :-(
smoretti commented 3 years ago

Is this still for the _execute_testV3.sh and _check_output_of_testV3.sh tests?

Which Debian version do you use? I will try to reproduce the issue in a container with a controlled environment.

tillea commented 3 years ago

On Wed, Dec 16, 2020 at 11:52:28PM -0800, smoretti wrote:

Is this still for the _execute_testV3.sh and _check_output_of_testV3.sh tests?

Yes.

Which Debian version do you use? I will try to reproduce the issue in a container with a controlled environment.

I'm building the package under Debian sid (=unstable). This is where any new package version enters Debian.

Kind regards, Andreas.

smoretti commented 3 years ago

I have built a container with debian:sid and the tests are successful on my side.

Like for our Dockerfile I have installed those packages before the compilation:

apt-get install -y --no-install-recommends \
      build-essential \
      libpcre++-dev \
      gfortran \
      libgfortran5 \
      ca-certificates \
      git \
      cmake \
      zlib1g-dev \
      libpng-dev \
      libfile-slurp-perl
tillea commented 3 years ago

On Thu, Dec 17, 2020 at 02:26:13AM -0800, smoretti wrote:

I have built a container with debian:sid and the tests are successful on my side. I'm afraid the remaining issue is due to parallel execution which is default for Debian but has unpredictable side effects. If I force serial execution all tests are passing. Thanks for the fix and your attempt to reproduce! Kind regards, Andreas.

smoretti commented 3 years ago

Great Thanks