calcFreqMissSnpGenosPerSnp: Missing genotypes

View source: R/quantgen.R

calcFreqMissSnpGenosPerSnpR Documentation

Missing genotypes

Description

Calculate the frequency of missing genotypes for each marker.

Usage

calcFreqMissSnpGenosPerSnp(X = NULL, vcf.file = NULL, yieldSize = 10000)

Arguments

X

matrix of marker genotypes, with genotypes in rows and markers in columns; missing values should be encoded as NA; if not NULL, will be used in priority even if vcf.file is not NULL

vcf.file

path to the VCF file (if the bgzip index doesn't exist in the same directory, it will be created); used only if X=NULL

yieldSize

number of records to yield each time the VCF file is read from (see ?TabixFile)

Value

vector

Author(s)

Timothee Flutre

Examples

## Not run: ## simulate fake SNP genotypes
set.seed(1859)
X <- simulGenosDose(nb.genos=200, nb.snps=10^3)

## randomly create missing SNP genotypes
idx <- sample.int(n=length(X), size=10^3)
X[idx] <- NA

miss.snp <- calcFreqMissSnpGenosPerSnp(X=X)
hist(miss.snp, xlab="proportion of missing data at a given SNP,\nmeasured across all individuals", ylab="number of SNPs")

## End(Not run)

timflutre/rutilstimflutre documentation built on Feb. 7, 2024, 8:17 a.m.