read.frequency {FinePop}R Documentation

Create an allele (haplotype) frequency data object of populations from a frequency format file.

Description

This function reads a frequency format file (Kitada et al. 2007) and parse it into an R data object. This data object provides a summary of allele (haplotype) frequency in each population and marker status. This data object is used by EBFST function of this package.

Usage

read.frequency(frequency, popname = NULL)

Arguments

frequency

A character value specifying the name of the frequency format 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.

Details

Frequency format file is a plain text file containing allele (haplotype) count data. This format is mainly for a mitochondrial DNA (mtDNA) haplotype frequency data, however nuclear DNA (nDNA) data also is applicable. In the data object created by read.frequency function, "number of samples" means haplotype count. Therefore, it equals the number of individuals in mtDNA data, however it is the twice of the number of individuals in nDNA data. First part of the frequency format file is the number of subpopulations, second part is the number of loci, and latter parts are [population x allele] matrices of the observed allele (haplotype) counts at each locus. Two examples of frequency format files are attached in this package. See jsmackerel.

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 (haplotypes) at each locus.

nalleles

Number of alleles (haplotypes) at each locus.

indtyp

Number of genotyped samples in each subpopulation at each locus.

obs_allele_num

Observed allele (haplotype) counts at each locus in each subpopulation.

allele_freq

Observed allele (haplotype) frequencies at each locus in each subpopulation.

call_rate

Rate of genotyped samples at each locus.

Author(s)

Reiichiro Nakamichi, Hirohisa Kishino, Shuichi Kitada

References

Kitada S, Kitakado T, Kishino H (2007) Empirical Bayes inference of pairwise FST and its distribution in the genome. Genetics, 177, 861-873.

See Also

jsmackerel, EBFST

Examples

# Example of frequency format file
data(jsmackerel)
jsm.mt.freq.file <- tempfile()
jsm.popname.file <- tempfile()
cat(jsmackerel$mtDNA.freq, file=jsm.mt.freq.file, sep="\n")
cat(jsmackerel$popname, file=jsm.popname.file, sep=" ")

# Read frequency format file with subpopulation names
# Prepare your frequency format file and population name file in the working directory
# Replace "jsm.mt.freq.file" and "jsm.popname.file" by your file names.
popdata.mt <- read.frequency(frequency=jsm.mt.freq.file, popname=jsm.popname.file)

# Read frequency file without subpopulation names
popdata.mt.noname <- read.frequency(frequency=jsm.mt.freq.file)

[Package FinePop version 1.5.2 Index]