The data set consists of N=200 samples from a cohort of Chronic Lymphocytic Leukemia (CLL) patients where four omics were profiled from blood samples: DNA methylation (450K Illumina microarray), bulk RNA-seq, somatic mutations and drug response data from blood for N=200 patients with. The data set was introduced in detail in this article and can be downloaded here. The MOFA analysis was originally published here
Make sure that you have installed the MOFA2 and the MOFAdata package.
library(data.table)
library(ggplot2)
library(tidyverse)
library(MOFA2)
library(MOFAdata)
Data is stored as a list of matrices. Features are stored in the rows and samples in the columns
utils::data("CLL_data")
lapply(CLL_data,dim)
## $Drugs
## [1] 310 200
##
## $Methylation
## [1] 4248 200
##
## $mRNA
## [1] 5000 200
##
## $Mutations
## [1] 69 200
The mRNA expression has been normalised by library size, followed by a variance stabilizing transformation using DESeq2:
hist(CLL_data$mRNA)
DNA methylation is calculated for every CpG site using the M-value, which provides a better summary statistic for downstream analysis. For the MOFA analysis we selected the top 1% (N=4248) most variable sites.
hist(CLL_data$Methylation)
In this study the authors have measured the effect of multiple drugs ex vivo using a high-throughput platform. For each drug they have measured 5 different concentrations. The value reported is the viability score (0=all cells died, 1=no cells died).
hist(CLL_data$Drugs)
Mutations are assessed using a panel of common cancer mutations and are summarised in a binary format (0=no mutation, 1=mutaton):
table(CLL_data$Mutations)
##
## 0 1
## 8474 667
Load sample metadata as a data.frame. Important columns are:
CLL_metadata <- fread("http://ftp.ebi.ac.uk/pub/databases/mofa/cll_vignette/sample_metadata.txt")
head(CLL_metadata) %>% knitr::kable(.)
sample | Gender | age | TTT | TTD | treatedAfter | died | IGHV | trisomy12 |
---|---|---|---|---|---|---|---|---|
H005 | m | 75.26575 | 0.5749487 | 2.625599 | TRUE | FALSE | 1 | 0 |
H006 | m | NA | NA | NA | NA | NA | NA | NA |
H007 | f | NA | NA | NA | NA | NA | NA | NA |
H008 | m | NA | NA | NA | NA | NA | NA | NA |
H010 | f | 72.78082 | 2.9322382 | 2.932238 | FALSE | FALSE | 0 | 0 |
H011 | f | 72.99452 | 0.0191650 | 2.951403 | TRUE | FALSE | 1 | 0 |
Create the MOFA object
MOFAobject <- create_mofa(CLL_data)
MOFAobject
## Untrained MOFA model with the following characteristics:
## Number of views: 4
## Views names: Drugs Methylation mRNA Mutations
## Number of features (per view): 310 4248 5000 69
## Number of groups: 1
## Groups names: group1
## Number of samples (per group): 200
##
Visualise the number of views (rows) and the number of groups (columns) exist, what are their corresponding dimensionalities and how many missing information they have (grey bars).
plot_data_overview(MOFAobject)
Two important options:
model_opts <- get_default_model_options(MOFAobject)
model_opts$likelihoods["Mutations"] <- "bernoulli"
model_opts$num_factors <- 15
model_opts
## $likelihoods
## Drugs Methylation mRNA Mutations
## "gaussian" "gaussian" "gaussian" "bernoulli"
##
## $num_factors
## [1] 15
##
## $spikeslab_factors
## [1] FALSE
##
## $spikeslab_weights
## [1] TRUE
##
## $ard_factors
## [1] FALSE
##
## $ard_weights
## [1] TRUE
Prepare the MOFA object
MOFAobject <- prepare_mofa(MOFAobject,
model_options = model_opts
)
Train the model: this should take ~5min, but DO NOT RUN THIS. The software has evolved since the original publication and the results will not be 100% identical to the original publication, please load the pretrained model below for reproducibility purposes
# MOFAobject <- run_mofa(MOFAobject)
Load precomputed model
MOFAobject <- readRDS(url("http://ftp.ebi.ac.uk/pub/databases/mofa/cll_vignette/MOFA2_CLL.rds"))
The sample metadata must be provided as a data.frame and it must contain a column sample
with the sample IDs. Make sure that the samples in the metadata match the samples in the model
stopifnot(CLL_metadata$sample %in% samples_metadata(MOFAobject)$sample)
samples_metadata(MOFAobject) <- CLL_metadata
Keep the model with the original variable names for the gene set enrichment analysis section
MOFAobject.ensembl <- MOFAobject
updated_features_names <- features_names(MOFAobject)
# Rename drug IDs (i.e. D_001) to drug names (i.e. navitoclax)
drug_metadata <- fread("http://ftp.ebi.ac.uk/pub/databases/mofa/cll_vignette/drugs.txt.gz")
tmp <- drug_metadata$name; names(tmp) <- drug_metadata$drug_id
updated_features_names[["Drugs"]] <- stringr::str_replace_all(features_names(MOFAobject)[["Drugs"]], tmp)
# Rename mRNA from ENSEMBLE IDs (i.e. ENSG00000223972) to gene names (i.e. DDX11L1)
gene_metadata <- fread("http://ftp.ebi.ac.uk/pub/databases/mofa/cll_vignette/Hsapiens_genes_BioMart.87.txt.gz")
gene_metadata[,symbol:=ifelse(symbol=="",ens_id,symbol)]
tmp <- gene_metadata$symbol; names(tmp) <- gene_metadata$ens_id
# avoid duplicated names with the Mutations view
tmp[tmp%in%features_names(MOFAobject)[["Mutations"]]] <- paste0(tmp[tmp%in%features_names(MOFAobject)[["Mutations"]]],"_mRNA")
updated_features_names[["mRNA"]] <- stringr::str_replace_all(features_names(MOFAobject)[["mRNA"]], tmp)
# Update features names in model
features_names(MOFAobject) <- updated_features_names
The most important insight that MOFA generates is the variance decomposition analysis. This plot shows the percentage of variance explained by each factor across each data modality.
plot_variance_explained(MOFAobject, max_r2=10)
What insights from the data can we learn just from inspecting this plot?
(Q) Based on the MOFA output, if you were to profile just one molecular layer, which one would you choose to maximise the amount of sources of variation captured?
There are a few systematic strategies to characterise the molecular signal that underlies each MOFA Factor and to relate them to existent sample covariates:
Let’s test the association between the MOFA factors versus Gender and age:
correlate_factors_with_covariates(MOFAobject,
covariates = c("Gender","age","died"),
plot = "log_pval"
)
## Warning in correlate_factors_with_covariates(MOFAobject, covariates =
## c("Gender", : There are non-numeric values in the covariates data.frame,
## converting to numeric...
Most Factors don’t have a clear association with any of the covariates. Only Factor 11 has a (weak) association with survival outcome. We will explore association with clinical measurements later in the vignette.
How do we interpret the factor values?
Each factor captures a different source of variability in the data. Mathematically, each Factor is defined by a linear combination of the input features. Each Factor ordinates cells along a one-dimensional axis that is centered at zero. Samples with different signs manifest opposite phenotypes along the inferred axis of variation, with higher absolute value indicating a stronger effect.
Note that the interpretation of MOFA factors is analogous to the interpretation of the principal components in PCA.
plot_factors(MOFAobject,
factors = c(1,3),
dot_size = 2.5
)
How do we interpret the feature weights?
The weights provide a score for each feature on each factor. Features with no association with the corresponding factor are expected to have values close to zero, whereas features with strong association with the factor are expected to have large absolute values. The sign of the weights indicates the direction of the effect: a positive weights indicates that the feature has higher levels in the cells with positive factor values, and vice-versa.
By looking at the variance explained plot, we saw that Factor 1 captures variation in all data modalities. Out of all omics, the somatic mutation data is a good place to start, as somatic mutations are very sparse, easy to interpret and any change in the DNA is likely to have downstream consequences to all other molecular layers. Let’s plot the weights:
plot_weights(MOFAobject,
view = "Mutations",
factor = 1,
nfeatures = 10, # Top number of features to highlight
scale = T # Scale weights from -1 to 1
)
Notice that most features lie at zero, indicating that most features have no association with Factor 1. There is however one gene that clearly stands out: IGHV (immunoglobulin heavy chain variable region). This is the main clinical marker for CLL.
An alternative visualisation to the full distribution of weights is to do a line plot that displays only the top features with the corresponding weight sign on the right:
plot_top_weights(MOFAobject,
view = "Mutations",
factor = 1,
nfeatures = 10, # Top number of features to highlight
scale = T # Scale weights from -1 to 1
)
IGHV has a positve weight. This means that samples with positive Factor 1 values have the IGHV mutation whereas samples with negative Factor 1 values do not have the IGHV mutation. To confirm this, let’s plot the Factor values and colour the IGHV mutation status.
plot_factor(MOFAobject,
factors = 1,
color_by = "IGHV",
add_violin = TRUE,
dodge = TRUE,
show_missing = FALSE
)
We can also plot Factor values coloured by other covariates, for example Gender
. As concluded from the association analysis above, this variable has no association with Factor 1:
plot_factor(MOFAobject,
factors = 1,
color_by = "Gender",
dodge = TRUE,
add_violin = TRUE
)
From the variance explained plot we know that Factor 1 drives variation across all data modalities. Let’s visualise the mRNA expression changes that are associated with Factor 1:
plot_weights(MOFAobject,
view = "mRNA",
factor = 1,
nfeatures = 10
)
In this case we have a large amount of genes that have large positive and negative weights. Genes with large positive values will be more expressed in the samples with IGHV mutation, whereas genes with large negative values will be more expressed in the samples without the IGHV mutation. Let’s verify this. The function plot_data_scatter
generates a scatterplot of Factor 1 values (x-axis) versus expression values (y-axis) for the top 4 genes with largest positive weight. Samples are coloured by IGHV status:
plot_data_scatter(MOFAobject,
view = "mRNA",
factor = 1,
features = 4,
sign = "negative",
color_by = "IGHV"
) + labs(y="RNA expression")
This function generates a scatterplot of Factor 1 values (x-axis) versus expression values (y-axis) for the top 4 genes with largest negative weight. Samples are coloured by IGHV status:
plot_data_scatter(MOFAobject,
view = "mRNA",
factor = 1,
features = 4,
sign = "negative",
color_by = "IGHV"
) + labs(y="RNA expression")
An alternative visualisation is to use a heatmap
plot_data_heatmap(MOFAobject,
view = "mRNA",
factor = 1,
features = 25,
cluster_rows = FALSE, cluster_cols = FALSE,
show_rownames = TRUE, show_colnames = FALSE,
scale = "row"
)
plot_data_heatmap
has an interesting argument to “beautify” the heatmap: denoise = TRUE
. Instead of plotting the (noisy) input data, we can plot the data reconstructed by the model, where noise has been removed:
plot_data_heatmap(MOFAobject,
view = "mRNA",
factor = 1,
features = 25,
denoise = TRUE,
cluster_rows = FALSE, cluster_cols = FALSE,
show_rownames = TRUE, show_colnames = FALSE,
scale = "row"
)
(Q) Can you suggest new RNA expression and DNA methylation markers for personalised treatment recommendations according to Factor 1 (the IGHV status)?
First explore the MOFA weights, then go back to the input data and do boxplots for the chosen markers (x-axis being the IGHV status and y-axis being the marker’s expression or DNA methylation values).
Hints:
- The section Customized analysis may be helpful to extract the weights and the data in a long data.frame format
- the IGHV status for each sample can be fetched from the CLL_metadata
object
- the ggpubr package provides very useful ggplot-based visualisations, including boxplots with p-values. I highly recommend it!
(Q) Your task is to provide a characterisation for Factor 3.
Try a similar pipeline as for Factor 1 and answer the following questions:
- Which mutation underlies Factor 3?
- Can you identify mRNA markers?
- Do a (small) bibliographical search to check if your predictions make sense
Now that we have characterised the etiology of the two main Factors, let’s do a scatterplot colouring each patient by their somatic mutation profile:
p <- plot_factors(MOFAobject,
factors = c(1,3),
color_by = "IGHV",
shape_by = "trisomy12",
dot_size = 2.5,
show_missing = T
)
p <- p +
geom_hline(yintercept=-1, linetype="dashed") +
geom_vline(xintercept=(-0.5), linetype="dashed")
print(p)
## Warning: Removed 27 rows containing missing values (geom_point).
The scatterplot of Factor 1 vs Factor 3 reveals that a few samples are missing the somatic mutation status. In this case, the doctors were not able to classify patients into their clinical subgroups. But we can now use MOFA to exploit the molecular profiles and attempt to impute the IGHV and trisomy12 status.
library(randomForest)
# Prepare data
df <- as.data.frame(get_factors(MOFAobject, factors=c(1,2))[[1]])
# Train the model for IGHV after removing missing observations
df$IGHV <- as.factor(samples_metadata(MOFAobject)$IGHV)
model.ighv <- randomForest(IGHV ~ ., data=df[!is.na(df$IGHV),])
# Do predictions
samples_metadata(MOFAobject)$IGHV.pred <- stats::predict(model.ighv, df)
# Prepare data
df <- as.data.frame(get_factors(MOFAobject, factors=c(1,2))[[1]])
# Train the model for Trisomy12 after removing missing observations
df$trisomy12 <- as.factor(samples_metadata(MOFAobject)$trisomy12)
model.trisomy12 <- randomForest(trisomy12 ~ ., data=df[!is.na(df$trisomy12),])
samples_metadata(MOFAobject)$trisomy12.pred <- stats::predict(model.trisomy12, df)
Plot predictions for IGHV
samples_metadata(MOFAobject)$IGHV.pred_logical <- c("True","Predicted")[as.numeric(is.na(samples_metadata(MOFAobject)$IGHV))+1]
p <- plot_factors(MOFAobject,
factors = c(1,3),
color_by = "IGHV.pred",
shape_by = "IGHV.pred_logical",
dot_size = 2.5,
show_missing = T
)
p <- p +
geom_hline(yintercept=-1, linetype="dashed") +
geom_vline(xintercept=(-0.5), linetype="dashed")
print(p)
In addition to exploring the individual weights for each factor, we can use enrichment analysis to look for signiificant associations of factors to genesets. Here, we use the Reactome genesets for illustrations, which is contained in the MOFAdata package. For more details on how the GSEA works we encourage the users to read the GSEA vignette
Gene set annotations are provided as a binary membership matrix. Genes are stored in the rows, pathways are stored in the columns. A value of 1 indicates that gene \(j\) belongs to the pathway \(i\).
utils::data(reactomeGS) # from MOFAdata
head(colnames(reactomeGS))
## [1] "ENSG00000187634" "ENSG00000188976" "ENSG00000187961" "ENSG00000187583"
## [5] "ENSG00000187642" "ENSG00000188290"
head(rownames(reactomeGS))
## [1] "Interleukin-6 signaling"
## [2] "Apoptosis"
## [3] "Hemostasis"
## [4] "Intrinsic Pathway for Apoptosis"
## [5] "Cleavage of Growing Transcript in the Termination Region "
## [6] "PKB-mediated events"
These are the steps for doing Gene Set Enrichment Analysis (GSEA) with MOFA:
j
belongs to pathway i
. A value of 0 indicates elsewise.mean.diff
(difference in the average weight between foreground and background genes) or rank.sum
(difference in the sum of ranks between foreground and background genes).parametric
(a simple and very liberal parametric t-test), cor.adj.parametric
(parametric t-test adjusted by the correlation between features), permutation
(unparametric, the null distribution is created by permuting the weights. This option is computationally expensive, but it preserves the correlation structure between features in the data.).enrichment.results <- run_enrichment(
object = MOFAobject.ensembl,
view = "mRNA",
feature.sets = reactomeGS,
set.statistic = "mean.diff",
statistical.test = "parametric"
)
The enrichment analysis returns a list of 5 elements:
names(enrichment.results)
## [1] "feature.sets" "pval" "pval.adj"
## [4] "feature.statistics" "set.statistics" "sigPathways"
Plot an overview of the number of significant pathways per factor.
It seems that most of the Factors do not have clear gene set signatures. A clear exception is Factor 5, which has a very strong enrichment for genes with positive weights.
plot_enrichment_heatmap(enrichment.results)
(Q) Can you characterise Factor 5 based on the GSEA results? Which genes are driving the top enriched pathways?
Hint: use the functions plot_enrichment
(Q) Which drugs are associated with Factor 5? What is their target pathway? Do they make biological sense?
Hint: use the drug_metadata
object
For customized exploration of weights and factors, you can directly fetch the variables from the model using get_weights
and get_factors
:
weights <- get_weights(MOFAobject,
views = "all",
factors = "all",
as.data.frame = TRUE
)
head(weights)
## feature factor value view
## 1 navitoclax_1 Factor1 -0.0001029638 Drugs
## 2 navitoclax_2 Factor1 -0.0061835683 Drugs
## 3 navitoclax_3 Factor1 -0.0484350338 Drugs
## 4 navitoclax_4 Factor1 -0.0396829204 Drugs
## 5 navitoclax_5 Factor1 -0.0240856562 Drugs
## 6 ibrutinib_1 Factor1 -0.0004036970 Drugs
factors <- get_factors(MOFAobject,
factors = "all",
as.data.frame = TRUE
)
head(factors)
## sample factor value group
## 1 H045 Factor1 -1.418579 group1
## 2 H109 Factor1 -1.415237 group1
## 3 H024 Factor1 1.663551 group1
## 4 H056 Factor1 1.224276 group1
## 5 H079 Factor1 -1.217420 group1
## 6 H164 Factor1 -1.791768 group1
The factors inferred by MOFA can be related to clinical outcomes such as time to treatment or survival times. As this type of data is censored (not for all samples we have already observed the event) we will use Cox models for this purpose. In a Cox proportional hazards model we model the hazard of an event ocurring (e.g. death or treatment) as a function of some covariates (here the factors). If a factor has a influence on the surivival time or time to treatment it will receive a high absoulte coefficient in the Cox model. In particular:
To fit these models we will use the coxph
function in the survival
package. The survival data is stored in a survival object that contains both the time a sample has been followed up and whether the event has occured (as 0,1).
Let’s take time to treatment as an example here. The sample metadata contains the follow-up times per sample in years in the column TTT
, and the column treatedAfter
indicated whether a treatment occured.
library(survival)
library(survminer)
SurvObject <- Surv(samples_metadata(MOFAobject)$TTT, samples_metadata(MOFAobject)$treatedAfter)
Z <- get_factors(MOFAobject)[[1]]
fit <- coxph(SurvObject ~ Z)
fit
## Call:
## coxph(formula = SurvObject ~ Z)
##
## coef exp(coef) se(coef) z p
## ZFactor1 -0.43422 0.64777 0.10944 -3.968 7.26e-05
## ZFactor2 0.53961 1.71534 0.13380 4.033 5.51e-05
## ZFactor3 0.10059 1.10582 0.14057 0.716 0.474259
## ZFactor4 0.04846 1.04965 0.10528 0.460 0.645339
## ZFactor5 0.27567 1.31741 0.11328 2.434 0.014952
## ZFactor6 -0.25121 0.77786 0.12383 -2.029 0.042500
## ZFactor7 0.23077 1.25957 0.11332 2.036 0.041709
## ZFactor8 0.40083 1.49306 0.10826 3.702 0.000214
## ZFactor9 -0.04353 0.95740 0.10580 -0.411 0.680751
## ZFactor10 -0.12880 0.87915 0.10962 -1.175 0.240011
## ZFactor11 0.54195 1.71935 0.13455 4.028 5.63e-05
## ZFactor12 -0.80444 0.44734 0.12448 -6.463 1.03e-10
## ZFactor13 -0.12435 0.88307 0.11611 -1.071 0.284175
## ZFactor14 -0.05307 0.94831 0.08940 -0.594 0.552783
## ZFactor15 0.03688 1.03757 0.12081 0.305 0.760168
##
## Likelihood ratio test=114.6 on 15 df, p=< 2.2e-16
## n= 174, number of events= 96
## (26 observations deleted due to missingness)
We can see that several factors have a significant association to time to treatment. For example, Factor 1 has a negative coefficient. Samples with low factor values have an increased hazard compared to samples with a large factor values.
(Q) Which Factors are associated with the clinical covariate (time to next treatment)?
Extract p-values and cox model coefficients (i.e. hazard ratios )
s <- summary(fit)
coef <- s[["coefficients"]]
df <- data.frame(
factor = factor(rownames(coef), levels = rev(rownames(coef))),
p = coef[,"Pr(>|z|)"],
coef = coef[,"exp(coef)"],
lower = s[["conf.int"]][,"lower .95"],
higher = s[["conf.int"]][,"upper .95"]
)
Plot the Hazard ratio per factor, together with 95% confidence intervals
ggplot(df, aes(x=factor, y=coef, ymin=lower, ymax=higher, color=p<0.01)) +
geom_pointrange() +
coord_flip() +
scale_x_discrete() +
labs(y="Hazard Ratio", x="") +
geom_hline(aes(yintercept=1), linetype="dotted") +
theme_bw()
By inspecting the variance explained plot, we can see that the RNA expression is capturing most of the sources of variation in this data set. There are only a few Factors that cannot be captured using RNA expression ( for example Factors 2 and 14). The ex vivo drug response assay also captures a lot of variability, but it is much harder to obtain from patient cohorts than RNA expression data. The other two data modalities are less informative: DNA methylation data is only active in Factor 1, 8 and 10 and Somatic mutations are only associated with Factors 1 and 3.
If were were to profile just one molecular layer for a large number of patients in a cost-effective way, we would need to compare the feasibility and costs of Drug response assays and RNA sequencing. The latter is much cheaper and more standarised in the community.
We first collect the genes with the largest weights for Factor 1. Then we can do boxplots stratifying samples by IGHV status, followed by statiscal testing with the null hypothesis that the average gene expression does not differ between groups (a simple t-test should work for a first exploration).
Extract mRNA weights from the MOFA object
rna.weights <- get_weights(MOFAobject,
views = "mRNA",
factors = 1,
abs = TRUE, # we do not distinguish between direction of effect
as.data.frame = TRUE
)
# Extract top N genes
top.genes <- rna.weights %>%
.[order(rna.weights$value, decreasing = T),] %>%
head(n=9) %>% .$feature %>% as.character
head(top.genes)
## [1] "ZNF667" "SEPT10" "SOWAHC" "ZNF471" "LPL" "ADAM29"
Fetch mRNA data from the MOFAobject for the top genes
rna.data <- get_data(MOFAobject,
views = "mRNA",
as.data.frame = TRUE,
features = list("mRNA"=top.genes)
)
head(rna.data)
## view group feature sample value
## 1 mRNA group1 ZNF667 H045 10.323723
## 2 mRNA group1 SEPT10 H045 11.473792
## 3 mRNA group1 SOWAHC H045 10.134044
## 4 mRNA group1 ZNF471 H045 9.680574
## 5 mRNA group1 LPL H045 12.686458
## 6 mRNA group1 ADAM29 H045 7.129380
Add IGHV status from the sample metadata
to.plot <- rna.data %>%
merge(CLL_metadata[,c("sample","IGHV")], by="sample")
colnames(to.plot)
## [1] "sample" "view" "group" "feature" "value" "IGHV"
(Optional) Remove samples with unknown IGHV status
to.plot <- to.plot[!is.na(to.plot$IGHV),]
Box plots with statistical comparison of means
ggpubr::ggboxplot(to.plot, x = "IGHV", y = "value", fill = "IGHV", facet="feature") +
stat_compare_means() +
labs(x="IGHV status", y="mRNA expression") +
theme(legend.position="none")
Following a similar strategy as for Factor 1, we notice that Factor 3 is also active in the somatic mutation view. Thus, there must be a mutation that underlies this phenotype. Let’s plot the corresponding weights:
plot_weights(MOFAobject,
view = "Mutations",
factor = 3,
nfeatures = 5,
abs = F
)
In this case we have two mutations that have large weight. One of them is the trisomy of chromosome 12, which is the second most important clinical marker in CLL!
Let’s verify this by plotting the Factor values grouping samples by the presence or absence of trisomy12:
plot_factor(MOFAobject,
factors = 3,
color_by = "trisomy12",
dodge = TRUE,
add_violin = TRUE
)
As we did for the IGHV factor we can also inspect the molecular signatures in the input data with the functions plot_data_scatter
and plot_data_heatmap
:
plot_data_scatter(MOFAobject,
view = "Drugs",
factor = 3,
features = 4,
sign = "positive",
color_by = "trisomy12"
) + labs(y="Drug response (cell viability)")
plot_data_heatmap(MOFAobject,
view = "mRNA",
factor = 3,
features = 25,
denoise = TRUE,
cluster_rows = TRUE, cluster_cols = FALSE,
show_rownames = TRUE, show_colnames = FALSE,
scale = "row"
)
Because it enables us to classify samples based on their molecular (i.e. phenotypic) profile. Both Factor 1 and Factor 3 are associated to somatic mutations which have significant transcriptomic and epigenetic consequences which are in turn linked to a clinically-relevant impact on the response to different drugs (ex vivo). This is precisely the aim of personalised medicine! Obviously more research is needed, but the patients from the four subgroups are likely to require different drugs for an optimal treatment.
Plotting the GSEA results for Factor 5 reveals that this Factor is capturing differences in the stress response of the blood cells. We have significantly enriched pathways such as cellular response to stress or heat shock response.
plot_enrichment(enrichment.results, factor = 5, max.pathways = 15)
The top genes that are driving this pathway are Heat Shock Proteins and some inflammatory markers such as TNF.
plot_top_weights(MOFAobject,
view = "mRNA",
factor = 5,
nfeatures = 15
)
It looks like these genes have a positive weight, which means that they have higher levels in the samples with positive Factor 5 values:
plot_data_scatter(MOFAobject,
factor = 5,
view = "mRNA",
features = 6,
add_lm = TRUE
) + labs(y="RNA expression")
plot_top_weights(MOFAobject,
view = "Drugs",
factor = 5,
nfeatures = 15
)
plot_data_scatter(MOFAobject,
view = "Drugs",
factor = 5,
features = 6,
add_lm = TRUE
) + labs(y="Viability")
Out of the 5 top drugs, the target category for 3 of them is Reactive Oxygen Species, which are closely related to stress response mechanisms.
drug_metadata[grep("SD51|BAY|SD07|MIS-43|NU7441",drug_metadata$name),]
## drug_id name main_targets target_category
## 1: D_032 NU7441 DNAPK DNA damage response
## 2: D_041 BAY 11-7085 NFkB NFkB
## 3: D_127 SD07 ROS Reactive oxygen species
## 4: D_141 SD51 ROS Reactive oxygen species
## 5: D_149 MIS-43 ROS Reactive oxygen species
## pathway
## 1: Other
## 2: Other
## 3: Reactive oxygen species
## 4: Reactive oxygen species
## 5: Reactive oxygen species
Factor 1 (as expected), Factor 2, 8 11 and 12 are all statistically associated with time to next treatment.
sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur 10.16
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] survminer_0.4.8 ggpubr_0.4.0 survival_3.2-7
## [4] randomForest_4.6-14 MOFAdata_1.6.0 MOFA2_1.1.19
## [7] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.4
## [10] purrr_0.3.4 readr_1.4.0 tidyr_1.1.2
## [13] tibble_3.0.6 tidyverse_1.3.0 ggplot2_3.3.3
## [16] data.table_1.13.6 BiocStyle_2.18.1
##
## loaded via a namespace (and not attached):
## [1] Rtsne_0.15 colorspace_2.0-0 ggsignif_0.6.0
## [4] ellipsis_0.3.1 rio_0.5.16 fs_1.5.0
## [7] rstudioapi_0.13 farver_2.0.3 ggrepel_0.9.1
## [10] lubridate_1.7.9.2 xml2_1.3.2 splines_4.0.3
## [13] R.methodsS3_1.8.1 mnormt_2.0.2 knitr_1.31
## [16] jsonlite_1.7.2 km.ci_0.5-2 broom_0.7.4
## [19] dbplyr_2.1.0 R.oo_1.24.0 pheatmap_1.0.12
## [22] uwot_0.1.10 HDF5Array_1.18.1 BiocManager_1.30.10
## [25] compiler_4.0.3 httr_1.4.2 basilisk_1.2.1
## [28] backports_1.2.1 assertthat_0.2.1 Matrix_1.3-2
## [31] cli_2.3.0 htmltools_0.5.1.1 tools_4.0.3
## [34] gtable_0.3.0 glue_1.4.2 reshape2_1.4.4
## [37] rappdirs_0.3.3 Rcpp_1.0.6 carData_3.0-4
## [40] cellranger_1.1.0 vctrs_0.3.6 rhdf5filters_1.2.0
## [43] nlme_3.1-152 psych_2.0.12 xfun_0.20
## [46] openxlsx_4.2.3 rvest_0.3.6 lifecycle_0.2.0
## [49] rstatix_0.6.0 zoo_1.8-8 scales_1.1.1
## [52] basilisk.utils_1.2.2 hms_1.0.0 MatrixGenerics_1.2.1
## [55] parallel_4.0.3 rhdf5_2.34.0 RColorBrewer_1.1-2
## [58] yaml_2.2.1 curl_4.3 gridExtra_2.3
## [61] reticulate_1.18 KMsurv_0.1-5 stringi_1.5.3
## [64] highr_0.8 S4Vectors_0.28.1 corrplot_0.84
## [67] BiocGenerics_0.36.0 filelock_1.0.2 zip_2.1.1
## [70] rlang_0.4.10 pkgconfig_2.0.3 matrixStats_0.58.0
## [73] evaluate_0.14 lattice_0.20-41 Rhdf5lib_1.12.1
## [76] labeling_0.4.2 cowplot_1.1.1 tidyselect_1.1.0
## [79] plyr_1.8.6 magrittr_2.0.1 bookdown_0.21
## [82] R6_2.5.0 IRanges_2.24.1 magick_2.6.0
## [85] generics_0.1.0 DelayedArray_0.16.1 DBI_1.1.1
## [88] mgcv_1.8-33 pillar_1.4.7 haven_2.3.1
## [91] foreign_0.8-81 withr_2.4.1 abind_1.4-5
## [94] modelr_0.1.8 crayon_1.4.0 car_3.0-10
## [97] survMisc_0.5.5 tmvnsim_1.0-2 rmarkdown_2.6
## [100] grid_4.0.3 readxl_1.3.1 reprex_1.0.0
## [103] digest_0.6.27 xtable_1.8-4 R.utils_2.10.1
## [106] stats4_4.0.3 munsell_0.5.0