apply_scaling_factor: Apply the scaling factor R to get the most suitable...

Description Usage Arguments Value Examples

View source: R/apply_scaling_factor.R

Description

Apply the scaling factor R to get the most suitable locus-specific AF threshold.

Usage

1
2
apply_scaling_factor(tabindex, R = 1, use.optimal.R = FALSE,
  target_size = NA)

Arguments

tabindex

The data.frame output from the callsnvs function. (if use.optimal.R = TRUE , tabindex must contain the column "case_mean_coverage"; use get_case_mean_coverage())

R

The scaling factor R to adjust the AF threshold. default = 1 (neutral value, no changes)

use.optimal.R

Automatically use the best scaling factor R given the mean coverage of the CASE sample and size of targeted regions. default: FALSE

target_size

if use.optimal.R = TRUE, target size in Mb of the BED file as provided by the get_target_size fuction.

Value

Given the combination of coverage, allelic fraction and pbem, return the most suitable scaling factor R to adjust the AF threshold.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sample.info.file <- system.file("extdata", "test_sif_toy.tsv", package = "abemus")
outdir <- tempdir()
targetbed <- system.file("extdata", "regions_toy.bed", package = "abemus")
pacbamfolder_bychrom <- system.file("extdata", "pacbam_data_bychrom", package = "abemus")
pbem_dir <- system.file("extdata", "BaseErrorModel", package = "abemus")
controls_dir <- system.file("extdata", "Controls", package = "abemus")
m<-callsnvs(sample.info.file,outdir,targetbed,pbem_dir,controls_dir,pacbamfolder_bychrom,replicas=1)
tabindex <- m$tabsnvs_index
tabindex <- get_case_mean_coverage(tabindex = tabindex,pacbamfolder_bychrom = pacbamfolder_bychrom)
m$tabsnvs_index_scalfact <- apply_scaling_factor(tabindex = tabindex)

abemus documentation built on Dec. 19, 2019, 1:07 a.m.