Takes a qlist of one of more numeric dataframes and creates a table with filenames, K and number of individuals.
tabulateQ(qlist, sorttable = TRUE, writetable = FALSE, exportpath = NULL)
qlist | A qlist (list of dataframes). An output from |
---|---|
sorttable | A logical indicating if output table is to be sorted. Sorts table by ind and K. |
writetable | A logical indicating if the output table must be exported as a tab-delimited text file in the working directory. |
exportpath | A path to where content must be exported. For example,
|
Returns a dataframe with filenames (if list is not named, then
sample1, sample2 etc. is used), K and number of individuals of all runs
sorted by ind and K (if sorttable=TRUE
). The row numbers of the output
table denotes the file number selected. This is helpful if a particular file
from the table needs to be identified in the selection vector. If input files
come from STRUCTURE runs, columns loci, burnin, reps, elpd, mvll and vll are
also returned. In input files come from TESS3, columns loci, gif, rmse,
crossentropy and ploidy are included as well.
The input must be a list of dataframes. If one dataframe is used, then it must be inside a list. If the list items are named, then the item name is used as filename, else sample1, sample2 etc. is used.
See the vignette for more details.
# STRUCTURE files sfiles <- list.files(path=system.file("files/structure",package="pophelper"), full.names=TRUE) slist <- readQ(sfiles) tabulateQ(qlist=slist)#> file k ind loci burnin reps elpd mvll vll #> 1 structure_01 2 149 25 1e+05 1e+06 -7509.5 -7387.2 244.6 #> 2 structure_02 2 149 25 1e+05 1e+06 -7508.5 -7387.2 242.6 #> 9 structure_09 2 149 25 1e+05 1e+06 -7510.1 -7387.4 245.3 #> 3 structure_03 3 149 25 1e+05 1e+06 -7475.8 -7268.8 414.1 #> 4 structure_04 3 149 25 1e+05 1e+06 -7475.7 -7268.9 413.6 #> 10 structure_10 3 149 25 1e+05 1e+06 -7476.5 -7268.7 415.4 #> 5 structure_05 4 149 25 1e+05 1e+06 -7687.5 -7260.2 854.7 #> 11 structure_11 4 149 25 1e+05 1e+06 -7599.0 -7264.7 668.7 #> 15 structure_15 4 149 25 1e+05 1e+06 -7665.9 -7258.4 815.1 #> 6 structure_06 5 149 25 1e+05 1e+06 -7692.4 -7210.5 963.9 #> 12 structure_12 5 149 25 1e+05 1e+06 -7828.5 -7205.4 1246.2 #> 16 structure_16 5 149 25 1e+05 1e+06 -7709.8 -7208.7 1002.3 #> 7 structure_07 6 149 25 1e+05 1e+06 -7970.6 -7160.4 1620.5 #> 13 structure_13 6 149 25 1e+05 1e+06 -8023.3 -7158.0 1730.6 #> 17 structure_17 6 149 25 1e+05 1e+06 -7963.6 -7164.9 1597.3 #> 8 structure_08 7 149 25 1e+05 1e+06 -8656.8 -7144.2 3025.1 #> 14 structure_14 7 149 25 1e+05 1e+06 -8571.2 -7137.5 2867.4# TESS files tfiles <- list.files(path=system.file("files/tess",package="pophelper"), full.names=TRUE) tlist <- readQ(tfiles) tabulateQ(qlist=tlist)#> file k ind #> 1 tess_01 2 75 #> 8 tess_08 2 75 #> 15 tess_15 2 75 #> 2 tess_02 3 75 #> 9 tess_09 3 75 #> 16 tess_16 3 75 #> 3 tess_03 4 75 #> 10 tess_10 4 75 #> 17 tess_17 4 75 #> 4 tess_04 5 75 #> 11 tess_11 5 75 #> 18 tess_18 5 75 #> 5 tess_05 6 75 #> 12 tess_12 6 75 #> 19 tess_19 6 75 #> 6 tess_06 7 75 #> 13 tess_13 7 75 #> 20 tess_20 7 75 #> 7 tess_07 8 75 #> 14 tess_14 8 75 #> 21 tess_21 8 75# ADMIXTURE files afiles <- list.files(path=system.file("files/admixture",package="pophelper"), full.names=TRUE) alist <- readQ(afiles) tabulateQ(qlist=alist)#> file k ind #> 1 admixture_01 2 1592 #> 2 admixture_02 2 1592 #> 3 admixture_03 2 1592 #> 4 admixture_04 2 1592 #> 5 admixture_05 2 1592 #> 6 admixture_06 2 1592 #> 7 admixture_07 2 1592 #> 8 admixture_08 2 1592 #> 9 admixture_09 2 1592 #> 10 admixture_10 2 1592