extract_design: Obtain design matrix (X) for variants from a mutation...

View source: R/extract_design.R

extract_designR Documentation

Obtain design matrix (X) for variants from a mutation annotation file (maf)

Description

Obtain design matrix (X) for variants from a mutation annotation file (maf)

Usage

extract_design(
  maf,
  variant_col = "variant",
  sample_id_col = "sample",
  variant_subset = NULL,
  ...
)

Arguments

maf

mutation annotation file – a data frame-like object with at least two columns containing variant labels and sample IDs. NOTE: uniqueness of rows of maf is assumed.

variant_col

name of the column in maf containing variant labels.

sample_id_col

name of the column in maf containing tumor sample IDs.

variant_subset

The subset of variant for which the design matrix is to be constructed. Either NULL, in which case all variants present in the maf file will be considered, or a character vector which will constitute the column names of the output.

...

Unused.

Value

returns an n_tumor x n_variants design matrix for variant indicators (in dgCMatrix format)

Examples


data("impact")
top_v <- variant_screen_mi(
  maf = impact,
  variant_col = "Variant",
  cancer_col = "CANCER_SITE",
  sample_id_col = "patient_id",
  mi_rank_thresh = 200,
  return_prob_mi = FALSE
)
var_design <- extract_design(
  maf = impact,
  variant_col = "Variant",
  sample_id_col = "patient_id",
  variant_subset = top_v
)
dim(var_design)



c7rishi/hidgenclassifier documentation built on June 14, 2024, 11:10 a.m.