genetex_to_redcap: Apply NLP to genomic reports to import into the Genomics...

Description Usage Arguments Value Examples

View source: R/genetex_to_redcap.R

Description

'genetex_to_redcap()' provides natural language processing tools to abstract data from a variety of genomic reports and import them to REDCap

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
genetex_to_redcap(
  data = dplyr::tibble(Results = readr::clipboard()),
  record_id,
  instrument_instance,
  platform,
  lesion_tag = "",
  genomics_tissue_type = "",
  date_collected = "",
  redcap_uri,
  redcap_api_token = "",
  import_tool = readr::read_csv("data-raw/genomics_import_tool.csv")
)

Arguments

data

The data frame of the genomic report of interest. This can be copied to the Clipboard from the EHR report by "selecting all" and then "copy". That is the default. If you don't use the clipboard function, you can use a data frame of the text file. The single column data frame should be labeled "Results". Required.

record_id

A string of the the record_id of the subject you want to import (e.g. "John Doe" or "1-1"). Required.

instrument_instance

A numeric representing the instrument instance for the genomics instrument (e.g. 1). Required.

platform

String of the platform used to generate the genomics report. Acceptable strings include: MGH, SNaPshot, BWH, Oncopanel, Guardant, Guardant Health, Foundation or fmi. Case is not sensitive. Required.

lesion_tag

A string of the lesion tag for the genomics instrument (e.g. "Right Arm Primary Lesion"). Optional.

genomics_tissue_type

A string of the genomics tissue type used in the report (e.g. "primary cutaneous lesion" or "MCCUP" or "met"). Default is blank. Optional.

date_collected

A string of the date the genomic sample was collected in YYYY-MM-DD format (e.g. "2020-12-31). Optional.

redcap_uri

A string of the url for the REDCap system you are working with.

redcap_api_token

A user-specific alphanumeric string that serves as the password for the REDCap project. The default is blank, which means the data will not be sent to REDCap. Optional.

import_tool

a data frame of the REDCap import tool. The default is a csv file stored in the data-raw file. This should be in "long format" and the column header/variable name should be "variables". Required

Value

A data frame that can be imported into the Genomics Instrument in REDCap (https://www.themillerlab.io/post/optimizing_rwd_collection-genomics_instrument/)

Examples

1
2
3
4
5
6
7
8
9
snapshot_sample_report %>%
 genetex_to_redcap(
  record_id = "Jane Doe",
  instrument_instance = 1,
  genomics_tissue_type = "Skin",
  platform = "mgh",
  date_collected = "2021-01-01",
  lesion_tag = "Right Arm Primary",
  )

TheMillerLab/genetex documentation built on Dec. 18, 2021, 4:09 p.m.