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

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.

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.

Details

See the vignette for more details.

Examples

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)
#> [1] "Cluster1" "Cluster2"