stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
330 stars 88 forks source link

When installing it on a new system #1800

Closed stela2502 closed 1 month ago

stela2502 commented 1 month ago

When I install this package onto a new R installation I get a Bioconductor related error:

remotes::install_github("stuart-lab/signac") Installing 8 packages: RcppRoll, fastmatch, BiocGenerics, S4Vectors, Rsamtools, IRanges, GenomicRanges, GenomeInfoDb Updating HTML index of packages in '.Library' Making 'packages.html' ... done Warning messages: 1: packages ‘BiocGenerics’, ‘S4Vectors’, ‘Rsamtools’, ‘IRanges’, ‘GenomicRanges’, ‘GenomeInfoDb’ are not available for this version of R

Versions of these packages for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 2: In i.p(...) : installation of package ‘/tmp/RtmpbmadcL/file249f007fc77b32/Signac_1.14.0.tar.gz’ had non-zero exit status

What I would really appreciate would be a more informative error message - or even better - why not install these packages from the right source?

You can easily replicate this problem using this Apptainer definition file:

Bootstrap: docker
From: alpine:latest

%post
    # Update and install essential packages
    apk update && apk add --no-cache \
        bash \
        build-base \
        curl \
        openblas-dev \
        gfortran \
        python3 \
        py3-pip \
        python3-dev \
        py3-setuptools \
        py3-wheel \
        R \
        R-dev \
        R-doc \
        libxml2-dev \
        libcurl \
        curl-dev \
        linux-headers \
        zeromq-dev \
        gcc \
        g++ \
        gfortran \
        libffi-dev \
        openssl-dev \
        make \
        cmake \
        zeromq-dev \
        libgit2-dev \
        cairo-dev \
        fontconfig freetype-dev harfbuzz fribidi-dev \
        harfbuzz-dev \
        libjpeg-turbo-dev tiff-dev \
        git
    # all of them just to get deftools installed later:
    apk add --no-cache \
        zeromq-dev \
        libgit2-dev \
        cairo-dev \
        fontconfig freetype-dev harfbuzz fribidi-dev \
        harfbuzz-dev \
        libjpeg-turbo-dev tiff-dev \

    # and this is necessary for Seurat
    apk add --no-cache \
        libgomp gfortran lapack-dev blas-dev boost-dev openblas libxml2-dev sqlite-dev zlib-dev 

    # Allow pip to modify system-wide packages
    export PIP_BREAK_SYSTEM_PACKAGES=1

    # Install JupyterLab and related Python packages
    pip install --no-cache-dir --upgrade pip
    pip install --no-cache-dir \
        jupyterlab \
        nbconvert \
        papermill \
        numpy \
        scipy \
        pandas \
        matplotlib \
        seaborn \
        notebook

    # Install R packages
    Rscript -e "install.packages('IRkernel', repos='http://cran.r-project.org')"
    Rscript -e "IRkernel::installspec(user = FALSE)"  # Register the kernel in Jupyter

    # Install additional R packages for data science
    #Rscript -e "install.packages(c('devtools', 'remotes', 'segmented', 'BiocManager' ), repos='http://cran.r-project.org')"
    Rscript -e "install.packages(c('devtools', 'remotes', 'segmented'  ), repos='http://cran.r-project.org')"
    Rscript -e "remotes::install_github('satijalab/seurat', 'seurat5')"
    Rscript -e "remotes::install_github('satijalab/seurat-data', 'seurat5')"
    Rscript -e "remotes::install_github('satijalab/azimuth', 'seurat5')"
    Rscript -e "remotes::install_github('satijalab/seurat-wrappers', 'seurat5')"
    # There is no seurat5 commit at the time of this install 2024/10/09
    #Rscript -e "remotes::install_github('stuart-lab/signac', 'seurat5')"
    #Rscript -e 'BiocManager::install(c("BiocGenerics", "S4Vectors", "Rsamtools", "IRanges", "GenomicRanges", "GenomeInfoDb"))'
    Rscript -e "remotes::install_github('stuart-lab/signac')"
    Rscript -e "remotes::install_github('bnprks/BPCells/r')"
    ## for the Seurat stats - speed up - finally
    Rscript -e "remotes::install_github('immunogenomics/presto')"

    # Clean up
    apk del build-base
    rm -rf /var/cache/apk/*
``

My sessionInfo():
``
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0

locale:
 [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=sv_SE.UTF-8        LC_COLLATE=de_DE.UTF-8    
 [5] LC_MONETARY=sv_SE.UTF-8    LC_MESSAGES=de_DE.UTF-8   
 [7] LC_PAPER=sv_SE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=sv_SE.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Stockholm
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.4.1

I hope this can be addressed.

timoast commented 1 month ago

What I would really appreciate would be a more informative error message - or even better - why not install these packages from the right source?

We cannot control the error message that R displays when it fails to find a dependency, unfortunately

These issues come up because we have dependencies that are on Bioconductor rather than on CRAN. By default, R will only check on CRAN.

You can change this default behaviour so that R looks on Bioconductor by running setRepositories(ind=1:3). This is documented on the install page for Signac.