writeGenosFindhap: Write SNP genotypes for findhap

View source: R/findhap.R

writeGenosFindhapR Documentation

Write SNP genotypes for findhap

Description

Write SNP genotypes into a file formatted for findhap.

Usage

writeGenosFindhap(X, genos.file)

Arguments

X

matrix of bi-allelic SNP genotypes encoded in number of copies of the 2nd allele, i.e. as allele doses in 0,1,2, with genotypes in rows and SNPs in columns; missing values should be encoded as NA; the maximum length of genotypes identifiers is 10 characters

genos.file

path to the file in which genotypes will be saved

Value

invisible data frame which is written in genos.file

Author(s)

Timothee Flutre

Examples

## Not run: ## fake genotypes
set.seed(1)
nb.inds <- 3
nb.snps <- 5
X <- matrix(data=sample(c(0,1,2,NA), size=nb.inds * nb.snps, replace=TRUE),
            nrow=nb.inds, ncol=nb.snps,
            dimnames=list(paste0("ind", 1:nb.inds),
                          paste0("snp", 1:nb.snps)))
f <- tempfile()
out <- writeGenosFindhap(X, f)

## End(Not run)

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