Learn R Programming

rehh (version 3.2.2)

calc_region_stats: Calculate score statistics for given regions

Description

Calculate score statistics (extremal values) for given regions. This function is intended for the comparison of different scores for the same chromosomal regions.

Usage

calc_region_stats(
  scan,
  regions,
  threshold = NA,
  pval = FALSE,
  ignore_sign = FALSE,
  right = TRUE
)

Arguments

scan

a data frame containing scores (output of ihh2ihs, ines2rsb or ies2xpehh).

regions

a data frame with column names CHR, START and END, specifying chromosomal regions (e.g. as obtained by function calc_candidate_regions).

threshold

boundary score above which markers are defined as "extreme".

pval

logical. If TRUE use the (negative log-) p-value instead of the score.

ignore_sign

logical. If TRUE (default), take absolute values of score.

right

logical, indicating if the regions should be closed on the right (and open on the left) or vice versa.

Value

A data frame with chromosomal regions. For each region the overall number of markers, their mean and maximum, the number of markers with extremal values, their percentage of all markers and their average are reported.

See Also

calc_candidate_regions