readSnpsVCF: Read raw SNP genotypes from VCF files.

Description Usage Arguments Value

View source: R/vcf.R

Description

This function reads SNP genotype data from one or more VCF files, and returns these as a sequence of raw SNP genotypes - effectively variant base calls - for each sample. If all relevant input VCF files contain genotype quality (GQ) scores for the samples of interest, these are used - along with variant quality scores - to calculate an error probability for each SNP genotype, and the result is returned as an array with two slices - 'geno' and 'prob' - containing raw SNP genotypes and their corresponding error probabilities, respectively. Otherwise, SNP genotypes are returned as an array with one slice, 'geno', which contains raw SNP genotype values. In any case, the rows of each slice contain data for a given sample, while the columns of each slice contain data for a given SNP locus.

Usage

1
2
readSnpsVCF(..., samples = NULL, require.all = FALSE, require.any = FALSE,
  require.polymorphic = FALSE)

Arguments

...

Input VCF file paths.

samples

Vector of samples for which SNP genotypes should be obtained. If not specified, genotypes are returned for all available samples.

require.all

Remove variants that are not completely genotyped with respect to the given samples.

require.any

Remove variants that do not have at least one genotype call among the given samples.

require.polymorphic

Remove variants that do not have at least two different genotype calls among the given samples.

Value

An array object containing raw genotype data, and if available, genotype error probabilities.


gact/shmootl documentation built on Nov. 11, 2021, 6:23 p.m.