The output of summary with format="tabByCol" is a list of data frames, and so you would need to combine them.
Here's an example, using the hyper data, to create the summary for 1000 synthetic phenotypes:
set.seed(20230207) # to make this reproducible
data(hyper)
hyper <- calc.genoprob(hyper)
n_phe <- 1000
hyper$pheno <- matrix(rnorm(nind(hyper)*n_phe), ncol=n_phe)
colnames(hyper$pheno) <- paste0("phe", 1:n_phe)
out <- scanone(hyper, pheno=1:n_phe, method="hk")
operm <- scanone(hyper, pheno=1, method="hk", n.perm=1000)
out_sum <- summary(out, perms=operm, alpha=0.2, format="tabByCol")
Most of the elements of out_sum have no rows; let's just keep the ones that are not empty
out_sum <- out_sum[ sapply(out_sum, nrow) > 0 ]
length(out_sum) # 219
For each table, let's add a column that gives the phenotype name and then make the third column just "lod".
Let's also put the marker names (row names) into a column.
for(i in seq_along(out_sum)) {
out_sum[[i]] <- cbind(out_sum[[i]],
marker=rownames(out_sum[[i]]),
phenotype=names(out_sum)[i])
}
Now we paste them all together into a single data frame. I don't really understand how this works to be honest.
out_combined <- do.call("rbind", out_sum)
The output is a data frame
head(out_combined)
# chr pos ci.low ci.high lod marker phenotype
# phe1 4 74.3 47.0 74.3 2.455963 D4Mit14 phe1
# phe10.D1Mit132 1 43.7 35.0 64.5 3.393348 D1Mit132 phe10
# phe10.D5Mit99 5 73.2 32.8 82.0 2.392715 D5Mit99 phe10
# phe15 16 0.0 0.0 25.1 2.363224 D16Mit32 phe15
# phe16 7 55.6 13.1 55.6 2.141917 D7Nds4 phe16
# phe17 11 25.1 13.1 80.9 2.166632 D11Mit310 phe17