Fits BaySIC BMR model

Share:

Description

Generates an MCMC model fit of the BaySIC BMR model

Usage

1
baysic.fit(dat.out, snv.cat, covar = NULL, excl.list = NULL, burn.in = 10000,n.samp = 25000, fn.jags = "baysic.jags", prior = NULL)

Arguments

dat.out

Output from baysic.data

snv.cat

a list of length C, where C is the number of sequence categories desired to be modeled (C≤q32). Each element of snv.cat should be a vector of character strings of trinucleotide motifs (e.g., c("ATA","ACA")) which define a group of motifs which are assumed to have the same background mutation rate.

covar

optional G \times Q matrix of gene-level covariate data, where G is the total number of genes and Q the number of covariates.

excl.list

optional vector of genes to be excluded from model fitting process. The format of excl.list can be either character or numeric, the former indicating the names of genes and the latter their order in ref.dat.

burn.in

an integer; represents the burn-in size to apply in the MCMC model fitting using JAGS. Defaults to 10,000

n.samp

an integer; represents the size of the MCMC posterior sample draw from the fitted model. Defaults to 25,000

fn.jags

a character string; corresponds to the file name and location of the JAGS model file to be written. Defaults to "baysic.jags" in the current working directory.

prior

optional vector of prior distribution specifications (as character strings). If is.null(prior)==FALSE, prior should be of length equal to all of the model parameters and formatted to follow the distributional notation of the JAGS model language. The order of the prior specification follows the format: SNV categories, any covariates (optional), indel λ parameter.

Value

Returns a list object with the following components:

fit.post

an mcmc object of the posterior draws of the BaySIC BMR model parameters

covar

covar object (if included in baysic.fit argument)

snv.cat

the snv.cat object in the original call

excl.list

excl.list object (if included in baysic.fit argument)

Author(s)

Nicholas B. Larson

See Also

baysic.data,baysic.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data(example.dat)
data(ccds.19)
baysic.dat.ex<-baysic.data(example.dat,ccds.19)
snv.cat.ex<-list()
snv.cat.ex[[1]]<-grep("[^T]C[^G]",colnames(ccds.19)[-c(1:2)])
snv.cat.ex[[2]]<-unique(c(grep("TC.",colnames(ccds.19)[-c(1:2)]),grep(".CG",colnames(ccds.19)[-c(1:2)])))
snv.cat.ex[[3]]<-grep(".T.",colnames(ccds.19)[-c(1:2)])
baysic.fit.ex<-baysic.fit(baysic.dat.ex,snv.cat.ex)

## End(Not run)