Skip to contents

Prepare the beam.specs data.frame for BEAM model fitting. Specifies the univariate models needed to compute the BEAMR set p-values.

Usage

prep_beam_specs(
  beam.data,
  endpts,
  firth = TRUE,
  adjvars = NULL,
  endptmdl = NULL
)

Arguments

beam.data

A beam.data object from prep_beam_data

endpts

A vector of endpoint variable names in main.data

firth

A logical value. If TRUE (defaul) fit Firth penalized Cox model to account for monotone likelihood in the presence of rare events or predictors. If FALSE fit usual Cox model.

adjvars

Default NULL, optional vector of adjustment variable names in main.data

endptmdl

Optional model specification data.frame with endpoint name column called "endpt" and model string column called "mdl"

Value

The beam.specs object, a data.frame specifying the omics-endpoint association models to be fit

Examples

data(clinf)
data(omicdat)
data(omicann)
data(setdat)
test.beam.data <- prep_beam_data(main.data=clinf, mtx.data=omicdat,
                                 mtx.anns=omicann, set.data=setdat,
                                 set.anns=NULL, n.boot=10, seed=123)
#> Checking inputs: Tue Jul 30 13:51:24 2024
#>   Checking that each element of mtx.data is a matrix: Tue Jul 30 13:51:24 2024
#>   Checking that each element of mtx.anns is a data.frame: Tue Jul 30 13:51:24 2024
#> Aligning main.data with each mtx.data: Tue Jul 30 13:51:24 2024
#>   Working on mtx.data Lesion (1 of 2): Tue Jul 30 13:51:24 2024
#>   Working on mtx.data RNA (2 of 2): Tue Jul 30 13:51:24 2024
#> Warning: Some ids not matched; returning NAs for those.
#>   Working on mtx.anns: Tue Jul 30 13:51:24 2024
#>   Matching matrix 1 with annotations: Tue Jul 30 13:51:24 2024
#>   Matching matrix 2 with annotations: Tue Jul 30 13:51:24 2024
#>   Checking set.data: Tue Jul 30 13:51:24 2024
#>     Ordering and indexing set.data: Tue Jul 30 13:51:24 2024
#>     Checking section 1 of 40 of set.data: Tue Jul 30 13:51:24 2024
#> Generating bootstrap index matrix: Tue Jul 30 13:51:24 2024
#> Packaging and returning result: Tue Jul 30 13:51:24 2024
#Without adjustment
prep_beam_specs(beam.data=test.beam.data, endpts=c("MRD29", "OS", "EFS"),
                firth=TRUE)
#> MRD29 is continuous, fitting lm
#> OS is survival endpoint, fitting coxphf2
#> EFS is survival endpoint, fitting coxphf2
#>           name    mtx                                         mdl
#> 1 Lesion.MRD29 Lesion    lm(MRD29~mtx.row,data=main.data,model=T)
#> 2    RNA.MRD29    RNA    lm(MRD29~mtx.row,data=main.data,model=T)
#> 3    Lesion.OS Lesion  coxphf2(OS~mtx.row,data=main.data,model=T)
#> 4       RNA.OS    RNA  coxphf2(OS~mtx.row,data=main.data,model=T)
#> 5   Lesion.EFS Lesion coxphf2(EFS~mtx.row,data=main.data,model=T)
#> 6      RNA.EFS    RNA coxphf2(EFS~mtx.row,data=main.data,model=T)
# With adjustment
prep_beam_specs(beam.data=test.beam.data, endpts=c("OS", "EFS"),
                adjvars=c("MRD29"), firth=TRUE)
#> OS is survival endpoint, fitting coxphf2
#> EFS is survival endpoint, fitting coxphf2
#>         name    mtx                                               mdl
#> 1  Lesion.OS Lesion  coxphf2(OS~mtx.row+MRD29,data=main.data,model=T)
#> 2     RNA.OS    RNA  coxphf2(OS~mtx.row+MRD29,data=main.data,model=T)
#> 3 Lesion.EFS Lesion coxphf2(EFS~mtx.row+MRD29,data=main.data,model=T)
#> 4    RNA.EFS    RNA coxphf2(EFS~mtx.row+MRD29,data=main.data,model=T)