adt_get_biocard: Import BIOCARD Data

Description Usage Arguments Value Examples

View source: R/adt_biocard.R

Description

Import BIOCARD data from source files and generate the analysis dataset.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
adt_get_biocard(
  path = ".",
  merge_by = c("cognitive", "diagnosis", "csf", "hippocampus", "amygdala",
    "entorhinal"),
  window = 730,
  window_overlap = FALSE,
  pattern = "*.xls",
  src_files = NULL,
  src_tables = NULL,
  par_apoe = list(levels = c(3.4, 4.4, 2.4), labels = c(1, 2, NA)),
  verbose = TRUE
)

Arguments

path

Directory of the BIOCARD data files. Default value is the working directory,

merge_by

A character string indicating the source baseline time for aligning the BIOCARD data when merging multiple files. Options include "diagnosis", "cognitive", "csf", "hippocampus", "amydata" and "entorhinal".

window

An integer (unit of days) indicating the maximum acceptable gap time for merging a biomarker test to base data. Default is 730 days. For most data, the time windows are calculated from the baseline time (left window = the midpoint between current and the previous time point; right window = the midpoint between current and the next time point). If the time windows are longer than the maximum acceptable length, then force to select biomarkers within the maximum window length we set. For the first and last baseline time, since there is no "previous" or "next" time point available, use the maximum acceptable window length instead.

window_overlap

A logical value indicating the time window setting. Default "False." If true, all time windows will set from 1/2 "window" days before the baseline time to the 1/2 "window" days after baseline. In this case, the time windows may overlap, which means some biomarkers may be merged into multiple baseline data. If false, the windows will be calculated from the baseline times. The left window is set to be the midpoint between the current and the previous time point. The right window is set to be the midpoint between the current and the next time point. For the first and last baseline time, since there is no "previous" or "next" time point available, use the maximum acceptable window length (set by the parameter "window") instead.

pattern

A string indicating the pattern of all the data files. Default is "*.xls" (should work for both .xls and .xlsx). This pattern is used to read all table names from the path.

src_files

Updated dictionary file for source file features. See dict_src_files for more details.

src_tables

Updated dictionary file for source table features. See dict_src_tables for more details.

par_apoe

A list indicating the map for apoecode. Default value is list(levels = c(3.4, 4.4, 2.4),labels = c(1, 2, NA))).

Value

Returned the analysis dataset with: patients' ids, baseline times, corresponding biomarkers, biomarker test times, etc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
## with default unoverlaped window
dt_biocard <- get_biocard(path, merge_by = "diagnosis")

## with costomized window
dt_biocard <- get_biocard(path, merge_by = "diagnosis",
                          window = 365,
                          window_overlap = TRUE)

## with dictionary provided by user
dt_biocard <- get_biocard(path, merge_by = "dx",
                          src_tables = "dict_src_tables.xlsx")

## End(Not run)

olssol/ADTool documentation built on Feb. 12, 2021, 3:49 a.m.