knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Eugene Chekalin, Billy Zeng, Patrick Newbury, Benjamin Glicksberg, Jing Xing, Ke Liu, Dimitri Joseph, Bin Chen

Edited on September 28, 2020; Compiled on September 29, 2020

Package overview

As the field of precision medicine progresses, we start to tailor treatments for cancer patients classified not only by their clinical, but also by their molecular features. The emerging cancer subtypes defined by these features require dedicated resources to assist the discovery of drug candidates for preclinical evaluation. Voluminous cancer patient gene expression profiles have been accumulated in public databases, enabling the creation of a cancer-specific expression signature. Meanwhile, large-scale gene expression profiles of chemical compounds became available in recent years. By matching the cancer-specific expression signature to compound-induced gene expression profiles from large drug libraries, researchers can prioritize small molecules that present high potency to reverse expression of signature genes for further experimental testing of their efficacy. This approach has proven to be an efficient and cost-effective way to identify efficacious drug candidates. However, the success of this approach requires multiscale procedures, imposing significant challenges to many labs. Therefore, we present OCTAD (http://octad.org): an open workspace for virtually screening compounds targeting precise cancer patient groups using gene expression features. We have included 19,127 patient tissue samples covering 50 cancer types, and expression profiles for 12,442 distinct compounds. We will continue to include more tissue samples. We streamline all the procedures including deep-learning based reference tissue selection, disease gene expression signature creation, drug reversal potency scoring, and in silico validation. We release OCTAD as a web portal and a standalone R package to allow experimental and computational scientists to easily navigate the tool. The code and data can also be employed to answer various biological questions.

How to Install

Before octad library installation, install the required package octad.db via the link octad.db. octad.db includes all data files required for computation (size: ~400 M).

install.packages("https://chenlab-data-public.s3.amazonaws.com/octad/octad.db_0.99.0.tar.gz%3Fdl%3D0",
                 method="libcurl",repos=NULL,type="source")

It takes a few minutes to install the package and verify files.

Next install the octad package:

devtools::install_github('Bin-Chen-Lab/octad')
library(octad)

Afterward, the pipeline will be ready to run.

Workflow

We use Hepatocellular Carcinoma (HCC) to illustrate the utility of the desktop pipeline. We provide the code and data for investigating differential expression, pathway enrichment, drug prediction and hit selection, and in silico validation. In this workflow, we will select case tissue samples from our compiled TCGA data and compute control tissue samples from the GTEx data. Note that the compiled data contains adjacent normal samples which can also serve as control tissues. By default, the octad package uses Small OCTAD dataset containing expression values only for LINCS 978 landmark genes required for sRGES score computation. To download the full expression values, please refer to the link octad.counts.and.tpm.h5 (~3G). We recommend to use the full expression matrix. By default, computated results are stored in the working directory.

Select case samples

Choosing cases (tumor samples from the phenoDF data.frame) and controls (corresponding samples treated as background such as normal tissue, adjacent normal tissue or tumor tissue samples without a specific mutation) is critical to achieving the best results. Several methods are included in the provided code which demonstrates multiple control sample selection methods. There are no built-in validation steps to evaluate case samples. Visualization of cases in a t-SNE (t-Distributed Stochastic Neighbor Embedding) plot could help understand their relations with other OCTAD samples. Samples sharing similar transcriptomic profiles tend to cluster together in the t-SNE plot. The cases scattering in multiple clusters are not recommended to choose as a group. Phenotype data frame phenoDF contains tissue types including normal tissue, adjacent normal tissue, primary cancer, recurrent cancer, and metastatic cancer.

To list all available samples from the octad database, use the phenoDF data frame.

head(phenoDF)

To select HCC samples, subset the phenoDF:

#select data
HCC_primary=subset(phenoDF,cancer=='liver hepatocellular carcinoma'&sample.type == 'primary') #select data
case_id=HCC_primary$sample.id #select cases

The sample ids will be stored in the character vector case_id. The code can be easily modified to select for other cancers or a set of samples based on mutations and copy numbers (e.g., TP53 mutation or MYC amplification). It is also recommended to use the R package cgdsr to select TCGA samples based on more clinical and molecular features.

#choose breast invasive carcinoma samples with PIK3CA mutation 
BIC_with_PIK3_primary=subset(phenoDF,cancer=='breast invasive carcinoma'&sample.type == 'primary'&grepl('PIK3CA',mutation_list))

Compute or select control samples

Use the function computeRefTissue to compute appropriate normal tissues via comparing gene expression features between case samples and normal tissue samples. Users can select adjacent normal tissue samples if available. By default, features from the precomputed AutoEncoder file are used, but other features such as top varying genes across samples can be employed as well. Pairwise Spearman correlation is computed between every case sample and every normal sample using these features. For each normal sample, its median correlation with all case samples is then computed. Top correlated normal samples (defined by control_size) are then selected as control.

#computing top 50 reference tissues 
control_id=computeRefTissue(case_id,outputFolder='',output=TRUE,adjacent=TRUE,source = "octad",control_size = 50)  
# use adjacent normal tissue samples as control_id allow you to avoid running this function    
control_id =subset(phenoDF,cancer=='Liver Hepatocellular Carcinoma'&
           sample.type == 'adjacent' & data.source == 'TCGA')  
#by default the autoencoder is used. User can use expression data to compute reference tissue  
expression_log2=loadOctadCounts(sample_vector=phenoDF$sample.id,
        type='tpm',file='octad.counts.and.tpm.h5')  
control_id=computeRefTissue(case_id, control_size = 50,expSet=expression_log2,source='side')  

Alternatively, it is possible to select the samples manually:

HCC_adjacent=subset(phenoDF,cancer=='liver hepatocellular carcinoma'&sample.type == 'adjacent'&data.source == 'TCGA') 
control_id=HCC_adjacent$sample.id

The relationships among case, control and other samples can be visualised through a t-SNE matrix precomputed based on the features derived from autoencoder.

tsne$type <- "others"
tsne$type[tsne$sample.id %in% case_id] <- "case"
tsne$type[tsne$sample.id %in% control_id] <- "control"

#plot
(p2 <- ggplot(tsne, aes(X, Y, color = type)) + geom_point(alpha = 0.4)+
    labs(title = paste ('TNSE PLOT'), x= 'TSNE Dim1', y='TSNE Dim2', caption="OCTAD")+
    theme_bw())

Compute gene differential expression between case and control samples

Differential expression can be computed via edgeR, limma + voom, or DESeq2. By default, we use edgeR in the analysis. Since the function diffExp computes differentially expressed genes between case_id and control_id within the same data matrix, it can be used to find differentially expressed genes between any two groups of samples. By default, a small dataset containing only 978 genes shared with the LINCS database is used.

res=diffExp(case_id,control_id,source='octad.small',output=TRUE)
head(res)
#Use simple subset to filter the DE results:
res=subset(res,abs(log2FoldChange)>1&padj<0.001)

To use the whole OCTAD dataset from octad.counts.and.tpm.h5 as input, make sure the required .h5 file is stored in the R working directory or the whole path to the file is specified:

res=diffExp(case_id,control_id,source='octad.whole',
    output=TRUE,n_topGenes=10000,file='octad.counts.and.tpm.h5')

We can also perform DE analysis using an external dataset. Below is an example to perform DE analysis between tumor and non-tumor samples using the count data downloaded from GEO GSE144269.

data=read.table('GSE144269_RSEM_GeneCounts.txt',header=TRUE,row.names=1)
samples=colnames(data) #define the case and control cohorts, A samples were obtained from tumors, B samples were obtained from adjacent tissue
case_id=samples[grepl('A_S',samples)]
control_id=samples[grepl('B_S',samples)]
res=diffExp(case_id,control_id,source='side',output=TRUE,n_topGenes=10000,
    expSet=log2(as.matrix(data)),annotate=FALSE) #compute DE

The diffExp function will produce data.frame with DE results. Please note that option annotate is not required to be TRUE, but in this case annotation will be performed. If using custom expression matrix, please make sure expSet row.names contains Ensembl IDs that are used to assign gene names and gene descriptions.

Compute reverse gene expression scores

The runsRGES function is used to identify the drugs that potentially reverses the disease signature. Use the code below to choose significant genes; this works by keeping genes that have low adjusted P-values and high log-fold changes.
Launch the sRGES computation. It takes a few minutes to compute RGES scores. After the job is finished, it will output files all_lincs_score.csv (RGES of individual profiles), sRGES.csv (summarized RGES of individual drugs) and dz_sig_used.csv (signature genes used for drug prediction). LINCS also provides the imputed expression of the whole transcriptome based on the 978 genes. We will add it in the future when its usage is fully evaluated. There is no good way available to choose an optimal sRGES threshold, but empirically < -0.2 is good to go

sRGES=runsRGES(res,max_gene_size=100,permutations=10000)

head(sRGES)

Validate results using published pharmacogenomics data

As the pharmacogenomic database CTRPv2 consists of efficacy data of 481 drugs in 860 cancer cell lines, we may leverage this database for further in silico validation of our predictions, even without running any biological experiment. We use the HepG2 cell line to validate the prediction of HCC drugs.

cell_line_computed=computeCellLine(case_id=case_id,
                    returnDF=TRUE,source='octad.small')

computeCellLine will produce an object with correlation scores for every cell line and case samples (stored as CellLineCorrelations.csv).

topLineEval(topline = c('HEPG2'),mysRGES = sRGES)

topLineEval will produce CellLineEval_drug_sensitivity_insilico_results.txt and two .html documents: 1. _auc_insilico_validation.html (correlation between drug AUC in the specified cell line and sRGES) 2. *_ic50_insilico_validation.html (correlation between drug IC50 in the specified cell line and sGRES)

Compute drug enrichment

After calculation of sRGES on the LINCS L1000 compound dataset, perform drug enrichment analysis to identify interesting drug classes whose member drugs are significantly enriched at the top of the prediction. Example drug classes include anti-inflammatories, EGFR inhibitors, and dipines (calcium channel blockers). OCTAD provides MESH, CHEMBL, and CHEM_CLUSTER for MeSH term enrichment, target enrichment, and chemical structure enrichment, respectively. The enrichment score is calculated using ssGSEA and its significance is computed by a permutation test.

octadDrugEnrichment(sRGES = sRGES, target_type = c('chembl_targets','mesh','ChemCluster'))

This analysis provides much information for following candidate selection and experiment design. First, the candidates selected from the same enriched class (i.e., MeSH term, target) are more likely to be true positive than those randomly selected from the top list. Second, when the ideal candidate is not available, it is reasonable to choose an alternative from the same class. Sometimes, it is necessary to choose a new drug for testing (e.g., a second generation of one inhibitor for the same target). Lastly, since many compounds have multiple MOAs, this analysis would help interpret the MOA of promising compounds.

Web-version and citation

Alternatively the database and the pipeline is available via website of the OCTAD project: http://octad.org/. If you use our work, please cite the OCTAD paper. Both OCTAD package and website was developed by Bin Chen laboratory. octad package is github available via link

Session information

Here is the output of sessionInfo() on the system where this document was compiled:

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] octad.db_0.99.0             octad_0.99.0                biocViews_1.57.3            Rfast_2.0.1                 RcppZiggurat_0.1.5         
 [6] Rcpp_1.0.5                  doParallel_1.0.15           iterators_1.0.12            foreach_1.5.0               rhdf5_2.33.9               
