# NOT RUN {
# STRUCTURE files
sfiles <- list.files(path=system.file("files/structure",package="pophelper"),
full.names=TRUE)
# create a qlist of all runs
slist <- readQ(sfiles)
slist <- readQ(sfiles,filetype="structure")
# use ind names from file
slist <- readQ(sfiles[1],indlabfromfile=TRUE)
# access the first run
slist <- readQ(sfiles)[[1]]
# access names of runs
names(slist)
# get attributes of a run
attributes(slist[[1]])
# get attributes of all runs
lapply(slist,attributes)
# TESS files
tfiles <- list.files(path=system.file("files/tess",package="pophelper"),
full.names=TRUE)
# create a qlist
tlist <- readQ(tfiles)
# BASIC files
afiles <- list.files(path=system.file("files/admixture",package="pophelper"),
full.names=TRUE)
# create a qlist
alist <- readQ(afiles)
# CLUMPP files
cfiles1 <- system.file("files/STRUCTUREpop_K4-combined.txt",
package="pophelper")
cfiles2 <- system.file("files/STRUCTUREpop_K4-combined-aligned.txt",
package="pophelper")
cfiles3 <- system.file("files/STRUCTUREpop_K4-combined-merged.txt",
package="pophelper")
# create a qlist
clist1 <- readQ(cfiles1)
clist2 <- readQ(cfiles2)
clist3 <- readQ(cfiles3)
# manually create qlist
df1 <- data.frame(Cluster1=c(0.2,0.4,0.6,0.2),Cluster2=c(0.8,0.6,0.4,0.8))
df2 <- data.frame(Cluster1=c(0.3,0.1,0.5,0.6),Cluster2=c(0.7,0.9,0.5,0.4))
# one-element qlist
q1 <- list("sample1"=df1)
str(q1)
# two-element qlist
q2 <- list("sample1"=df1,"sample2"=df2)
str(q2)
# }
Run the code above in your browser using DataLab