cluster_per_LG: Cluster 1.0 markers into correct homologues per linkage group

View source: R/exported_functions.R

cluster_per_LGR Documentation

Cluster 1.0 markers into correct homologues per linkage group

Description

Clustering at one LOD score for all markers does usually not result in correct classification of homologues. Usually there are more clusters of (pseudo)homologues than expected. This function lets you inspect every linkage group separately and allows for clustering at a different LOD threshold per LG.

Usage

cluster_per_LG(
  LG,
  linkage_df,
  LG_hom_stack,
  LOD_sequence,
  modify_LG_hom_stack = FALSE,
  nclust_out = NULL,
  network.layout = c("circular", "stacked", "n"),
  device = NULL,
  label.offset = 1,
  cex.lab = 0.7,
  log = NULL,
  ...
)

Arguments

LG

Integer. Linkage group to investigate.

linkage_df

A data.frame as output of linkage with arguments markertype1 = c(1,0) and markertype2=NULL.

LG_hom_stack

A data.frame with columns "SxN_Marker" providing 1.0 markernames and "LG" and "homologue" providing linkage group and homologue respectively.

LOD_sequence

A numeric or vector of numerics giving LOD threshold(s) at which clustering should be performed.

modify_LG_hom_stack

Logical. Should LG_hom_stack be modified and returned?

nclust_out

Number of clusters in the output. If there are more clusters than this number only the nclust_out largest clusters are returned.

network.layout

Network layout: "circular" or "stacked". If "n" no network is plotted.

device

Function of the graphics device to plot to (e.g. pdf, png, jpeg). The active device is used when NULL

label.offset

Offset of labels. Only used if network.layout="circular".

cex.lab

label character expansion. Only for network.layout="circular".

log

Character string specifying the log filename to which standard output should be written. If NULL log is send to stdout.

...

Arguments passed to device.

Value

A modified LG_hom_stack data.frame if modify_LG_hom_stack = TRUE

Examples

data("SN_SN_P2", "LGHomDf_P2_1")
#take only markers in coupling:
SN_SN_P2_coupl <- SN_SN_P2[SN_SN_P2$phase=="coupling",]
cluster_per_LG(LG = 2,
               linkage_df=SN_SN_P2_coupl,
               LG_hom_stack=LGHomDf_P2_1,
               LOD_sequence=seq(4,10,2),
               modify_LG_hom_stack=FALSE,
               nclust_out=4,
               network.layout="circular",
               device=NULL,
               label.offset=1.2,
               cex.lab=0.75)

polymapR documentation built on Nov. 5, 2023, 1:09 a.m.