Skip to contents

The one import of the gDR report and of every other caller: it reads any of the supported inputs, cleans the metadata, and annotates drugs and cell lines, returning the raw data that gDRcore::runDrugResponseProcessingPipeline() processes. run_report() calls it for step 1, so a caller who imports with it gets the same table as the report.

Usage

import_data(
  manifest_file = NULL,
  template_file = NULL,
  results_file = NULL,
  instrument = NULL,
  cell_line_annotation = NULL,
  drug_annotation = NULL,
  long_table = NULL,
  prism_data_path = NULL,
  meta_data_path = NULL,
  cell_line_data_path = NULL,
  treatment_data_path = NULL,
  annotate = TRUE,
  annotation_dir = NULL
)

Arguments

manifest_file

character, file path(s) to manifest(s)

template_file

character, with datapaths and names of results file(s) or character with file path of templates file(s)

results_file

character, with datapaths and names of results file(s) or character with file path of results file(s)

instrument

string with type of instrument used. NULL (default) detects it from the first results file with gDRimport::detect_file_format().

cell_line_annotation

optional cell line annotation, a data.table or the path of a CSV. If NULL (default), bench data is annotated from gDRinternal or gDRtestData, and the annotation pass uses the annotation already in the data.

drug_annotation

optional drug annotation, as cell_line_annotation.

long_table

character, file path(s) of a long table (load_long_table()).

prism_data_path, meta_data_path

character, the PRISM data and metadata files.

cell_line_data_path, treatment_data_path

character, the PRISM level 6 cell line and treatment files.

annotate

logical, whether to run the annotation pass. Default TRUE.

annotation_dir

optional directory in which to write the annotation used, as drug_annotation.csv and cell_line_annotation.csv.

Value

a data.table, carrying the import record of gDRimport in its gDR_import attribute.

Details

The input type is decided as in run_report(): a long table if long_table is given, PRISM level 6 if prism_data_path, cell_line_data_path and treatment_data_path are, PRISM level 5 if only prism_data_path is, and otherwise bench data from the manifest, templates and raw files.

Then, with annotate = TRUE, drugs and cell lines are annotated with gDRcore::annotate_dt_with_drug() and annotate_dt_with_cell_line(), from the annotation given or, without it, from the annotation the data already carries.

Examples

td <- get_test_data()
i_df <- import_data(manifest_path(td), template_path(td), result_path(td))
#> New names:
#> • `` -> `...2`
#> • `` -> `...3`
#> • `` -> `...4`
#> • `` -> `...5`
#> • `` -> `...6`
#> • `` -> `...7`
#> • `` -> `...8`
#> • `` -> `...9`
#> • `` -> `...10`
#> • `` -> `...11`
#> • `` -> `...12`
#> • `` -> `...13`
#> • `` -> `...14`
#> • `` -> `...15`
#> • `` -> `...16`
#> • `` -> `...17`
#> • `` -> `...18`
#> • `` -> `...19`
#> • `` -> `...20`
#> • `` -> `...21`
#> • `` -> `...22`
#> • `` -> `...23`
#> • `` -> `...24`
#> • `` -> `...25`
#> INFO [2026-12-03 18:09:04] Manifest loaded successfully
#> INFO [2026-12-03 18:09:04] Reading Template_7daytreated.xlsx with load_templates_xlsx
#> INFO [2026-12-03 18:09:04] Reading Template_Untreated.xlsx with load_templates_xlsx
#> INFO [2026-12-03 18:09:04] Loading Template_7daytreated.xlsx
#> INFO [2026-12-03 18:09:04] Loading Template_Untreated.xlsx
#> INFO [2026-12-03 18:09:04] Templates loaded successfully!
#> INFO [2026-12-03 18:09:04] Reading file /home/runner/work/_temp/Library/gDRimport/extdata/data1/RawData_day0.xlsx, sheet Readout_0077vs0068_day7
#> New names:
#> • `` -> `...1`
#> • `` -> `...2`
#> • `` -> `...3`
#> • `` -> `...4`
#> • `` -> `...5`
#> • `` -> `...6`
#> • `` -> `...7`
#> • `` -> `...8`
#> • `` -> `...9`
#> • `` -> `...10`
#> • `` -> `...11`
#> • `` -> `...12`
#> • `` -> `...13`
#> • `` -> `...14`
#> • `` -> `...15`
#> • `` -> `...16`
#> • `` -> `...17`
#> • `` -> `...18`
#> • `` -> `...19`
#> • `` -> `...20`
#> • `` -> `...21`
#> • `` -> `...22`
#> • `` -> `...23`
#> • `` -> `...24`
#> • `` -> `...25`
#> INFO [2026-12-03 18:09:04] Plate 201904190a read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904190b read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904190c read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904190d read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904190e read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904190f read; 384 wells
#> INFO [2026-12-03 18:09:04] File done
#> INFO [2026-12-03 18:09:04] Reading file /home/runner/work/_temp/Library/gDRimport/extdata/data1/RawData_day7.xlsx, sheet Readout_0077vs0068_day7
#> New names:
#> • `` -> `...1`
#> • `` -> `...2`
#> • `` -> `...3`
#> • `` -> `...4`
#> • `` -> `...5`
#> • `` -> `...6`
#> • `` -> `...7`
#> • `` -> `...8`
#> • `` -> `...9`
#> • `` -> `...10`
#> • `` -> `...11`
#> • `` -> `...12`
#> • `` -> `...13`
#> • `` -> `...14`
#> • `` -> `...15`
#> • `` -> `...16`
#> • `` -> `...17`
#> • `` -> `...18`
#> • `` -> `...19`
#> • `` -> `...20`
#> • `` -> `...21`
#> • `` -> `...22`
#> • `` -> `...23`
#> • `` -> `...24`
#> • `` -> `...25`
#> INFO [2026-12-03 18:09:04] Plate 201904197a read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904197b read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904197c read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904197d read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904197e read; 384 wells
#> INFO [2026-12-03 18:09:04] Plate 201904197f read; 384 wells
#> INFO [2026-12-03 18:09:04] File done
#> INFO [2026-12-03 18:09:04] Merging data
#> INFO [2026-12-03 18:09:04] Merging the metadata (manifest and treatment files)
#> WARN [2026-12-03 18:09:04] 4608 well loaded, 768 wells discarded for lack of annotation,
#>     3840 data point selected