inferCNVBayesNet {infercnv} | R Documentation

## inferCNVBayesNet: Run Bayesian Network Mixture Model To Obtain Posterior Probabilities For HMM Predicted States

### Description

Uses Markov Chain Monte Carlo (MCMC) and Gibbs sampling to estimate the posterior probability of being in one of six Copy Number Variation states (states: 0, 0.5, 1, 1.5, 2, 3) for CNV's identified by inferCNV's HMM. Posterior probabilities are found for the entire CNV cluster and each individual cell line in the CNV.

### Usage

    inferCNVBayesNet(file_dir, infercnv_obj, HMM_states, out_dir,
      model_file = NULL, CORES = 1, postMcmcMethod = NULL,
      plotingProbs = TRUE, quietly = TRUE, diagnostics = FALSE,
      HMM_type = HMM_type, k_obs_groups = k_obs_groups,
      cluster_by_groups = cluster_by_groups)

### Arguments

`file_dir` | Location of the directory of the inferCNV outputs.
`infercnv_obj` | InferCNV object.
`HMM_states` | InferCNV object with HMM states in expression data.
`out_dir` | (string) Path to where the output file should be saved to.
`model_file` | Path to the BUGS Model file.
`CORES` | Option to run parallel by specifying the number of cores to be used. (Default: 1)
`postMcmcMethod` | What actions to take after finishing the MCMC.
`plotingProbs` | Option for adding plots of Cell and CNV probabilities. (Default: TRUE)
`quietly` | Option to print descriptions along each step. (Default: TRUE)
`diagnostics` | Option to plot Diagnostic plots and tables. (Default: FALSE)
`HMM_type` | The type of HMM that was ra, either 'i3' or 'i6'. Determines how many state were predicted by the HMM.
`k_obs_groups` | Number of groups in which to break the observations. (default: 1)
`cluster_by_groups` | If observations are defined according to groups (ie. patients), each group of cells will be clustered separately. (default=FALSE, instead will use k_obs_groups setting)

### Value

Returns a MCMC_inferCNV_obj and posterior probability of being in one of six Copy Number Variation states (states: 0, 0.5, 1, 1.5, 2, 3) for CNV's identified by inferCNV's HMM.

### Examples

    data(data)
    data(annots)
    data(genes)
    data(HMM_states)

    infercnv_obj <- infercnv::CreateInfercnvObject(raw_counts_matrix=data,
                                                   gene_order_file=genes,
                                                   annotations_file=annots,
                                                   ref_group_names=c("normal"))

    out_dir = tempfile()
    infercnv_obj <- infercnv::run(infercnv_obj,
                                  cutoff=1,
                                  out_dir=out_dir,
                                  cluster_by_groups=TRUE,
                                  denoise=TRUE,
                                  HMM=TRUE,
                                  num_threads=2,
                                  no_plot=TRUE)
    mcmc_obj <- infercnv::inferCNVBayesNet( infercnv_obj   = infercnv_obj,
                                  HMM_states         = HMM_states,
                                  file_dir           = out_dir,
                                  postMcmcMethod     = "removeCNV",
                                  out_dir            = out_dir,
                                  quietly            = TRUE,
                                  CORES              = 2,
                                  plotingProbs       = FALSE,
                                  diagnostics        = FALSE,
                                  HMM_type           = 'i6',
                                  k_obs_groups       = 1,
                                  cluster_by_groups  = FALSE)

[Package infercnv version 1.0.4 Index]