This vignette illustrates use cases and visualizations of the data found in the depmap package. See the depmap vignette for details about the datasets.
The depmap
package aims to provide a reproducible research framework to cancer dependency
data described by Tsherniak, Aviad, et al. “Defining a cancer dependency map.”
Cell 170.3 (2017): 564-576.. The
data found in the depmap
package has been formatted to facilitate the use of common R packages such as
dplyr
and ggplot2
. We hope that this package will allow researchers to more
easily mine, explore and visually illustrate dependency data taken from the
Depmap cancer genomic dependency study.
Perhaps the most interesting datasets found within the
depmap
package are those that relate to the cancer gene dependency score, such as
rnai
and crispr
. These datasets contain a score expressing how vital a
particular gene is in terms of how lethal the knockout/knockdown of that gene is
on a target cell line. For example, a highly negative dependency score implies
that a cell line is highly dependent on that gene.
Load necessary libaries.
library("dplyr")
library("ggplot2")
library("viridis")
library("tibble")
library("gridExtra")
library("stringr")
library("depmap")
library("ExperimentHub")
Load the rnai
, crispr
and copyNumber
datasets for visualization. Note: the
datasets listed below are from the 19Q3 release. Newer datasets, such as those
from the 20Q1 release are available.
## create ExperimentHub query object
eh <- ExperimentHub()
query(eh, "depmap")
## ExperimentHub with 82 records
## # snapshotDate(): 2024-10-24
## # $dataprovider: Broad Institute
## # $species: Homo sapiens
## # $rdataclass: tibble
## # additional mcols(): taxonomyid, genome, description,
## # coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
## # rdatapath, sourceurl, sourcetype
## # retrieve records with, e.g., 'object[["EH2260"]]'
##
## title
## EH2260 | rnai_19Q1
## EH2261 | crispr_19Q1
## EH2262 | copyNumber_19Q1
## EH2263 | RPPA_19Q1
## EH2264 | TPM_19Q1
## ... ...
## EH7555 | copyNumber_22Q2
## EH7556 | TPM_22Q2
## EH7557 | mutationCalls_22Q2
## EH7558 | metadata_22Q2
## EH7559 | achilles_22Q2
rnai <- eh[["EH3080"]]
mutationCalls <- eh[["EH3085"]]
metadata <- eh[["EH3086"]]
TPM <- eh[["EH3084"]]
copyNumber <- eh[["EH3082"]]
# crispr <- eh[["EH3081"]]
# drug_sensitivity <- eh[["EH3087"]]
By importing the depmap
data into the R environment, the data can be mined
more effectively. For example, if one interested researching soft tissue
sarcomas and wanted to search all such cancer cell lines for the gene with the
greatest dependency, it is possible to accomplish this task by using data
manipulation and visualization tools dplyr
and ggplot2
. Below, the rnai
dataset is selected for cell lines with “SOFT_TISSUE” in the CCLE name, and
displaying a list of the highest dependency scores.
## list of dependency scores
rnai |>
dplyr::select(cell_line, gene_name, dependency) |>
dplyr::filter(stringr::str_detect(cell_line, "SOFT_TISSUE")) |>
dplyr::arrange(dependency) |>
head(10)
## # A tibble: 10 × 3
## cell_line gene_name dependency
## <chr> <chr> <dbl>
## 1 FUJI_SOFT_TISSUE RPL14 -3.60
## 2 SJRH30_SOFT_TISSUE RAN -3.41
## 3 SJRH30_SOFT_TISSUE RPL14 -3.36
## 4 SJRH30_SOFT_TISSUE RBX1 -3.31
## 5 HS729_SOFT_TISSUE PSMA3 -3.22
## 6 SJRH30_SOFT_TISSUE RUVBL2 -3.13
## 7 KYM1_SOFT_TISSUE RPL14 -3.03
## 8 RH41_SOFT_TISSUE RBX1 -3.01
## 9 HS729_SOFT_TISSUE NUTF2 -2.90
## 10 SJRH30_SOFT_TISSUE NUTF2 -2.85
As the gene RPL14
appears several times in the top dependencies scores, it may
make an interesting candidate target. Below, a plot of the rnai
data is
displayed as a histogram showing the distribution of dependency scores for gene
RPL14
.
## Basic histogram
rnai |>
dplyr::select(gene, gene_name, dependency) |>
dplyr::filter(gene_name == "RPL14") |>
ggplot(aes(x = dependency)) +
geom_histogram() +
geom_vline(xintercept = mean(rnai$dependency, na.rm = TRUE),
linetype = "dotted", color = "red") +
ggtitle("Histogram of dependency scores for gene RPL14")
A more complex plot of the rnai
data, as shown below involves plotting the
distribution of dependency scores for gene RPL14
for each major type of
cancer, while highlighting the nature of mutations of this gene in such cancer
cell lines (e.g. if such are COSMIC hotspots, damaging, etc.). Notice that the
plot above reflects the same overall distribution in two dimensions.
meta_rnai <- metadata |>
dplyr::select(depmap_id, lineage) |>
dplyr::full_join(rnai, by = "depmap_id") |>
dplyr::filter(gene_name == "RPL14") |>
dplyr::full_join((mutationCalls |>
dplyr::select(depmap_id, entrez_id,
is_cosmic_hotspot, var_annotation)),
by = c("depmap_id", "entrez_id"))
p1 <- meta_rnai |>
ggplot(aes(x = dependency, y = lineage)) +
geom_point(alpha = 0.4, size = 0.5) +
geom_point(data = subset(
meta_rnai, var_annotation == "damaging"), color = "red") +
geom_point(data = subset(
meta_rnai, var_annotation == "other non-conserving"), color = "blue") +
geom_point(data = subset(
meta_rnai, var_annotation == "other conserving"), color = "cyan") +
geom_point(data = subset(
meta_rnai, is_cosmic_hotspot == TRUE), color = "orange") +
geom_vline(xintercept=mean(meta_rnai$dependency, na.rm = TRUE),
linetype = "dotted", color = "red") +
ggtitle("Scatterplot of dependency scores for gene RPL14 by lineage")
p1