genoDoses2bimbam: Convert genotypes

View source: R/GEMMA.R

genoDoses2bimbamR Documentation

Convert genotypes

Description

Convert SNP genotypes to the file formats used by BimBam, as specified in its manual.

Usage

genoDoses2bimbam(X = NULL, tX = NULL, alleles, file = NULL, format = "mean")

Arguments

X

matrix of bi-allelic SNP genotypes encoded in allele doses in 0,1,2, with genotypes in rows and SNPs in columns; for each SNP, the allele which copy number is counted, should correspond to the second column of alleles, whether this column corresponds to minor or major alleles (for GEMMA, it should be the minor allele)

tX

matrix with SNPs in rows and genotypes in columns

alleles

data.frame with SNPs in rows (names as row names) and alleles in columns; the second column should correspond to the allele which number of copies is counted at each SNP in X

file

write the genotype data to this file if not NULL (for instance 'genotypes_bimbam.txt' or 'genotypes_bimbam.txt.gz', but don't use gzfile)

format

BimBam's format in which the data should be saved (mean/basic)

Value

invisible data.frame

Author(s)

Timothee Flutre


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