View source: R/calc_hotspots.R
| calc_hotspots | R Documentation |
For a set of QTL locations, calculate a running count in a sliding window across the genome.
calc_hotspots(peaks, map, window = 1, cores = 1, quiet = TRUE)
peaks |
Data frame of QTL results, as output by |
map |
Marker map, as a list of chromosomes, each being a vector of positions. Hotspot counts will be calculated at these positions. |
window |
Window size for counting QTL. |
cores |
Number of CPU cores to use, for parallel calculations.
(If |
quiet |
If TRUE, don't print any messages. |
An object of class "scan1": a matrix with a single
column, of counts, with rownames being the marker names in
map. The column name is "num_qtl".
find_peaks(), plot_lodpeaks(), plot_cistrans()
## Not run:
# download example pQTL results (from Keele et al. 2026, https://doi.org/10.1016/j.xgen.2025.101069)
# contains qtl, map_endpoints, and pheno_pos
url <- "https://kbroman.org/qtl2/assets/sampledata/pqtl_data.RData"
tempfile <- file.path(tempdir(), basename(url))
download.file(url, tempfile)
load(tempfile)
unlink(tempfile)
hotspots <- calc_hotspots(qtl, map, window=2)
plot(hotspots, map, ylab="No. QTL")
find_peaks(hotspots, map, threshold=20)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.