compute_pbem: Compute the per-base error measure (pbem) for each targeted...

Description Usage Arguments Value Examples

View source: R/compute_pbem.R

Description

Compute the per-base error measure (pbem) for each targeted locus and save allelic (AF) by bins of coverage.

Usage

1
2
3
4
5
6
compute_pbem(sample.info.file, targetbed, pacbamfolder_bychrom, outdir,
  outdir.bperr.name = "BaseErrorModel", coverage_binning = 50,
  af_max_to_compute_thresholds = 0.2,
  coverage_min_to_compute_thresholds = 10,
  af_max_to_compute_pbem = 0.2, coverage_min_to_compute_pbem = 10,
  n_pos_af_th = 0.2, mc.cores = 1, step = 5000)

Arguments

sample.info.file

The sample info file listing CASE and CONTROL samples. The format is simply 5 columns, tab-delimited, and there is no column header.

targetbed

Genomic regions in the BED tab-delimited format.

pacbamfolder_bychrom

The folder popluted by outputs by the split_pacbam_bychrom function.

outdir

The folder where outputs will be saved.

outdir.bperr.name

The subfolder name that will be created in the outdir. default: "BaseErrorModel"

coverage_binning

Bins of coverage into which divide AFs. default: 50

af_max_to_compute_thresholds

To compute AF thresholds, consider only positions with AF <= af_max_to_compute_thresholds. default 0.2

coverage_min_to_compute_thresholds

To compute AF threshold, consider only positions with coverage >= coverage_min_to_compute_thresholds. default 10

af_max_to_compute_pbem

To compute pbem, consider only positions with AF <= af_max_to_compute_pbem. default: 0.2

coverage_min_to_compute_pbem

To compute pbem, consider only positions with coverage >= coverage_min_to_compute_pbem. default: 10

n_pos_af_th

When compute pbem, count in how many germline samples the position has an AF >= n_pos_af_th. default: 0.2

mc.cores

Number of jobs to run in parallel, it is the mc.core param of the mclapply function. default: 1

step

Number of positions into split the input chromosome file. default: 5000

Value

The compute_pbem will write, in the outdir.bperr.name, tab-delimeted files reporting the per-base error measure of each targeted locus (saved in bperr.tsv), the coverage and the AF of loci with AF > 0 (saved in afgtz.tsv) and the coverage of loci with AF = 0 (saved in afz.tsv).

The function also return objects bgpbem, bperr_summary and mean_pbem reporting overall statistics about the per-base error measure.

Examples

1
2
3
4
5
sample.info.file <- system.file("extdata", "test_sif_toy.tsv", package = "abemus")
targetbed <- system.file("extdata", "regions_toy.bed", package = "abemus")
pacbamfolder_bychrom <- system.file("extdata", "pacbam_data_bychrom", package = "abemus")
outdir <- tempdir()
outpbem <- compute_pbem(sample.info.file,targetbed,pacbamfolder_bychrom,outdir)

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