04 - MitoPilot installation

First-time installation

It’s best practice to save R code to a script rather than copying and pasting directly to the R console. In a terminal, run the following command to set up a new directory for the test project.

# make directory for workshop
mkdir -p /pool/public/genomics/${USER}/MitoPilot_workshop/test_project
# create a new R script
touch /pool/public/genomics/${USER}/MitoPilot_workshop/test_project/MitoPilot.R

Now create a new R script. In RStudio, select File > New File > R Script and save it to the new project directory. Use this script to save your R code for the test project.

To install MitoPilot, run the following commands within RStudio. First time installation will take a while.

###########################################################################
# Install MitoPilot
###########################################################################

if (!requireNamespace("remotes", quietly = TRUE)) {
    install.packages("remotes")
}
if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
}
BiocManager::install("Smithsonian/MitoPilot", ask = FALSE) # "ask = FALSE" to automatically install dependencies

You may see a warning like this:

Installation paths not writeable, unable to update packages
  path: /share/apps/bioinformatics/R/4.4.1/lib64/R/library

This is not a problem. Some R packages are installed at the Hydra system level and cannot be updated by the user.

If there were no other error messages, you’re ready to start using MitoPilot!

Updating MitoPilot

If you need to update MitoPilot, run the following commands in RStudio server.

###########################################################################
# Update MitoPilot (if needed)
###########################################################################

remove.packages("MitoPilot")
BiocManager::install("Smithsonian/MitoPilot")
.rs.restartR()

This will remove the old MitoPilot package, install the most recent version, and restart your R session. After updating, you will need to reload the package with library(MitoPilot).

We also recommend clearing your Singularity cache with singularity cache clean whenever you update MitoPilot. This will ensure you are using the latest MitoPilot Singularity image.