readQStructure: Convert STRUCTURE run files to qlist.

Description Usage Arguments Details Value Examples

View source: R/read.R

Description

Takes one or more STRUCTURE run files and converts them to a list of dataframes.

Usage

1
readQStructure(files = NULL, indlabfromfile = FALSE, readci = FALSE)

Arguments

files

A character or character vector of one or more STRUCTURE run files. Use choose.files(multi=TRUE) to select interactively.

indlabfromfile

A logical indicating if individual labels must be read from input file and used as row names for resulting dataframe. Spaces in labels may be replaced with _.

readci

A logical indicating if confidence intervals from the structure file (if available) should be read. Set to FALSE by default as it take up excess space.

Details

See the vignette for more details.

Value

A list of lists with dataframes is returned. If individual labels are present in the STRUCTURE file, they are added to the dataframe as row names. Structure metadata including loci, burnin, reps, elpd, mvll, and vll is added as attributes to each dataframe. When readci=TRUE and if CI data is available, it is read in and attached as attribute named ci. List items are named by input filenames.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sfiles <- list.files(path=system.file("files/structure",package="pophelper"),
full.names=TRUE)
# create a qlist of all runs
slist <- readQStructure(sfiles)

# use ind names from file
slist <- readQStructure(sfiles[1],indlabfromfile=TRUE)

# access the first run
slist <- readQStructure(sfiles)[[1]]

# access names of runs
names(slist)

royfrancis/pophelper documentation built on Jan. 1, 2021, 4:58 p.m.