gl.smearplot: Smear plot

View source: R/gl.smearplot.r

gl.smearplotR Documentation

Smear plot

Description

Each locus is color coded for scores of 0, 1, 2 and NA for SNP data and 0, 1 and NA for presence/absence (SilicoDArT) data. Individual labels can be added. The plot may become cluttered if there are too many individuals; if so, it is best to use ind.labels = FALSE.

Works with both SNP data and P/A data (SilicoDArT). Missing data are shown in the NA color (the fourth plot color) and labelled NA in the legend.

Usage

gl.smearplot(
  x,
  plot.display = TRUE,
  ind.labels = FALSE,
  label.size = 10,
  group.pop = FALSE,
  plot.theme = NULL,
  plot.colors = NULL,
  loc.names = FALSE,
  loc.order = FALSE,
  interactive = FALSE,
  den = FALSE,
  plot.file = NULL,
  plot.dir = NULL,
  het.only = FALSE,
  legend = "bottom",
  verbose = NULL
)

Arguments

x

Name of the genlight object [required].

plot.display

If TRUE, the plot is displayed in the plot window [default TRUE].

ind.labels

If TRUE, individual IDs are shown [default FALSE].

label.size

Size of the individual labels [default 10].

group.pop

If ind.labels is TRUE, group by population [default FALSE].

plot.theme

Theme for the plot. See Details for options [default NULL].

plot.colors

List of four color names for the column fill for homozygous reference, heterozygous, homozygous alternate, and missing value (NA) [default c("#0000FF","#00FFFF","#FF0000","#e0e0e0")].

loc.names

If TRUE, loci names are shown on the horiontal axis [default FALSE].

loc.order

If TRUE, loci are ordered by chromosome and by SNP position [default FALSE].

interactive

If TRUE, an interactive version is generated [default FALSE].

den

If TRUE, a dendrogram is generated and used to order individuals [default FALSE].

plot.file

Name for the RDS binary file to save (base name only, exclude extension) [default NULL].

plot.dir

Directory to save the plot RDS files [default as specified by the global working directory or tempdir()].

het.only

If TRUE, show only the heterozygous state (SNP data only) [default FALSE].

legend

Position of the legend: 'left', 'top', 'right', 'bottom' or 'none' [default 'bottom'].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity].

Value

Returns the ggplot object

Author(s)

Author(s): Arthur Georges. Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr

See Also

Other graphics: gl.colors(), gl.map.interactive(), gl.plot.heatmap(), gl.plot.snp.density(), gl.select.colors(), gl.select.shapes(), gl.tree.nj()

Examples

if (isTRUE(getOption("dartR_fbm"))) testset.gl <- gl.gen2fbm(testset.gl)
gl.smearplot(testset.gl,ind.labels=FALSE)
gl.smearplot(testset.gs,ind.labels=FALSE)
gl.smearplot(testset.gl[1:10,],ind.labels=TRUE)
gl.smearplot(testset.gs[1:10,],ind.labels=TRUE)

dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.