unable to install.packages("spatialLIBD")
1
0
Entering edit mode
kstern • 0
@1c1d1972
Last seen 2.3 years ago
Canada

I seem to be having a problem downloading the R package spatialLIBD. The problem seems to occur with the magick dependency... I don't have root access so cannot install Magick++. I am only interested in getting the datasets, not using the visualization functions.... is there a work around to installing spatialLIBD without having to this dependency?


# include your problematic code here with any corresponding output 
BiocManager::install("spatialLIBD")
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details

replacement repositories:
    CRAN: https://cloud.r-project.org

Bioconductor version 3.15 (BiocManager 1.30.18), R 4.2.1 (2022-06-23)
Installing package(s) 'spatialLIBD'
also installing the dependencies ‘SpatialExperiment’, ‘magick’

trying URL 'https://bioconductor.org/packages/3.15/bioc/src/contrib/SpatialExperiment_1.6.0.tar.gz'
Content type 'application/x-gzip' length 5389608 bytes (5.1 MB)
==================================================
downloaded 5.1 MB

trying URL 'https://cloud.r-project.org/src/contrib/magick_2.7.3.tar.gz'
Content type 'application/x-gzip' length 4813163 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

trying URL 'https://bioconductor.org/packages/3.15/data/experiment/src/contrib/spatialLIBD_1.8.10.tar.gz'
Content type 'application/x-gzip' length 7293576 bytes (7.0 MB)
==================================================
downloaded 7.0 MB

* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
** using staged installation
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
 - deb: libmagick++-dev (Debian, Ubuntu)
 - rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
 - csw: imagemagick_dev (Solaris)
 - brew imagemagick@6 (MacOS)
For Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
   sudo add-apt-repository -y ppa:cran/imagemagick
   sudo apt-get update
   sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/projects/kster/.conda/envs/r-spalibd/magick’
ERROR: dependency ‘magick’ is not available for package ‘SpatialExperiment’
* removing ‘/projects/kster/.conda/envs/r-spalibd/SpatialExperiment’
ERROR: dependencies ‘SpatialExperiment’, ‘magick’ are not available for package ‘spatialLIBD’
* removing ‘/projects/kster/.conda/envs/r-spalibd/spatialLIBD’

The downloaded source packages are in
        ‘/tmp/Rtmppkx2z0/downloaded_packages’
Installation paths not writeable, unable to update packages
  path: /usr/lib/R/library
  packages:
    MASS, nlme, spatial, survival
Warning messages:
1: In install.packages(...) :
  installation of package ‘magick’ had non-zero exit status
2: In install.packages(...) :
  installation of package ‘SpatialExperiment’ had non-zero exit status
3: In install.packages(...) :
  installation of package ‘spatialLIBD’ had non-zero exit status
# please also include the results of running the following in an R session 

sessionInfo( )
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

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

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

loaded via a namespace (and not attached):
[1] BiocManager_1.30.18 compiler_4.2.1      tools_4.2.1

I've also tried with conda install -c bioconda bioconductor-spatiallibd (in a completely new virtual env) but end up with the following error:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: | 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                             

UnsatisfiableError:
spatialLIBD • 1.5k views
ADD COMMENT
1
Entering edit mode

I guess it depends on what you mean by only getting the datasets? You can clone the package with git clone https://git.bioconductor.org/packages/spatialLIBD and have access to raw files that were provided with the package. And the vignette for Using spatialLIBD with 10x Genomics public datasets takes through how to download and process data with the accompanied packages before using spatialLIBD. And some of the data is hosted in experiment hub as described in Introduction to spatialLIBD. There is also a spatialLIBD data set from the STexampleData hosted in experimenthub.

ADD REPLY
0
Entering edit mode

All the solutions Lori proposed are valid. The STexampleData package I think has only 1 of our samples (see https://bioconductor.org/packages/release/data/experiment/vignettes/STexampleData/inst/doc/STexampleData_overview.html#visium_humandlpfc), but in any case, feel free to check it out at https://bioconductor.org/packages/STexampleData/.

Lukas M Weber, a co-author of our work and also one of the lead authors of SpatialExperiment, is the maintainer of STexampleData if you just need some SPE objects. If you need all 12 of our samples, check my answer. If you want to build SPE objects from the spaceranger output files by 10x Genomics, check the spatialLIBD vignette Lori linked you to.

ADD REPLY
1
Entering edit mode
@lcolladotor
Last seen 9 hours ago
United States

Hi @kstern,

Thank you for your interest in spatialLIBD. You will still need the package in order to re-cast the object into a SpatialExperiment object (this package didn't exist when we made spatialLIBD). Thus, I strongly encourage you to reach out to whomever has root access in your system to install the magick dependency. Since you are using Ubuntu 20.04.4, it should be straight forward for your systems administrator to install it.

Otherwise, you can dive into the internals of the package at https://github.com/LieberInstitute/spatialLIBD. Namely https://github.com/LieberInstitute/spatialLIBD/blob/master/R/fetch_data.R and https://github.com/LieberInstitute/spatialLIBD/blob/master/R/sce_to_spe.R. But we don't encourage this option.

Another option is to use http://bioconductor.org/help/docker/ which does include the magick dependency.

Best, Leo

(As for ExperimentHub, we have it all ready but haven't uploaded the data yet to a non-Dropbox location in order to make this work https://github.com/LieberInstitute/spatialLIBD/blob/30204438ba07e463ee65af828f40af4de3c3a429/R/fetch_data.R#L126-L129. We'll do so in the coming month or so. Otherwise, you could use ExperimentHub alone to access the data, but you'd still need spatialLIBD to cast it to SpatialExperiment)

ADD COMMENT

Login before adding your answer.

Traffic: 623 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6