ReadStructureData: Read Structure data

Description Usage Arguments Author(s) References Examples

View source: R/phrapl-utilities.R

Description

This function reads a Structure file for SNPs. It assumes you have states 1 and 2 and that missing data is encoded as -9.

It returns a list with three objects:

$snps the data to pass into ConvertStructureDataToTrees

$sample.names the first column of sample names

$populations the second column in the original data, assumed (but not required) to be population names.

Usage

1

Arguments

file

A file with the structure data

pairs

If 0, take all columns and rows. If 1, assume individuals are repeated on rows and so you should sample one row at random per site. If 2, assume individuals are represented as duplicated columns, so choose samples at random.

Author(s)

Brian O'Meara, Bryan Carstens, Nathan Jackson, Ariadna Morales-Garcia

Maintainer: Brian O'Meara <bomeara@utk.edu>

References

O'Meara, B.C., N. Jackson, A. Morales-Garcia, and B. Carstens (2014) Phrapl in prep.

Examples

1
#snptrees <- ConvertStructureDataToTrees(ReadStructureData(file="mydata")$snps)

bomeara/phrapl documentation built on Feb. 8, 2021, 6:45 p.m.