read_population: Read a raw text file in and translate appropriate columns...

Description Usage Arguments Value Author(s)

View source: R/read_population.R

Description

The function reads in a text file and does the proper translations for genotypes and spatial coordinates.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
read_population(
  path,
  type,
  locus.columns,
  phased = FALSE,
  sep = ",",
  header = TRUE,
  delim = ":",
  ...
)

Arguments

path

The path to the text file

type

An indication of what kind of loci that the data represent. The following kinds are recoginzed (n.b., if you have several types load them separately and merge them).

missing

The default. This will cause read.population() to read each column as a single locus with one allele

aflp

Encoded as 0,1 for absence/presence of bands.

column

Two columns of alleles per locus.

separated

Pre-separated alleles (with ':').

haploid

One column per locus.

snp

Encoded by the number of minor alleles at the locus.

zyme

Alleles like zymes (e.g., 12 for '1' and '2' alleles).

genepop

Import data that is in 'genepop' format.

cdpop

Import genotypes encoded by CDPOP for subsequent analyses.

structure

Import a STRUCTURE data file (2 rows per individual format).

locus.columns

A vector indicating the numerical column number for each data type that will be treated as a locus object.

phased

A flag indicating the the alleles should are of known gametic phase (default=FALSE).

sep

The field separator for each column of the data.

header

A logical flag indicating if there is a header row (a good idea).

delim

The (optional) delimiter for alleles separators (default=":")

...

Optional parameters you can pass to read.csv or read.table.

Value

A data.frame with locus columns pre-formatted.

Author(s)

Rodney J. Dyer rjdyer@vcu.edu


MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.