Skip to contents

trim_LG is an interactive or scripted function that helps the user filter markers within a specified chromosome based on linkage group (LG) assignment using LOD score thresholds. The user can interactively choose LOD thresholds or provide them via arguments, visualize haplotype frequency before and after filtering, and remove outliers.

Usage

trim_LG(
  chromosome,
  map,
  geno,
  pop_type = "F2",
  drop_outliers = TRUE,
  n_cores = NULL,
  interactive = TRUE,
  initial_LOD = NULL,
  end_LOD = NULL,
  step_LOD = NULL,
  selected_thresh = NULL
)

Arguments

chromosome

Character. The chromosome ID to be processed.

map

A data frame with at least columns "marker", "chrom", and "position".

geno

A genotype matrix (rows = markers, columns = individuals). Preferably binned.

pop_type

Character. Population type for LOD estimation. Default is "F2".

drop_outliers

Logical. Whether to remove outliers based on haplotype frequency. Default is TRUE.

n_cores

Integer. Number of cores to use. If NULL, uses maximum available minus one.

interactive

Logical. If TRUE, asks user for LOD thresholds. If FALSE, requires threshold arguments.

initial_LOD

Numeric. Initial LOD value (required if interactive = FALSE).

end_LOD

Numeric. Final LOD value (required if interactive = FALSE).

step_LOD

Numeric. Step size for LOD sequence (required if interactive = FALSE).

selected_thresh

Numeric. Final LOD threshold to use (required if interactive = FALSE).

Value

A list with filtered genotypes, final map, plots, and LOD settings.

Details

Inspired by functions by Professor Jeffrey B. Endelman’s MapRtools.