[11] DESeq2_1.29.14              RUVSeq_1.23.0               EDASeq_2.23.2               ShortRead_1.47.2            GenomicAlignments_1.25.3   
[16] SummarizedExperiment_1.19.7 DelayedArray_0.15.10        matrixStats_0.57.0          Matrix_1.2-18               Rsamtools_2.5.3            
[21] GenomicRanges_1.41.6        GenomeInfoDb_1.25.11        Biostrings_2.57.2           XVector_0.29.3              IRanges_2.23.10            
[26] S4Vectors_0.27.13           BiocParallel_1.23.2         Biobase_2.49.1              BiocGenerics_0.35.4         edgeR_3.31.4               
[31] limma_3.45.14               ggplot2_3.3.2               dplyr_1.0.2                 magrittr_1.5                BiocCheck_1.25.13          

loaded via a namespace (and not attached):
  [1] backports_1.1.10       aroma.light_3.19.0     BiocFileCache_1.13.1   splines_4.0.2          usethis_1.6.3          digest_0.6.25         
  [7] htmltools_0.5.0        fansi_0.4.1            memoise_1.1.0          remotes_2.2.0          annotate_1.67.1        R.utils_2.10.1        
 [13] askpass_1.1            prettyunits_1.1.1      jpeg_0.1-8.1           colorspace_1.4-1       blob_1.2.1             rappdirs_0.3.1        
 [19] xfun_0.16              jsonlite_1.7.1         callr_3.4.4            crayon_1.3.4           RCurl_1.98-1.2         roxygen2_7.1.1        
 [25] graph_1.67.1           genefilter_1.71.0      survival_3.2-7         glue_1.4.2             gtable_0.3.0           zlibbioc_1.35.0       
 [31] pkgbuild_1.1.0         Rhdf5lib_1.11.3        scales_1.1.1           DBI_1.1.0              xtable_1.8-4           progress_1.2.2        
 [37] bit_4.0.4              httr_1.4.2             getopt_1.20.3          RColorBrewer_1.1-2     ellipsis_0.3.1         pkgconfig_2.0.3       
 [43] XML_3.99-0.5           R.methodsS3_1.8.1      dbplyr_1.4.4           locfit_1.5-9.4         tidyselect_1.1.0       rlang_0.4.7           
 [49] AnnotationDbi_1.51.3   munsell_0.5.0          tools_4.0.2            cli_2.0.2              generics_0.0.2         RSQLite_2.2.0         
 [55] devtools_2.3.2         evaluate_0.14          stringr_1.4.0          yaml_2.2.1             processx_3.4.4         knitr_1.30            
 [61] bit64_4.0.5            fs_1.5.0               purrr_0.3.4            RBGL_1.65.0            whisker_0.4            R.oo_1.24.0           
 [67] xml2_1.3.2             biomaRt_2.45.3         compiler_4.0.2         rstudioapi_0.11        curl_4.3               png_0.1-7             
 [73] testthat_2.3.2         tibble_3.0.3           geneplotter_1.67.0     stringi_1.5.3          ps_1.3.4               GenomicFeatures_1.41.3
 [79] desc_1.2.0             lattice_0.20-41        vctrs_0.3.4            stringdist_0.9.6       pillar_1.4.6           lifecycle_0.2.0       
 [85] rhdf5filters_1.1.3     RUnit_0.4.32           optparse_1.6.6         BiocManager_1.30.10    bitops_1.0-6           rtracklayer_1.49.5    
 [91] R6_2.4.1               latticeExtra_0.6-29    hwriter_1.3.2          sessioninfo_1.1.1      codetools_0.2-16       MASS_7.3-53           
 [97] assertthat_0.2.1       pkgload_1.1.0          openssl_1.4.3          rprojroot_1.3-2        withr_2.3.0            GenomeInfoDbData_1.2.3
[103] hms_0.5.3              grid_4.0.2             rmarkdown_2.3          git2r_0.27.1           tinytex_0.26    


Bin-Chen-Lab/octad_desktop documentation built on Oct. 28, 2020, 11:13 a.m.