## ----knitr-init, include = FALSE----------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----load-deps----------------------------------------------------------------
library(PharmacoGx)
library(gDRimport)

## ----get-pset-example, eval = FALSE-------------------------------------------
# pset <- getPSet("Tavor_2020")
# pset

## ----load-mocked-psets, include = FALSE---------------------------------------
read_mocked_PSets <- function(canonical = FALSE) {
  qs2::qs_read(
    system.file("extdata", "data_for_unittests", "PSets.qs2", package = "gDRimport")
  )
}
pset <- testthat::with_mocked_bindings(
    availablePSets = read_mocked_PSets,
    .package = "PharmacoGx",
    suppressMessages(getPSet(
      "Tavor_2020", psetDir = system.file("extdata/pset", package = "gDRimport")
    ))
)
pset

## ----convert-pset-to-dt-------------------------------------------------------
# Store treatment response data in df_ 
dt <- convert_pset_to_df(pharmacoset = pset)
str(dt)

## ----subset-by-cell-line------------------------------------------------------
# example subset using only 1 cell line
subset_cl <- dt$Clid[1]
x <- dt[Clid == subset_cl]
x

## ----run-gdr-pipeline, eval = FALSE-------------------------------------------
# # RUN DRUG RESPONSE PROCESSING PIPELINE
# se <- gDRcore::runDrugResponseProcessingPipeline(x)
# se

## ----convert-se-to-dt, eval = FALSE-------------------------------------------
# # Convert Summarized Experiments to data.table
# # Available SEs : "RawTreatred", "Controls", "Normalized", "Averaged", "Metrics"
# 
# str(gDRutils::convert_se_assay_to_dt(se[[1]], "Averaged"))
# str(gDRutils::convert_se_assay_to_dt(se[[1]], "Metrics"))

## ----reset-identifiers, include = FALSE---------------------------------------
gDRutils::reset_env_identifiers()

## ----session-info-------------------------------------------------------------
sessionInfo()

