gl.report.locmetric: Reports summary of the slot $other$loc.metrics

View source: R/gl.report.locmetric.r

gl.report.locmetricR Documentation

Reports summary of the slot $other$loc.metrics

Description

This script uses any field with numeric values stored in $other$loc.metrics to produce summary statistics (mean, minimum, average, quantiles), histograms and boxplots to assist the decision of choosing thresholds for the filter function gl.filter.locmetric.

Usage

gl.report.locmetric(
  x,
  metric,
  plot.out = TRUE,
  plot_theme = theme_dartR(),
  plot_colors = two_colors,
  save2tmp = FALSE,
  verbose = NULL
)

Arguments

x

Name of the genlight object containing the SNP or presence/absence (SilicoDArT) data [required].

metric

Name of the metric to be used for filtering [required].

plot.out

Specify if plot is to be produced [default TRUE].

plot_theme

Theme for the plot. See Details for options [default theme_dartR()].

plot_colors

List of two color names for the borders and fill of the plots [default two_colors].

save2tmp

If TRUE, saves any ggplots and listings to the session temporary directory (tempdir) [default FALSE].

verbose

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

Details

The function gl.filter.locmetric will filter out the loci with a locmetric value below a specified threshold.

The fields that are included in dartR, and a short description, are found below. Optionally, the user can also set his/her own field by adding a vector into $other$loc.metrics as shown in the example. You can check the names of all available loc.metrics via: names(gl$other$loc.metrics).

  • SnpPosition - position (zero is position 1) in the sequence tag of the defined SNP variant base.

  • CallRate - proportion of samples for which the genotype call is non-missing (that is, not '-' ).

  • OneRatioRef - proportion of samples for which the genotype score is 0.

  • OneRatioSnp - proportion of samples for which the genotype score is 2.

  • FreqHomRef - proportion of samples homozygous for the Reference allele.

  • FreqHomSnp - proportion of samples homozygous for the Alternate (SNP) allele.

  • FreqHets - proportion of samples which score as heterozygous, that is, scored as 1.

  • PICRef - polymorphism information content (PIC) for the Reference allele.

  • PICSnp - polymorphism information content (PIC) for the SNP.

  • AvgPIC - average of the polymorphism information content (PIC) of the reference and SNP alleles.

  • AvgCountRef - sum of the tag read counts for all samples, divided by the number of samples with non-zero tag read counts, for the Reference allele row.

  • AvgCountSnp - sum of the tag read counts for all samples, divided by the number of samples with non-zero tag read counts, for the Alternate (SNP) allele row.

  • RepAvg - proportion of technical replicate assay pairs for which the marker score is consistent.

  • rdepth - read depth.

Function's output

The minimum, maximum, mean and a tabulation of quantiles of the locmetric values against thresholds rate are provided. Output also includes a boxplot and a histogram.

Quantiles are partitions of a finite set of values into q subsets of (nearly) equal sizes. In this function q = 20. Quantiles are useful measures because they are less susceptible to long-tailed distributions and outliers.

Plots and table were saved to the temporal directory (tempdir) and can be accessed with the function gl.print.reports and listed with the function gl.list.reports. Note that they can be accessed only in the current R session because tempdir is cleared each time that the R session is closed.

Examples of other themes that can be used can be consulted in:

Value

An unaltered genlight object.

Author(s)

Luis Mijangos (Post to https://groups.google.com/d/forum/dartr)

See Also

gl.filter.locmetric, gl.list.reports, gl.print.reports

Other report functions: gl.report.bases(), gl.report.callrate(), gl.report.diversity(), gl.report.hamming(), gl.report.heterozygosity(), gl.report.hwe(), gl.report.ld.map(), gl.report.maf(), gl.report.monomorphs(), gl.report.overshoot(), gl.report.parent.offspring(), gl.report.pa(), gl.report.rdepth(), gl.report.reproducibility(), gl.report.secondaries(), gl.report.sexlinked(), gl.report.taglength()

Examples

# adding dummy data
test <- testset.gl
test$other$loc.metrics$test <- 1:nLoc(test)
# SNP data
out <- gl.report.locmetric(test,metric='test')

# adding dummy data
test.gs <- testset.gs
test.gs$other$loc.metrics$test <- 1:nLoc(test.gs)
# Tag P/A data
out <- gl.report.locmetric(test.gs,metric='test')


green-striped-gecko/dartR documentation built on Jan. 31, 2024, 10:14 a.m.