Skip to content

Commit

Permalink
Added CTRP treatmentIDs to use for examples and test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Mar 7, 2024
1 parent 7c96efd commit 5833547
Show file tree
Hide file tree
Showing 5 changed files with 607 additions and 1 deletion.
20 changes: 19 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,22 @@
#' data(cell_model_passports_models)
#' head(cell_model_passports_models)
#' @source https://cog.sanger.ac.uk/cmp/download/model_list_20240103.csv
"cell_model_passports_models"
"cell_model_passports_models"


#' ctrp_treatmentIDs is a preprocessed version of the CTRP treatment metadata.
#'
#' Data was obtained from "https://ctd2-data.nci.nih.gov/Public/Broad/CTRPv2.0_2015_ctd2_ExpandedDataset/CTRPv2.0_2015_ctd2_ExpandedDataset.zip"
#' and preprocessed to only get two columns: CTRP.treatmentid and CTRP.broad_cpd_id.
#'
#' @format A data table with 2 columns and 545 rows.
#' \describe{
#' \item{CTRP.treatmentid}{`char` The treatment id of the all the compounds used in the experiment.}
#' \item{CTRP.broad_cpd_id}{`char` The broad compound id of the all the compounds used in the experiment.}
#' }
#' @usage data(ctrp_treatmentIDs)
#' @examples
#' data(ctrp_treatmentIDs)
#' head(ctrp_treatmentIDs)
#' @source https://ctd2-data.nci.nih.gov/Public/Broad/CTRPv2.0_2015_ctd2_ExpandedDataset/CTRPv2.0_2015_ctd2_ExpandedDataset.zip
"ctrp_treatmentIDs"
14 changes: 14 additions & 0 deletions data-raw/ctrp_treatmentMetadata.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## File: v20.meta.per_compound.txt
## obtained from "https://ctd2-data.nci.nih.gov/Public/Broad/CTRPv2.0_2015_ctd2_ExpandedDataset/CTRPv2.0_2015_ctd2_ExpandedDataset.zip"

# Load the treatment metadata file
filePath <- system.file("extdata", "v20.meta.per_compound.txt", package = "AnnotationGx")
ctrp_treatmentIDs <- data.table::fread(filePath)[, .(cpd_name, broad_cpd_id)]

# Rename the columns
data.table::setnames(
ctrp_treatmentIDs,
c("cpd_name", "broad_cpd_id"), c("CTRP.treatmentid", "CTRP.broad_cpd_id"))

# Save the treatment metadata as a data object
usethis::use_data(ctrp_treatmentIDs, overwrite = TRUE)
Binary file added data/ctrp_treatmentIDs.rda
Binary file not shown.
Loading

0 comments on commit 5833547

Please sign in to comment.