title: "Cancer Trials Explorer (CTE) -- examples" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{explorer} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8}
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(dplyr, warn = FALSE) # for data wrangling library(DT) # use datatables to format outcomes
The CTE library pulls data from several sources:
ClinicalTrials.gov hosts data for hundreds of thousand clinical trials (CTs) targeting a wide variety of conditions.
The goal of this library is to focus on CTs interventional (as opposed to observational) treating a cancer-related condition.
Accordingly, I included only CTs with terms related to cancer (e.g., cancer, tumor, leukemia, melanoma, glaucoma) in the conditions targeted by their intervention.
To access the data you first need to load the library.
library(CTE)
Then, the dataset is stored in separate files available in lazy mode (i.e., loaded when needed).
For example, to query the list of cancer-related clinical trials in the data you can type the following:
Clinical trial basic information
data(ct_info)
ct_info
Clinical trial list of associated interventions (e.g., drug treatments)
data(ct_interv)
ct_interv
Clinical trial list of associated targeted conditions
data(ct_cond)
ct_cond
Drug bank list of drugs
data(drugbank)
drugbank
Repurposing Hub list of drugs with functional annotations
data(repurp)
repurp
Gene targets from TTD
data(gene_targets)
gene_targets
The library also includes functions to match drugs by name across the different datasets, or to query a particular drug name among the CT interventions.
For example, below I show how to obtain a catalog of interventions in cancer-related clinical trials matched with the string bortezomib
.
tbl <- find_intervention("bortezomib")
The function returns a list of interventions matched with the name bortezomib
. Each intervention is associated with a unique clinical trial ID, title, status, date of registration, a detailed description of the study, and the number of enrolled subjects (either expected or actual) for r dplyr::n_distinct(tbl$id)
clinical trials (out of r nrow(tbl)
entries).
I use the function datatable
from the package DT
to show the results as HTML table.
require(DT) DT::datatable(dplyr::select(tbl, -enrollment,-enrollment_type) , rownames = FALSE , filter = "top" , extensions = "Buttons" , plugins = "ellipsis" , options = list ( dom = 'Bfrtip' , buttons = c('copy', 'csv') , columnDefs = list(list( targets = c(2, 5) , render = JS("$.fn.dataTable.render.ellipsis( 125 )") ) ) ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.