Learn R Programming

deepSNV (version 1.18.3)

qvals2Vcf: Function to create a VCF object with variant calls from an array of q-values.

Description

This function thresholds the q-values computed by the shearwater algorithm and creates a VCF object as output.

Usage

qvals2Vcf(qvals, counts, regions, samples = 1:nrow(counts), err = NULL, mu = NULL, cutoff = 0.05, mvcf = TRUE)

Arguments

qvals
array of q-values from betabinLRT.
counts
array of counts from loadAllData.
regions
GRanges with the regions corresponding to counts and qvals.
samples
vector of samples names.
cutoff
Cutoff for the q-values below which a variant is considered to be true (default = 0.05)
mvcf
boolean flag, if TRUE compute a large VCF with as many genotype columns as samples. Default TRUE. Otherwise use duplicate rows and only one genotype column. The sample is then provided by the info:PD field. Can be inefficient for large sample sizes.
err
Optional matrix of error rates, otherwise recomputed from counts.
mu
Optional matrix of relative frequencies, otherwise recomputed from counts.

Value

A VCF object