callsnvs: Call somatic SNVs by using both global and local error models

Description Usage Arguments Value Examples

View source: R/callsnvs.R

Description

Call somatic SNVs by using both global and local error models

Usage

1
2
3
4
5
6
7
8
callsnvs(sample.info.file, outdir, targetbed,
  pbem_dir = file.path(outdir, "BaseErrorModel"),
  controls_dir = file.path(outdir, "Controls"), pacbamfolder_bychrom,
  detection.specificity = 0.995, replicas = 1000,
  replicas.in.parallel = 1, coeffvar.threshold = 0.01,
  AFbycov = TRUE, mincov = 10, mincovgerm = 10, minalt = 1,
  maxafgerm = 0.2, coverage_binning = 50,
  outdir.calls.name = "Results", chrom.in.parallel = 1)

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.

outdir

The folder where outputs will be saved.

targetbed

Genomic regions in the BED tab-delimited format.

pbem_dir

The folder with outputs generated by the compute_pbem function. default: file.path(outdir, "BaseErrorModel")

controls_dir

The folder with outputs generated by the compute_afthreshold function. default: file.path(outdir, "Controls")

pacbamfolder_bychrom

The folder popluted by outputs by the split_pacbam_bychrom function.

detection.specificity

The quantile of the GSE distribution(s) to use to compute the AF threhold. default: 0.995

replicas

Replics sampling to define stability of AF threhold in bins of coverage. default: 1000

replicas.in.parallel

default: 1

coeffvar.threshold

Consider a bin as stable if the coefficient of variations after replicas is lower than the coeffvar.threshold. default: 0.01

AFbycov

Apply coverage-based AF threhold. default: TRUE

mincov

Minimum locus coverage in CASE sample. default: 10

mincovgerm

Minimum locus coverage in CONTROL sample. default: 10

minalt

Minimum number of reads supporting the alternative allele in CASE sample. default: 1

maxafgerm

Maximum allelic fraction observed in matched CONTROL locus. default: 0.2

coverage_binning

Bins of coverage into which divide AFs. default: 50

outdir.calls.name

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

chrom.in.parallel

Number of chromosomes to run in parallel. default: 1

Value

The callsnvs will create a subfolder for each CASE sample within the outdir.calls.name folder. There tab-delimeted files reporting SNV calls passing 3 consecutive filtering steps (pmtab_F1, pmtab_F2 and pmtab_F3) are saved.

The function also return the data.frame tabsnvs_index reeporting for each sample the path to each of the tables generated during the 3 filtering steps.

Examples

1
2
3
4
5
6
7
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")
callsnvs(sample.info.file,outdir,targetbed,pbem_dir,controls_dir,pacbamfolder_bychrom,replicas=1)

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