Accurate detection of recombination events is essential for linkage
analysis, haplotype inference, and investigating disease associations
with de novo recombination. While population-based phasing methods such
as SHAPEIT and Beagle achieve high accuracy over short
distances, switch error rates (arising from genotyping error and small
gene conversions that are not associated with the long range
recombination of large chromosomal regions) accumulate over long genetic
distances, limiting their utility for chromosome-scale recombination
inference. The inferRecom package builds on work by Chowdhury et al. (2009), who used analytic
recombination detection to characterize recombination phenotypes and
identify associated loci. This package detects recombination
analytically in families with two parents and two or more children,
applies a genetic distance and/or SNP-based filter to remove artifacts
inconsistent with homologous recombination due to interference,
implements chromosome-scale phasing at informative markers, and
integrates with genomic visualization tools such as the UCSC Genome
Browser and with the wider Bioconductor ecosystem. For two child
families, the location of the recombination is identified, while in
those with ≥3 children, the individual carrying the recombination is
additionally inferred. The package has utility in nuclear family
genome-wide analyses for a wide variety of applications including human
disease, animal and plant studies and evolutionary research.
inferRecom enables rapid, accurate detection of meiotic
recombination in nuclear families. The following vignette detects
recombination in a simulated set of pedigrees of varying sizes,
generated using the sim1000G package (Dimitromanolakis et al. 2019) from HapMap CEU
genotypes (International HapMap 3 Consortium
2010) and formatted in PLINK binary format, which
inferRecom reads with snpStats (Clayton 2026). These data are for demonstration
only: recombination was simulated at a much higher rate than occurs in
reality, so that the short example region contains many crossovers. The
scripts that produced the example data are in the package’s
scripts directory,
system.file("scripts", package = "inferRecom"). The
sex-specific recombination rate maps in Europeans used in this example
were generated by Bhérer et al. (2017) and
are available on GitHub.
This vignette also showcases several auxiliary functions that facilitate visualization, analysis of regions of homozygosity, and chromosome-scale phasing of informative markers.
The first section demonstrates the core function
xoDetect(), which localizes and individualizes
recombination in families with both parents and three or more children,
and localizes recombination in families with both parents and exactly
two children. It filters artifacts arising from genotyping error and
other experimental error using the default SNP-based criterion of five
consecutive informative SNPs to confirm a recombination event
(snpFilter), as well as a map-based criterion of one
centiMorgan to confirm a recombination event
(cmFilter).
# Detect recombinations in families with two parents and three or more children
# and families with two parents and exactly two children
# Filter for recombination with SNP-based and cM-based filters at default values
# Option to select for only SNPs that have an rs number is disabled by default
exampleDir <- system.file("extdata", package = "inferRecom")
simCEU <- file.path(exampleDir, "simCEU")
mapFemale <- file.path(exampleDir, "female_chr4.txt")
mapMale <- file.path(exampleDir, "male_chr4.txt")
pat3 <- xoDetect(simCEU, mapMale,
familySize = 3, parent = "father", caseControl = FALSE
)
mat3 <- xoDetect(simCEU, mapFemale,
familySize = 3, parent = "mother", caseControl = FALSE
)
pat2 <- xoDetect(simCEU, mapMale, familySize = 2, parent = "father")
mat2 <- xoDetect(simCEU, mapFemale, familySize = 2, parent = "mother")
pat3
#> GRanges object with 3 ranges and 6 metadata columns:
#> seqnames ranges strand | childId familyId startSnp
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] chr4 78432058-78432285 * | F6C2 F6 rs10026702
#> [2] chr4 78393878-78424195 * | F8C3 F8 rs4450960
#> [3] chr4 78084453-78100731 * | F8C5 F8 rs17327923
#> finishSnp startCm finishCm
#> <character> <numeric> <numeric>
#> [1] rs10026918 57.3462 57.3462
#> [2] rs17400095 57.3424 57.3462
#> [3] rs2645687 57.3172 57.3178
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengthsThe output of the functions is a GRanges object (Lawrence et al. 2013) showing the
individual/family IDs, SNP IDs, locations, and recombination rate map
centiMorgan distances for each recombination. Given that families with
two children do not have sufficient information to infer the recombinant
child, the childId column is omitted in the output. If
caseControl = TRUE, a GRangesList separated by
case/control status is returned. The results with the default filtering
parameters are shown below.
Filtering for closely-spaced events can remove genotyping error and
other artefacts in the data that are not consistent with true homologous
recombination. The default value for the SNP filter
(snpFilter) is 5, and for the genetic-distance filter
(cmFilter) is 1 cM. Setting cmFilter = 0
removes the genetic distance condition altogether. For comparison, the
output below shows paternal recombinations in families with three or
more children without the genetic distance filter.
pat3_0cM <- xoDetect(simCEU,
mapMale,
familySize = 3,
parent = "father",
caseControl = FALSE,
cmFilter = 0
)
pat3_0cM
#> GRanges object with 5 ranges and 6 metadata columns:
#> seqnames ranges strand | childId familyId startSnp
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] chr4 78059331-78077129 * | F6C1 F6 rs12502028
#> [2] chr4 78828799-78833246 * | F6C1 F6 rs10518181
#> [3] chr4 78432058-78432285 * | F6C2 F6 rs10026702
#> [4] chr4 78393878-78424195 * | F8C3 F8 rs4450960
#> [5] chr4 78084453-78100731 * | F8C5 F8 rs17327923
#> finishSnp startCm finishCm
#> <character> <numeric> <numeric>
#> [1] rs1874564 57.2841 57.3170
#> [2] rs6836305 57.6484 57.6484
#> [3] rs10026918 57.3462 57.3462
#> [4] rs17400095 57.3424 57.3462
#> [5] rs2645687 57.3172 57.3178
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengthsRemoving the genetic distance filter results in the detection of two recombination intervals in child 1 in pedigree 6 that are separated by only 0.33cM (~750kb), which is unlikely to represent a true meiotic recombination due to interference in crossing over.
xoDetect() output with
trackViewer and rtracklayerIt is straightforward to visualize recombination intervals using the
Bioconductor packages trackViewer (Ou and Zhu 2019) and rtracklayer
(Lawrence et al. 2009). Here, case and
control intervals are plotted for basic comparison using
trackViewer.
mat3CC <- xoDetect(simCEU,
mapFemale,
familySize = 3,
parent = "mother",
caseControl = TRUE
)
# Add feature column for compatibility with "gene" type in trackViewer
mat3CC$case$feature <- "interval"
mat3CC$control$feature <- "interval"
caseTrack <- new(
"track",
dat = mat3CC$case,
type = "gene",
format = "BED"
)
setTrackStyleParam(caseTrack, "color", "black")
controlTrack <- new(
"track",
dat = mat3CC$control,
type = "gene",
format = "BED"
)
setTrackStyleParam(controlTrack, "color", "blue")
tl <- trackList(caseTrack, controlTrack)
viewRegion <- GRanges("chr4", IRanges(78000000, 79500000))
viewTracks(tl, gr = viewRegion, autoOptimizeStyle = TRUE)While trackViewer provides convenient functionality for
visualization entirely in an R environment, some intervals are not
visible at this resolution. This and many other applications benefit
from more interactive visualization directly in the UCSC Genome Browser.
Example tracks as exported in the code below are shown in the browser
alongside recombination maps and nearby genes.
export(mat3CC$case, "~/path/to/caseOutput.bed", format = "BED")
export(mat3CC$control, "~/path/to/controlOutput.bed", format = "BED")One of the factors that affects the density of informative SNPs and
therefore the resolution of recombination intervals is the degree of
homozygosity in the sample. The function hzRun() is a tool
to detect runs of homozygosity of a user-specified minimum length in Mb
(minMb, default 1 Mb). To account for variation in SNP
density, it also includes a criterion for the minimum number of SNPs per
run (minSnps), with a default value of 5. Users can also
provide a genetic map (mapFile) and specify a minimum
centiMorgan length for runs (minCm). This example applies a
sex-averaged map to all samples.
As the output is a GRanges or GRangesList
object, as in xoDetect(), the procedure to produce genome
browser visualizations is identical to that of the recombination
visualizations corresponding to xoDetect().
sexavg_chr4 <- file.path(exampleDir, "sexavg_chr4.txt")
hzRun(simCEU, sexavg_chr4)
#> GRanges object with 1 range and 6 metadata columns:
#> seqnames ranges strand | sampleId startSnp finishSnp
#> <Rle> <IRanges> <Rle> | <character> <character> <character>
#> [1] chr4 78002267-79180440 * | F4C3 rs17261150 rs7340831
#> numSnps startCm finishCm
#> <integer> <numeric> <numeric>
#> [1] 1028 82.7108 83.7803
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengthsInferring recombination implies identity by descent in between the
informative SNPs, allowing for the phasing of this subset of SNPs in the
pedigrees with three or more offspring. Many population-based phasing
programs are highly accurate over short distances, but phase accuracy
deteriorates rapidly at distances greater than a few centiMorgans. The
function xoPhase() implements a novel phasing algorithm to
produce long-range haplotype phase information at informative SNPs.
Using the information in the nuclear family structures, it is possible
to obtain chromosome-scale haplotypes at the informative subset of SNPs.
In these data, between 14% and 36% of SNPs are informative, depending on
the family.
The function xoPhase() uses the sets of maternal and
paternal recombinations to infer haplotype phase at all informative SNPs
for all members of each the nuclear families with three or more
children.
SNPs that are not informative are still phased where the genotypes
and surrounding haplotypes allow. Where both parents are homozygous,
each child’s alleles follow directly. At a SNP where one or both parents
are heterozygous, the child’s inheritance is inferred from the nearest
flanking phased SNPs, which are identical by descent unless there is a
recombination between them.
In these simulated data, 100% of SNPs can be phased. In real data,
coverage will depend on missing data and inconsistent genotypes. There
is an option to specify a subset of family IDs for phasing
(famIds).
The output is a VCF object from
VariantAnnotation (Obenchain et al.
2014), with one column per family member and phased genotypes in
the GT field. For each child the first allele is the
paternal and the second the maternal allele; for each parent the two
alleles are the parent’s two phased haplotypes. Family and parent IDs
are stored in colData().
phased <- xoPhase(simCEU, pat3, mat3)
phased
#> class: CollapsedVCF
#> dim: 1162 28
#> rowRanges(vcf):
#> GRanges with 4 metadata columns: REF, ALT, QUAL, FILTER
#> info(vcf):
#> DataFrame with 0 columns:
#> geno(vcf):
#> List of length 1: GT
#> geno(header(vcf)):
#> Number Type Description
#> GT 1 String Phased genotype
f6 <- colData(phased)$familyId == "F6"
geno(phased)$GT[1158:1162, f6]
#> F6P1 F6P2 F6C1 F6C2 F6C3
#> rs17002978 "0|0" "0|0" "0|0" "0|0" "0|0"
#> rs10032397 "0|0" "0|0" "0|0" "0|0" "0|0"
#> rs17420118 "0|0" "0|0" "0|0" "0|0" "0|0"
#> rs6838661 "0|1" "0|0" "0|0" "0|0" "1|0"
#> rs17002988 "0|0" "0|0" "0|0" "0|0" "0|0"The phased genotypes can be written to a VCF file with
writeVcf().
The session information records the versions of all packages used in this vignette.
sessionInfo()
#> R version 4.6.2 (2026-10-29)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04.1 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] grid stats4 stats graphics grDevices utils datasets
#> [8] methods base
#>
#> other attached packages:
#> [1] trackViewer_1.49.5 rtracklayer_1.73.0
#> [3] inferRecom_0.99.5 VariantAnnotation_1.59.4
#> [5] Rsamtools_2.29.0 Biostrings_2.81.9
#> [7] XVector_0.53.0 SummarizedExperiment_1.43.0
#> [9] Biobase_2.73.2 GenomicRanges_1.65.4
#> [11] IRanges_2.47.5 S4Vectors_0.51.10
#> [13] Seqinfo_1.3.2 MatrixGenerics_1.25.0
#> [15] matrixStats_1.5.0 BiocGenerics_0.59.13
#> [17] generics_0.1.4 BiocStyle_2.41.0
#>
#> loaded via a namespace (and not attached):
#> [1] DBI_1.3.0 bitops_1.1-0 httr2_1.3.0
#> [4] biomaRt_2.69.6 rlang_1.3.0 magrittr_2.0.5
#> [7] otel_0.3.0 compiler_4.6.2 RSQLite_3.53.3
#> [10] GenomicFeatures_1.65.2 png_0.1-9 vctrs_0.7.3
#> [13] txdbmaker_1.9.2 stringr_1.6.0 pkgconfig_2.0.3
#> [16] crayon_1.5.3 fastmap_1.2.0 dbplyr_2.6.0
#> [19] rmarkdown_2.32 UCSC.utils_1.9.1 strawr_0.0.92
#> [22] bit_4.6.0 xfun_0.62 cachem_1.1.0
#> [25] cigarillo_1.3.1 GenomeInfoDb_1.49.3 jsonlite_2.0.0
#> [28] progress_1.2.3 blob_1.3.0 rhdf5filters_1.25.5
#> [31] DelayedArray_0.39.8 Rhdf5lib_2.1.1 BiocParallel_1.47.0
#> [34] parallel_4.6.2 prettyunits_1.2.0 R6_2.6.1
#> [37] stringi_1.8.9 bslib_0.12.0 RColorBrewer_1.1-3
#> [40] jquerylib_0.1.4 Rcpp_1.1.2 knitr_1.52
#> [43] BiocBaseUtils_1.15.1 Matrix_1.7-6 splines_4.6.2
#> [46] tidyselect_1.2.1 abind_1.4-8 yaml_2.3.12
#> [49] codetools_0.2-20 curl_8.1.0 lattice_0.23-1
#> [52] tibble_3.3.1 InteractionSet_1.41.0 KEGGREST_1.53.6
#> [55] evaluate_1.0.5 survival_3.8-12 BiocFileCache_3.3.3
#> [58] snpStats_1.63.0 pillar_1.11.1 BiocManager_1.30.27
#> [61] filelock_1.0.3 RCurl_1.98-1.20 hms_1.1.4
#> [64] scales_1.4.0 grImport_0.9-7 glue_1.8.1
#> [67] maketools_1.3.2 tools_4.6.2 BiocIO_1.23.3
#> [70] sys_3.4.3 BSgenome_1.81.1 GenomicAlignments_1.49.2
#> [73] buildtools_1.0.0 XML_3.99-0.25 rhdf5_2.57.20
#> [76] AnnotationDbi_1.75.2 restfulr_0.0.17 cli_3.6.6
#> [79] S4Arrays_1.13.3 dplyr_1.2.1 sass_0.5.0
#> [82] digest_0.6.39 SparseArray_1.13.5 rjson_0.2.23
#> [85] htmlwidgets_1.6.4 farver_2.1.2 memoise_2.0.1
#> [88] htmltools_0.5.9 lifecycle_1.0.5 httr_1.4.9
#> [91] bit64_4.8.6