Package: rehh 3.2.3

Alexander Klassmann

rehh: Searching for Footprints of Selection using 'Extended Haplotype Homozygosity' Based Tests

Population genetic data such as 'Single Nucleotide Polymorphisms' (SNPs) is often used to identify genomic regions that have been under recent natural or artificial selection and might provide clues about the molecular mechanisms of adaptation. One approach, the concept of an 'Extended Haplotype Homozygosity' (EHH), introduced by (Sabeti 2002) <doi:10.1038/nature01140>, has given rise to several statistics designed for whole genome scans. The package provides functions to compute three of these, namely: 'iHS' (Voight 2006) <doi:10.1371/journal.pbio.0040072> for detecting positive or 'Darwinian' selection within a single population as well as 'Rsb' (Tang 2007) <doi:10.1371/journal.pbio.0050171> and 'XP-EHH' (Sabeti 2007) <doi:10.1038/nature06250>, targeted at differential selection between two populations. Various plotting functions are included to facilitate visualization and interpretation of these statistics.

Authors:Alexander Klassmann [aut, cre], Mathieu Gautier [aut], Renaud Vitalis [aut]

rehh_3.2.3.tar.gz
rehh_3.2.3.tar.gz(r-4.7-arm64)rehh_3.2.3.tar.gz(r-4.7-x86_64)rehh_3.2.3.tar.gz(r-4.6-arm64)rehh_3.2.3.tar.gz(r-4.6-x86_64)
rehh_3.2.3.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
rehh/json (API)

# Install 'rehh' in R:
install.packages('rehh', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://gitlab.com/oneoverx/rehh

Uses libs:
  • openmp– GCC OpenMP (GOMP) support library
Datasets:

On CRAN:

Conda:

openmp

6.15 score 8 stars 1 packages 294 scripts 688 downloads 57 mentions 32 exports 1 dependencies

Last updated from:1d1abfea3a. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK181
linux-devel-x86_64OK190
source / vignettesOK226
linux-release-arm64OK183
linux-release-x86_64OK182
wasm-releaseOK543

Exports:as.newickcalc_candidate_regionscalc_ehhcalc_ehhscalc_furcationcalc_haplencalc_pairwise_haplencalc_region_statscalc_sfs_testschr.namedata2haplohhdistribplotextract_regionsfreqbinplotfurcationhap.nameshaplenhaplohaplohh2sweepfinderies2xpehhihh2ihsines2rsbmake.example.filesmanhattanplotmrk.namesnhapnmrkpositionsremove.example.filesscan_hhscan_hh_fullupdate_haplohh

Dependencies:rehh.data

Examples in detail
Overview | Example data set 1 | Input | Data files | Input options | Calculations and visualizations | Visualizing the sequences | EHH | EHHS | "Genome-wide" scan | Furcations and haplotype length | Example data set 2 | References

Last update: 2026-01-30
Started: 2019-07-09

Vignette for package rehh
About the package | Background | Changes between versions 2.X and 3.X | Example files | Input files | R objects | Terminology | Overview | Data input | Haplotype data file | Marker information file | Loading data files: the function data2haplohh | Example 1: reading haplotype file in standard format | Example 2: reading haplotype file in transposed format (SHAPEIT2--like) | Example 3: reading haplotype file in fastPHASE output format | Example 4: reading vcf files | Example 5: reading ms output | Subset data | Computing EHH, EHHS and their "integrals" iHH and iES | Definition and computation | The (allele-specific) Extended Haplotype Homozygosity (EHH) | The integrated EHH (iHH) | The (site-specific) Extended Haplotype Homozygosity (EHHS) | The integrated EHHS (iES) | The function calc_ehh() | The function calc_ehhs() | The function scan_hh() | Computing iHS, Rsb and XP-EHH | The iHS within-population statistic | Definition | The function ihh2ihs() | The Rsb pairwise population statistic | Definition | The function ines2rsb() | The XP-EHH pairwise population statistic | Definition | The function ies2xpehh() | Delineating regions with "outliers": the function calc_candidate_regions() | Visualization of the statistics | Un-standardized iHS: the function freqbinplot() | Rsb vs. XP-EHH comparison | Distribution of standardized values: the function distribplot() | Genome wide score plots: the function manhattanplot() | Genome wide score plots: the function manhattan() of package qqman | Visualization of the haplotype structure | The function plot.haplohh() | The functions calc_furcation() and plot.furcation() | The functions calc_haplen() and plot.haplen() | Data considerations | Multi-allelic markers | Dealing with gaps | Dealing with missing data | Dealing with multiple markers at the same position | Dealing with unphased data | Dealing with unpolarized data | Differences to the program hapbin | About estimating homozygosity | References

Last update: 2026-01-30
Started: 2016-08-01

Readme and manuals

Help Manual

Help pageTopics
rehh: Searching for Footprints of Selection using 'Extended Haplotype Homozygosity' Based Testsrehh-package rehh
An S4 class containing furcation trees for one allele of a focal markerallelefurcation allelefurcation-class
Convert a furcation tree into Newick formatas.newick
Determine candidate regions of selectioncalc_candidate_regions
EHH and iHH computation for a given focal markercalc_ehh ehh ehh-class
EHHS and iES computation for a given focal markercalc_ehhs ehhs ehhs-class
calculate furcation trees around a focal markercalc_furcation
Calculate length of longest shared haplotypes around a focal markercalc_haplen
Calculate pairwise shared haplotype length between all chromosomescalc_pairwise_haplen
Calculate score statistics for given regionscalc_region_stats
Calculate site frequency spectrum test statisticscalc_sfs_tests
Convert data from input file to an object of class haplohhdata2haplohh
Plot distribution of standardized iHS, Rsb or XP-EHH valuesdistribplot
Extract regions from a scanextract_regions
Plot of unstandardized iHS within frequency binsfreqbinplot
An S4 class to represent a furcation tree on one side of one allele of a focal markerftree ftree-class
An S4 class representing the complete furcation pattern around a focal marker.furcation furcation-class
class for haplotype lengthhaplen haplen-class
Example of an 'haplohh' objecthaplohh_cgu_bta12
Class "haplohh"chr.name chr.name, chr.name,haplohh-method hap.names hap.names, hap.names,haplohh-method haplo haplo, haplo,haplohh-method haplohh-class mrk.names mrk.names, mrk.names,haplohh-method nhap nhap, nhap,haplohh-method nmrk nmrk, nmrk,haplohh-method positions positions, positions,haplohh-method
Translate object of 'haplohh-class' into SweepFinder formathaplohh2sweepfinder
Compute XP-EHHies2xpehh
Compute iHSihh2ihs
Compute Rsbines2rsb
Copy example input files into current working directorymake.example.files
Manhattan plot of iHS, XP-EHH or Rsb over a genome.manhattanplot
Plot EHH around a focal markerplot.ehh
Plot EHHS around a focal markerplot.ehhs
Plots furcation trees around a focal markerplot.furcation
Plot the length of extended haplotypes around a focal markerplot.haplen
Plot the variants of a haplohh objectplot.haplohh
Remove example files from current working directory.remove.example.files
Compute iHH, iES and inES over a whole chromosomescan_hh
Compute iHH, iES and inES over a whole chromosome without cut-offsscan_hh_full
Subsets object of 'haplohh-class'subset.haplohh
Update object of class haplohhupdate_haplohh