dirpath <- "https://raw.githubusercontent.com/rqtl/qtl2data/master/DOex"
# \donttest{
# Download SNP info for DOex from web and read as RDS.
tmpfile <- tempfile()
download.file(file.path(dirpath, "c2_snpinfo.rds"), tmpfile, quiet=TRUE)
snpinfo <- readRDS(tmpfile)
unlink(tmpfile)
snpinfo <- dplyr::rename(snpinfo, pos = pos_Mbp)
# Extract strain distribution pattern.
sdp <- snpinfo$sdp
# Find out how many alleles.
nallele <- ceiling(log2(max(sdp)))
out <- sdp_to_pattern(sdp, LETTERS[seq_len(nallele)])
# Show most frequent patterns.
head(rev(sort(c(table(out)))))
# }
Run the code above in your browser using DataLab