read.genepop: Create a genotype data object of populations from a GENEPOP...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function reads a GENEPOP format file (Rousset 2008) and parse it into an R data object. This data object provides a summary of genotype/haplotype of each sample, allele frequency in each population, and marker status. This data object is used in downstream analysis of this package. This function is a "lite" and faster version of readGenepop function in diveRsity package (Keenan 2015).

Usage

1
read.genepop(genepop, popname = NULL)

Arguments

genepop

A character value specifying the name of the GENEPOP file to be analyzed.

popname

A character value specifying the name of the plain text file containing the names of subpopulations to be analyzed. This text file must not contain other than subpopulation names. The names must be separated by spaces, tabs or line breaks. If this argument is omitted, serial numbers will be assigned as subpopulation names.

Value

npops

Number of subpopulations.

pop_sizes

Number of samples in each subpopulation.

pop_names

Names of subpopulations.

nloci

Number of loci.

loci_names

Names of loci.

all_alleles

A list of alleles at each locus.

nalleles

Number of alleles at each locus.

indtyp

Number of genotyped samples in each subpopulation at each locus.

ind_names

Names of samples in each subpopulation.

pop_alleles

Genotypes of each sample at each locus in haploid designation.

pop_list

Genotypes of each sample at each locus in diploid designation.

obs_allele_num

Observed allele counts at each locus in each subpopulation.

allele_freq

Observed allele frequencies at each locus in each subpopulation.

call_rate

Rate of genotyped samples at each locus.

Author(s)

Reiichiro Nakamichi

References

Keenan K (2015) diveRsity: A Comprehensive, General Purpose Population Genetics Analysis Package. R package version 1.9.89. https://CRAN.R-project.org/package=diveRsity

Rousset F (2008) Genepop'007: a complete reimplementation of the Genepop software for Windows and Linux. Mol. Ecol. Resources, 8, 103-106.

See Also

readGenepop

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Example of GENEPOP file
data(jsmackerel)
cat(jsmackerel$MS.genepop, file="JSM_MS_genepop.txt", sep="\n")
cat(jsmackerel$popname, file="JSM_popname.txt", sep=" ")

# Read GENEPOP file with subpopulation names
# Prepare your GENEPOP file and population name file in the working directory
# (Here, these files were provided as "JSM_MS_genepop.txt" and "JSM_popname.txt".)
popdata <- read.genepop(genepop="JSM_MS_genepop.txt", popname="JSM_popname.txt")

# Read GENEPOP file without subpopulation names
popdata.noname <- read.genepop(genepop="JSM_MS_genepop.txt")

Example output



FinePop documentation built on May 2, 2019, 3:30 p.m.