cutoff_predictor: Predict cutoff thresholds for use with mlg.filter

View source: R/filter_stats.R

cutoff_predictorR Documentation

Predict cutoff thresholds for use with mlg.filter

Description

Given a series of thresholds for a data set that collapse it into one giant cluster, this will search the top fraction of threshold differences to find the largest difference. The average between the thresholds spanning that difference is the cutoff threshold defining the clonal lineage threshold.

Usage

cutoff_predictor(thresholds, fraction = 0.5)

Arguments

thresholds

a vector of numerics coming from mlg.filter where the threshold has been set to the maximum threshold theoretically possible.

fraction

the fraction of the data to seek the threshold.

Value

a numeric value representing the threshold at which multilocus lineages should be defined.

Note

This function originally appeared in \Sexpr[results=rd]{tools:::Rd_expr_doi("10.5281/zenodo.17424")}. This is a bit of a blunt instrument.

Author(s)

Zhian N. Kamvar

References

ZN Kamvar, JC Brooks, and NJ Grünwald. 2015. Supplementary Material for Frontiers Plant Genetics and Genomics 'Novel R tools for analysis of genome-wide population genetic data with emphasis on clonality'. DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.5281/zenodo.17424")}

Kamvar ZN, Brooks JC and Grünwald NJ (2015) Novel R tools for analysis of genome-wide population genetic data with emphasis on clonality. Front. Genet. 6:208. doi: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3389/fgene.2015.00208")}

See Also

filter_stats mlg.filter

Examples


data(Pinf)
pinfreps <- fix_replen(Pinf, c(2, 2, 6, 2, 2, 2, 2, 2, 3, 3, 2))
pthresh  <- filter_stats(Pinf, distance = bruvo.dist, replen = pinfreps, 
                         plot = TRUE, stats = "THRESHOLD", threads = 1L)

# prediction for farthest neighbor
cutoff_predictor(pthresh$farthest)

# prediction for all algorithms
sapply(pthresh, cutoff_predictor)


poppr documentation built on May 29, 2024, 5:54 a.m.