# 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
readQ(sfiles[1],indlabfromfile=T)
# access the first run
readQ(sfiles)[[1]]
# access names of runs
names(slist)
# TESS files
tfiles <- list.files(path=system.file("files/tess",package="pophelper"),full.names=TRUE)
# create a qlist
readQ(tfiles)
# BASIC files
afiles <- list.files(path=system.file("files/admixture",package="pophelper"),full.names=TRUE)
# create a qlist
readQ(afiles)
# CLUMPP files
tabs1 <- system.file("files/STRUCTUREpop_K4-combined.txt",package="pophelper")
tabs2 <- system.file("files/STRUCTUREpop_K4-combined-aligned.txt",package="pophelper")
tabs3 <- system.file("files/STRUCTUREpop_K4-combined-merged.txt",package="pophelper")
# create a qlist
readQ(tabs1)
readQ(tabs2)
readQ(tabs3)
# 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