genoClasses2genoDoses: Convert genotypes

View source: R/quantgen.R

genoClasses2genoDosesR Documentation

Convert genotypes

Description

Convert SNP genotypes from "genotypic classes" into "allele doses" by counting the number of minor alleles. The code is not particularly efficient, but at least it exists.

Usage

genoClasses2genoDoses(
  x,
  na.string = "--",
  snpIDs1stCol = TRUE,
  errorIfNotBi = TRUE,
  verbose = 1
)

Arguments

x

matrix or data.frame with bi-allelic SNPs in rows and genotypes in columns

na.string

a character to be interpreted as NA values

snpIDs1stCol

indicates if the SNP identifiers are in the first column; otherwise they should be in the row names

errorIfNotBi

raises an error if a SNP is not bi-allelic; otherwise, raises a warning and set the SNP genotypes to missing

verbose

verbosity level (0/1)

Value

list of a matrix of allele doses with SNPs in columns and genotypes in rows, and a matrix with major and minor alleles

Author(s)

Timothee Flutre


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