<- Back to Spectre home page


Installing Spectre


There two options for using Spectre:

  • Install via RStudio. Here you can download R and RStudio, and then install the Spectre package within this framework.
  • Install via Docker. Here you can download a Docker image that contains a pre-compiled installation of R, RStudio, the Spectre package, and other associated packages. This is a useful option for reproducible analysis.

In Spectre v1.1 and above we have removed the package dependencies rgeos and rgdal as these are no longer available on CRAN. The package should install fine without these dependencies, but some spatial functions may not work properly. If required, one can download the archived packages, unzip them, and then placed them in the R library location.


Install via RStudio

Download the latest version of R (from CRAN) and R Studio. Once installed, run the following to install Spectre. Note: If you are unfamiliar with running R code, check out installing packages section of our Basics guide for assistance.

if(!require('remotes')) {install.packages('remotes')} # Installs the package 'remotes'
remotes::install_github(repo = "immunedynamics/spectre") # Install the Spectre package

R might ask you to update some packages. In general we recommend updating packages – to do this, enter 1. However, you might wish to delay this if you are in the middle of an analysis project.

These packages have more recent versions available.
Which would you like to update?
 
1: All                              
2: CRAN packages only               
3: None                             
4: rlang    (0.4.1  -> 0.4.2 ) [CRAN]
5: digest   (0.6.22 -> 0.6.23) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
1

Sometimes packages will need to be compiled first. We recommend entering Yes to allow compilation.

Packages which are only available in source form, and may need compilation of C/C++/Fortran: ‘IRanges’ ‘rhdf5filters’
Do you want to attempt to install these from sources? (Yes/no/cancel) 
Yes

If the installation was successful, you should see something similar to the following:

─  preparing ‘Spectre’: (879ms)
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘Spectre_1.1.0.tar.gz’
    
* installing *source* package ‘Spectre’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (Spectre)

You can check on the status of Spectre and the other package dependencies by running the package.check() command.

Spectre::package.check()
Package: Spectre
 -- Version:           1.1.0
 -- Install date:      2024-05-19
 -- Install source:    github
 -- R version:         R version 4.4.0 (2024-04-24)
 -- OS:                macOS Ventura 13.5.2
 -- OS detail:         aarch64-apple-darwin20
 -- Library path(s):      
        /Users/thomasa/Library/R/arm64/4.4/library
        /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
               
Checking dependency packages...
 -- All packages successfully installed.
               
Check out 'https://immunedynamics.github.io/spectre/' for protocols



Install via Docker

Spectre is available as a Docker container, thanks to the efforts of Dr. Givanna Putri. Docker is a cloud service that allows anyone to deliver software packages as a “complete unit” in a form of container. What this means is that the software package is released as a standalone computing environment, pre-installed with necessary pre-requisite libraries required by the software, and pre-configured for user convenience. Spectre’s Docker image will match the most recent versions of Spectre (denoted as ‘master’, referring to the master branch in Github). To download this version, simply follow the instructions below. If you wish to load a specific version of Spectre, you can specify a version (e.g. v0.5.3, v0.5.4. etc) instead of using ‘master’. You can see a list of versions available via docker on this page.

Download Docker app

Go to the following address: https://www.docker.com/products/docker-desktop

Download the correct version of Docker Desktop.