dot-resolve_duplicates: Select unique NGS report when multiple are available

.resolve_duplicatesR Documentation

Select unique NGS report when multiple are available

Description

See 'select_unique_ngs' for details on selection criteria

Usage

.resolve_duplicates(x, data_cohort, oncotree_code, sample_type, min_max_time)

Arguments

x

sample ID to select unique NGS report for

data_cohort

CPT (NGS) dataframe returned from the create_analytic_cohort function

oncotree_code

character vector specifying which sample OncoTree codes to keep. See "cpt_oncotree_code" column of data_cohort argument above to get options.

sample_type

character specifying which type of genomic sample to prioritize, options are "Primary", "Local" and "Metastasis". Default is to not select a NGS sample based on the sample type.

min_max_time

character specifying if the first or last genomic sample recorded should be kept. Options are "min" (first) and "max" (last).

Value

a dataframe of samples with one observation per patient.

Examples


nsclc_2_0 <- pull_data_synapse("NSCLC", version = "v2.0-public")

ex1 <- create_analytic_cohort(
  data_synapse = nsclc_2_0$NSCLC_v2.0,
  stage_dx = c("Stage IV"),
  histology = "Adenocarcinoma"
)

 samples_data1 <- .resolve_duplicates(
   x = "GENIE-MSK-P-0025741",
  data_cohort = ex1$cohort_ngs,
  oncotree_code = "LUAD",
  sample_type = "Metastasis",
  min_max_time = "max"
)

samples_data2 <- .resolve_duplicates(
   x = "GENIE-MSK-P-0025741",
  data_cohort = ex1$cohort_ngs,
  oncotree_code = "LUAD",
  sample_type = "Primary",
  min_max_time = "max"
)


genieBPC documentation built on Sept. 11, 2024, 8:29 p.m.