This function runs diffDriver.

diffdriver(
  gene,
  mut,
  pheno,
  covariates = NULL,
  anno_dir = ".",
  k = 6,
  totalnttype = 96,
  BMRmode = c("signature", "regular"),
  output_dir = ".",
  output_prefix = "diffdriver_results"
)

Arguments

gene

A vector of genes to be included in the analysis.

mut

A data frame containing all somatic mutations from the cohort. The format is:

Chromosome

<int>

Position

<int>

Ref

<chr>

Alt

<chr>

SampleID

<chr>

Example:


Chromosome Position Ref Alt SampleID
1 19 55653236 C T TCGA-N6-A4VE-01A-11D-A28R-08
pheno

A data frame containing sample phenotypes. The format is: #'

SampleID

<chr>

Phenotype1

<dbl>

Phenotype2

<dbl>

...

...

Example:


SampleID SmokingCessation BMI
TCGA-N5-A4R8-01A-11D-A28R-08 0.5319630 20.0
TCGA-N5-A4RD-01A-11D-A28R-08 0.0448991 24.4
covariates

Optional sample-level covariates (e.g. age, sex) to adjust for. Either a path to a delimited file or a data frame. It must contain a SampleID column plus one or more covariate columns, which may be numeric or categorical (categorical columns are expanded into dummy variables). Only samples with complete covariate information are kept, and these are intersected with the mutation and phenotype samples. When supplied, the covariates are added to the regression inside ddmodel/ddmodel_nl under both the null and alternative models, so the phenotype effect is tested conditional on the covariates. The format is:

SampleID

<chr>

Covariate1

<dbl> or <chr>

Covariate2

<dbl> or <chr>

...

...

Example:


SampleID Age Sex
TCGA-N5-A4R8-01A-11D-A28R-08 56 M
TCGA-N5-A4RD-01A-11D-A28R-08 63 F

The default is NULL (no covariates).

anno_dir

The path to the directory with all the annotation files. Please download from Zenodo.The default is current folder

k

The number of topics used in modeling background mutation rate. The default is 6.

totalnttype

either 9 or 96. Will look for annotation files anno9_ntypexxx_annodata.txt when totalnttype is 9 or anno96_ntypexxx_annodata when totalnttype is 96.

BMRmode

There are two modes to run diffdriver. One is "signature", this will model individual level BMR, this is the default. The second one is "regular", this assumes BMR is the same across individuals, only models position-level difference.

output_dir

The path to output directory

output_prefix

The prefix being added to the output file names.