Skip to contents

order_and_plot optimizes the marker order in a (trimmed) genotype matrix using recombination frequency (RF) matrices. It performs multiple iterations of marker ordering, selects the best order based on the smallest Sum of Adjusted Recombination Fractions (SARF), and generates visualizations of marker order. The function uses MLEL() and order_markers() from Professor Jeffrey Endelman's MapRtools and streamlines the process. This workflow should be easier on the user when dealing with multiple chromosomes. MapRtools.

Usage

order_and_plot(
  trimmed_geno,
  pop.type = "F2",
  CHR = NULL,
  n.iter = 6,
  prop = NULL
)

Arguments

trimmed_geno

A genotype matrix where:

  • Rows represent markers.

  • Columns represent individuals. It could be the output of trim_LG or any genotype matrix.

pop.type

Character. The population type used for ordering markers. Default is "F2". order_and_plot would work with any of the following "DH","BC","F2","S1","RIL.self","RIL.sib". Based on MapRtools::MLEL()

CHR

Character (optional). The chromosome identifier for labeling plots.

n.iter

Integer. The number of iterations for marker ordering. Default is 6.

prop

Numeric. The proportion of individuals to include in the genotype plot. Must be between 0 and 1. Default is 0.20 (20% of individuals). If all individuals are included the visualization quality drops.

Value

A list containing:

  • "original_geno": The original genotype matrix.

  • "ordered_geno": The optimized genotype matrix with markers reordered.

  • "order_plot": A ggplot2 object displaying the original vs. optimized marker order.

  • "haplotype_plot": A ggplot2 object showing the genotype haplotype plot.

Details

  • Computes an RF matrix using MLEL(), then orders markers iteratively.

  • Runs order_markers() n.iter times and selects the order with the smallest SARF.

  • order_markers() Order markers by solving the traveling salesperson problem.

  • Plots the original vs. optimized marker order.

  • Generates a genotype haplotype plot for a subset of individuals (prop).

  • If CHR is provided, adds a chromosome label to the plots.

Note

This function was refined with assistance from ChatGPT to improve clarity, efficiency, and visualization formatting.