readgenotypedata: Read a file of genotype data into a data.frame

Description Usage Arguments Value Author(s) See Also Examples

View source: R/related.R

Description

This function will import a genotype file into a proper data frame in R, estimate allele frequencies and store them as an appropriate object for subsequent analyses.

Usage

1
readgenotypedata(genotype.data)

Arguments

genotype.data

The file containing the genotype data to be analyzed. The file will need to be in R's working directory, and have the following characteristics: (1) It should be a text file (not and Excel file); (2) It should be space- or tab-delimited; (3) Missing data must be represented as zeros (0); and (4) There should not be a header row containing column names. Column 1 should contain individual identifiers, columns 2 and 3 should contain alleles 1 and 2 for locus 1, columns 4 & 5 should contain alleles 1 and 2 for locus 2, and so on. Thus, the total number of columns should be 2 x the number of loci + 1.

Value

gdata

The data fram containing the genotype data. The first column is character data, and the remaining columns are all integers.

nloci

An integer containing the number of loci used

nalleles

A series of integers specifying the number of alleles at each locus

ninds

An integer containing the number of individuals in the genotype file

freqs

An object containing the allele frequency data for each locus, which is needed for subsequent analyses

Author(s)

Jack Pew

See Also

coancestry

Examples

1
2

related documentation built on May 2, 2019, 6:49 p.m.