luntergroup / octopus

Bayesian haplotype-based mutation calling
MIT License
301 stars 37 forks source link

wrong path for input files (container installation) #166

Closed alxsimon closed 3 years ago

alxsimon commented 3 years ago

Describe the bug Octopus resolve the wrong path for input files when installed in singularity container.

Version

octopus version 0.7.2 (develop 9c583200)
Target: x86_64 Linux 5.4.0-67-generic   
SIMD extension: AVX512                  
Compiler: GNU 9.3.0                     
Boost: 1_71                             

Singularity recipe:

BootStrap: docker
From: ubuntu:20.04

%labels
    Author Alexis Simon
    Version v0.7.2

%environment
       export LC_ALL=C.UTF-8
       export LANG=C.UTF-8

%post -c bash
    export DEBIAN_FRONTEND=noninteractive
    add-apt-repository ppa:ubuntu-toolchain-r/test
        apt-get update && apt-get upgrade -y
    apt-get install -y \
        wget \
        git \
        gcc-7 \
        build-essential \
        cmake \
        python3-pip \
        libboost-all-dev \
        libgmp-dev

    pip3 install distro

    # Install htslib
    export HTSLIB_VER="1.12"
    apt-get install -y autoconf automake make gcc perl zlib1g-dev libbz2-dev \
        liblzma-dev libcurl4-gnutls-dev libssl-dev
    cd /opt
    wget https://github.com/samtools/htslib/releases/download/${HTSLIB_VER}/htslib-${HTSLIB_VER}.tar.bz2
    tar -xjf /opt/htslib-${HTSLIB_VER}.tar.bz2 && cd htslib-${HTSLIB_VER}
    autoheader
    autoconf
    ./configure
    make && make install
    ldconfig /usr/local/lib

    # Install Octopus
    export THREADS=4
    cd /opt
    git clone https://github.com/luntergroup/octopus.git && cd octopus
    ./scripts/install.py --prefix /usr/local/bin --threads ${THREADS}

%apprun run
    exec /bin/bash "$@"

%runscript
    exec /bin/bash "$@"

Octopus is installed without issue and running the help works well.

Command

Command line to run octopus:

singularity exec containers/octopus.sif octopus -R /resources/ref_genome/mtro_02.fa -I /results/preproc/cancer/23-L19_8H_preproc.bam                                                      

Error

[2021-04-14 14:34:43] <INFO> ------------------------------------------------------------------------                                                                                       
[2021-04-14 14:34:43] <INFO> octopus v0.7.2 (develop 9c583200)                                                 
[2021-04-14 14:34:43] <INFO> Copyright (c) 2015-2020 University of Oxford                     
[2021-04-14 14:34:43] <INFO> ------------------------------------------------------------------------                                                                                       
[2021-04-14 14:34:43] <EROR> A user error has occurred:                                       
[2021-04-14 14:34:43] <EROR>                                                                  
[2021-04-14 14:34:43] <EROR>     The fasta file that you specified                            
[2021-04-14 14:34:43] <EROR>     "/home/alexis/resources/ref_genome/mtro_02.fa" in the command line                                                                                         
[2021-04-14 14:34:43] <EROR>     option --reference does not exist.                           
[2021-04-14 14:34:43] <EROR>                                                                  
[2021-04-14 14:34:43] <EROR> To help resolve this error ensure the specified path is correct and the                                                                                        
[2021-04-14 14:34:43] <EROR> file is readable.                                                
[2021-04-14 14:34:43] <INFO> -----------------------------------------------------------------

It seems the paths are not resolved correctly, as they are not in my home, they reside in the current working directory /data1/mytbtn. Providing the complete path still results in a prefixed /home/user e.g. /home/alexis/data1/mytbtn/resources/ref_genome/mtro_02.fa

v0.6.3-beta from bioconda does not have this issue.

I could not try v0.7.2 without singularity as I did not manage to compile it yet. So I can't be sure were the issue is coming from yet.

Does octopus use some environment variables at some point that may change between locally and singularity executed versions?

alxsimon commented 3 years ago

Sorry, stupid mistake, forgot to mount the given folder in singularity.

singularity exec -B /data1:/data1 containers/octopus.sif octopus -R /data1/mytbtn/resources/ref_genome/mtro_02.fa -I /data1/mytbtn/results/preproc/cancer/23-L19_8H_preproc.bam

However the /home/user/ resolving of path is misleading in the error message.