Learn R Programming

R/qtl2

Karl Broman

R/qtl2 (aka qtl2) is a reimplementation of the QTL analysis software R/qtl, to better handle high-dimensional data and complex cross designs.

Also see the related packages, qtl2convert (for converting data among the R/qtl2, DOQTL, and R/qtl formats), qtl2fst (for storing genotype probabilities on disk), and qtl2ggplot (for ggplot2-based data visualizations).


Installation

Install R/qtl2 from CRAN:

install.packages("qtl2")

Alternatively, install it from R universe:

install.packages("qtl2", repos=c("https://rqtl.r-universe.dev",
                                 "https://cloud.r-project.org"))

Or use remotes to install it from its GitHub source:

install.packages("remotes")
remotes::install_github("rqtl/qtl2")

Documentation


Citation

To cite R/qtl2 in publications, use:

Broman KW, Gatti DM, Simecek P, Furlotte NA, Prins P, Sen Ś, Yandell BS, Churchill GA (2019) R/qtl2: software for mapping quantitative trait loci with high-dimensional data and multi-parent populations. Genetics 211:495-502 doi:10.1534/genetics.118.301595


License

Licensed under GPL-3.

Copy Link

Version

Install

install.packages('qtl2')

Monthly Downloads

851

Version

0.42

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Karl Broman

Last Published

June 9th, 2026

Functions in qtl2 (0.42)

cbind.scan1perm

Combine columns from multiple scan1 permutation results
cbind.viterbi

Join viterbi results for different chromosomes
cbind.sim_geno

Join genotype imputations for different chromosomes
cbind.phasedgeno

Join phased genotype results for different chromosomes
clean

Clean an object
cbind.scan1

Join genome scan results for different phenotypes.
chr_lengths

Calculate chromosome lengths
cbind_expand

Combine matrices by columns, expanding and aligning rows
convert2cross2

Convert R/qtl cross object to new format
clean_scan1

Clean scan1 output
create_gene_query_func

Create a function to query genes
compare_maps

Compare two marker maps
check_cross2

Check a cross2 object
compare_genoprob

Compare two sets of genotype probabilities
clean_genoprob

Clean genotype probabilities
count_xo

Count numbers of crossovers
create_snpinfo

Create snp information table for a cross
compare_geno

Compare individuals' genotype data
compare_founder_geno

Compare founders genotype data
chisq_colpairs

Chi-square test on all pairs of columns
drop_markers

Drop markers from a cross2 object
est_map

Estimate genetic maps
find_index_snp

Find name of indexed snp
drop_nullmarkers

Drop markers with no genotype data
find_ibd_segments

Find IBD segments for a set of strains
est_herit

Estimate heritability with a linear mixed model
find_map_gaps

Find gaps in a genetic map
create_variant_query_func

Create a function to query variants
decomp_kinship

Calculate eigen decomposition of kinship matrix
find_dup_markers

Find markers with identical genotype data
get_common_ids

Get common set of IDs from objects
find_peaks

Find peaks in a set of LOD curves
fread_csv_numer

Read a csv file that has numeric columns
find_marker

Find markers by chromosome position
fread_csv

Read a csv file
fit1

Fit single-QTL model at a single position
genoprob_to_snpprob

Convert genotype probabilities to SNP probabilities
find_markerpos

Find positions of markers
get_x_covar

Get X chromosome covariates
genoprob_to_alleleprob

Convert genotype probabilities to allele probabilities
locate_xo

Locate crossovers
map_to_grid

Subset a map to positions on a grid
interp_map

Interpolate between maps
interp_genoprob

Interpolate genotype probabilities
invert_sdp

Calculate SNP genotype matrix from strain distribution patterns
lod_int

Calculate LOD support intervals
index_snps

Create index of equivalent SNPs
insert_pseudomarkers

Insert pseudomarkers into a marker map
mat2strata

Define strata based on rows of a matrix
guess_phase

Guess phase of imputed genotypes
max_compare_geno

Find pair with most similar genotypes
max_scan1

Find position with maximum LOD score
plot_coef

Plot QTL effects along chromosome
maxmarg

Find genotypes with maximum marginal probabilities
n_missing

Count missing genotypes
plot_colorscale

Heat map color scale
plot_cistrans

cis-trans plot for eQTL results
maxlod

Overall maximum LOD score
plot_ci

Effect plot with multiple CIs for different groups
plot_compare_geno

Plot of compare_geno object.
plot_lodpeaks

