genos2sparseMatrix: Convert genotypes to haplotypes.

Description Usage Arguments Details Value

View source: R/vcf_functions.R

Description

This function may be used to convert phased genotype data for diplod organisms into a sparse matrix.

Usage

1
genos2sparseMatrix(genotypes)

Arguments

genotypes

A dataframe or matrix of genotypes. The columns of genotypes are assumed to be individuals (i.e. a diploid human) and the rows are assumed to be mutations. See details.

Details

The columns of genotypes are assumed to be individuals (i.e. a diploid human) and the rows are assumed to be mutations. Thus, the (i,j)th entry of genotypes is the genotype of the jth person at the ith SNV site. Please note that genotypes should not contain missing values. Additionally, genotypes may take one of the following three forms:

Value

A sparseMatrix. Note that the rows and columns of the returned matrix have been transposed so that individual haplotypes are rows, and each column represents an SNV.


SimRVSequences documentation built on July 1, 2020, 6:03 p.m.