Surrogate Assay for Genotoxicity Assessment

In our paper “Predicting genotoxicity of integrating viral vectors for stem cell gene therapy using gene expression-based machine learning” we report an improved in vitro test to determine the risk of insertional mutagenesis of integrating vectors for gene therapy. SAGA builds on the well-accepted cell culture protocol of the in vitro immortalization assay (IVIM) but screens for the deregulation of oncogenic gene expression signatures. We demonstrate a new bioinformatic approach to correctly classify the mutagenic potential of retroviral vectors used in previous and current clinical trials.

R Installation

The package requires R>=3.6.

You can download the development version from GitHub or use:

# install.packages("devtools")
devtools::install_github("mytalbot/saga_package", build_vignettes = TRUE)
library(saga)

If you want the Vignette installed in R as well, set the build_vignettes = TRUE (access browseVignettes(“saga”)). Otherwise, the Vignette will only be accessible via the website.

If you don’t have or want to use devtools, SAGA can be installed using the source file (i.e. in RStudio).
It can be downloaded here.

AMI Installation

In case the installation of SAGA is not possible or desired, you can also use an amazon machine image (us-east-1: ami-020cd086c85e7c4d). This requires an AWS account. We tested this with the instance type c5n.large. The security group settings have to allow incoming HTTP traffic (port 80). Login details for RStudio: User = ubuntu and Password = bioc.

AMI Link

Important Notes

Please note, that the SAGA package requires dependencies. Some functions can mask each other (depending on the local R setup). This may cause warnings (not errors). These can be ignored since they do not hamper the function of the SAGA package. Warnings may be caused mainly by the HTSanalyzeR and mnormt dependencies.

Since the mnormt package has not yet been updated to R4.0, the only solution to work with saga on R4.0 is the installation of a previous version of mnormt. Make sure not to update mnormt when installing saga with devtools!

PackageUrl <- "https://cran.r-project.org/src/contrib/Archive/mnormt/mnormt_1.5-7.tar.gz"
install.packages(PackageUrl, repos = NULL,type="source")

Currently, only SAGA data generated with the Agilent Whole Mouse Genome 4x44K v2 platform can be analyzed.

SAGA Vignettes and working examples

If the Vignette was built during the installation process, it can be accessed like any other Vignette using:

The Vignette is also available on the SAGA website.

Working examples can be found in the README file or the Vignette.

Sample files can be downloaded from the GitHub repository.

SAGA core data

You’ll also need the SAGA core data. They are too large for the main package. Download them here (also from GitHub):

devtools::install_github("mytalbot/sagadata")
library(sagadata)

Example Analysis & Array Prediction

The following working examples demonstrate the general workflow of SAGA analysis.

You can download an example data set of three arrays plus a ready-to-run SampleInformation.txt file from the GitHub repository.

Download the sample files to a folder on your machine, unzip them and specify the path (see below) to the selected folder in the script below. The sample arrays had to be zipped because of the GitHub size limitations for files.

Note: Make sure that the phenoTest package is sourced as library(phenoTest) before running the script. This is required for GSEA analysis.

Using the wrapper function

library(phenoTest) # this is mandatory (for GSEA)!
library(saga)
library(sagadata)

### Path definition (Where are the sample files and the SIF?)
path           <- "path to sample files"

### saga_gentargets; automatically generates an empty (!) sample information file
# Modify the columns: Filename, Batch, Group, Vector, TrueLabel
# Note: this function does not fully automate the SIF generation. You'll have to
# adjust the files manually or create a new file for your files.
# targets      <- saga_gentargets(smplpath=path)

################################################################################
### Wrapper function - all in one
################################################################################
mySAGAres      <- saga_wrapper(smplpath=path, showModel=0, doGSEA=1)

More detailed SAGA analysis

library(phenoTest) # this is mandatory!
library(saga)
library(sagadata)
### Use the wrapper function...
################################################################################
### ...or these single functions
################################################################################
### Path definition (Where are the sample files and the SIF?)
path           <- "path to sample files"

### saga_import
rawdata        <- saga_import(smplpath=path, showjoint=1)
SAGA_RAW       <- rawdata$SAGA_RAW
TEST_RAW       <- rawdata$TEST_RAW
pData.joint    <- rawdata$pData.joint
pData.Test     <- rawdata$pData.Test

### normalize saga data (plotnumber=1 for normalized boxplot, 2 for tSNE plot)
normalized     <- saga_norm(SAGA_RAW, TEST_RAW, pData.joint, plotnumber=1)
qunorm.SAGA    <- normalized$qunorm.SAGA
matrix.SAGA.qn <- normalized$matrix.SAGA.qn
matrix.test.qn <- normalized$matrix.test.qn

### remove batch effects
# plotnumber = 1 (tSNE of first 2 dimensions)
# plotnumber = 2 (PCA of first 2 dimensions)
batchnorm      <- saga_batch(matrix.SAGA.qn, matrix.test.qn, rawdata, pData.joint, plotnumber=1)
index          <- batchnorm$index
matrix.SAGA    <- batchnorm$matrix.SAGA
matrix.test    <- batchnorm$matrix.test

### Sampling and model data collection
model          <- saga_sampling(matrix.SAGA, matrix.test)
matrix.train   <- model$matrix.train
labels.train   <- model$labels.train
matrix.unknown <- model$matrix.unknown

### Array predictions with optimized SVM parameters (default settings)
output         <- saga_predict(path, matrix.train, labels.train, matrix.unknown,
                               pData.Test, writeFile=1, showRoc=0)
classes        <- output$predictions
classes

### GSEA
gsea_results  <- saga_gsea(smplpath=path, saveResults=0)