read.GENEPOP {FinePop2} | R Documentation |
Create a genotype data object of populations from a GENEPOP format file.
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.
Usage
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
num_pop |
Number of subpopulations. |
pop_sizes |
Number of samples in each subpopulation. |
pop_names |
Names of subpopulations. |
ind_names |
Names of samples in each subpopulation. |
num_loci |
Number of loci. |
loci_names |
Names of loci. |
num_allele |
Number of alleles at each locus. |
allele_list |
A list of alleles at each locus. |
ind_count |
Observed count of genotyped samples in each subpopulation at each locus. |
allele_count |
Observed count of genotyped alleles in each subpopulation at each locus. |
allele_freq |
Observed allele frequencies in each subpopulation at each locus. |
genotype |
Genotypes of each sample at each locus in haploid designation. |
call_rate_loci |
Call rate of each locus (rate of genotyped samples at each locus). |
call_rate_ind |
Call rate of each sample (rate of genotyped markers for each sample). |
He |
Expected heterozigosity in each subpopulation. |
Ho |
Observed heterozigosity in each subpopulation. |
Author(s)
Reiichiro Nakamichi
References
Rousset F (2008) Genepop'007: a complete reimplementation of the Genepop software for Windows and Linux. Mol. Ecol. Resources, 8, 103-106.
Examples
# Example of GENEPOP file
data(jsmackerel)
jsm.ms.genepop.file <- tempfile()
jsm.popname.file <- tempfile()
cat(jsmackerel$MS.genepop, file=jsm.ms.genepop.file, sep="\n")
cat(jsmackerel$popname, file=jsm.popname.file, sep=" ")
# Read GENEPOP file with subpopulation names.
# Prepare your GENEPOP file and population name file in the working directory.
# Replace "jsm.ms.genepop.file" and "jsm.popname.file" by your file names.
popdata <- read.GENEPOP(genepop=jsm.ms.genepop.file, popname=jsm.popname.file)
# Read GENEPOP file without subpopulation names.
popdata.noname <- read.GENEPOP(genepop=jsm.ms.genepop.file)