Plot LOD scores vs QTL peak locations
plot_scan1_heatmap

Heat map of scan1 results with multiple traits
plot_scan1

Plot a genome scan
plot_geno

Plot multiple individuals' genome-wide genotypes
plot_peaks

Plot QTL peak locations
plot_genes

Plot gene locations for a genomic interval
plot_genoprobcomp

Plot comparison of two sets of genotype probabilities
plot_pxg

Plot phenotype vs genotype
plot_onegeno

Plot one individual's genome-wide genotypes
plot_genoprob

Plot genotype probabilities for one individual on one chromosome.
pull_genoprobint

Pull genotype probabilities for an interval
pull_markers

Drop all but a specified set of markers
print.summary.scan1perm

Print summary of scan1perm permutations
probs_to_grid

Subset genotype probability array to pseudomarkers on a grid
pull_genoprobpos

Pull genotype probabilities for a particular position
plot_snpasso

Plot SNP associations
print.cross2

Print a cross2 object
predict_snpgeno

Predict SNP genotypes
plot_sdp

plot strain distribution patterns for SNPs
align_scan1_map

Internal functions
rbind.viterbi

Join Viterbi results for different individuals
rbind.sim_geno

Join genotype imputations for different individuals
rbind.scan1

Join genome scan results for different chromosomes.
rbind.scan1perm

Combine data from scan1perm objects
read_cross2

Read QTL data from files
read_pheno

Read phenotype data
qtl2-package

qtl2: Quantitative Trait Locus Mapping in Experimental Crosses
rbind.calc_genoprob

Join genotype probabilities for different individuals
rbind.phasedgeno

Join phased geno results for different individuals
qtl2version

Installed version of R/qtl2
recode_snps

Recode SNPs by major allele
scan1coef

Calculate QTL effects in scan along one chromosome
replace_ids

Replace individual IDs
scan1

Genome scan with a single-QTL model
scan1blup

Calculate BLUPs of QTL effects in scan along one chromosome
reduce_map_gaps

Reduce the lengths of gaps in a map
reduce_markers

Reduce markers to a subset of more-evenly-spaced ones
scale_kinship

Scale kinship matrix
scan1max

Maximum LOD score from genome scan with a single-QTL model
scan1perm

Permutation test for genome scan with a single-QTL model
sim_geno

Simulate genotypes given observed marker data
subset.phasedgeno

Subsetting phased genotype objects
subset.sim_geno

Subsetting imputed genotypes
scan1snps

Single-QTL genome scan at imputed SNPs
sdp2char

Convert strain distribution patterns to character strings
subset.viterbi

Subsetting Viterbi results
subset.cross2

Subsetting data for a QTL experiment
subset_scan1

Subset scan1 output
smooth_gmap

Smooth genetic map
subset.calc_genoprob

Subsetting genotype probabilities
unsmooth_gmap

Unsmooth genetic map
summary_scan1perm

Summarize scan1perm results
summary.cross2

Summary of cross2 object
write_control_file

Write a control file for QTL data
summary_compare_geno

Basic summary of compare_geno object
top_snps

Create table of top snp associations
viterbi

Calculate most probable sequence of genotypes
zip_datafiles

Zip a set of data files
xpos_scan1

Get x-axis position for genomic location
calc_geno_freq

Calculate genotype frequencies
batch_vec

Split vector into batches
basic_summaries

Basic summaries of a cross2 object
batch_cols

Batch columns by pattern of missing values
add_threshold

Add thresholds to genome scan plot
bayes_int

Calculate Bayes credible intervals
cbind.calc_genoprob

Join genotype probabilities for different chromosomes
calc_sdp

Calculate strain distribution pattern from SNP genotypes
calc_het

Calculate heterozygosities
calc_hotspots

Calculate QTL hotspots
calc_genoprob

Calculate conditional genotype probabilities
calc_grid

Calculate indicators of which marker/pseudomarker positions are along a fixed grid
calc_errorlod

Calculate genotyping error LOD scores
calc_raw_geno_freq

Calculate genotype frequencies from raw SNP genotypes
calc_raw_founder_maf

Calculate founder minor allele frequencies from raw SNP genotypes
CCcolors

Collaborative Cross colors
calc_entropy

Calculate entropy of genotype probability distribution
calc_raw_het

Calculate estimated heterozygosity from raw SNP genotypes
calc_raw_maf

Calculate minor allele frequency from raw SNP genotypes
calc_kinship

Calculate kinship matrix