localMinima: Determine thresholds from a density plot

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/localMinima.R

Description

This function determines possible thresholds from the distance matrix for an alignment.

Usage

1
localMinima(distobj)

Arguments

distobj

A distance object (usually from dist.dna).

Details

This function is based on the concept of the barcoding gap, where a dip in the density of genetic distances indicates the transition between intra- and inter-specific distances. Understanding your data is vital to correctly interpreting the output of this function, but as a start, the first local minimum is often a good place to start.

The value of this function is that it does not require prior knowledge of species identity to get an indication of potential threshold values.

Value

An object of class ‘density’, which is a list containing the values calculated by density. The element localMinima has been added, which contains the values of the local minima of the density plot.

Author(s)

Samuel Brown <[email protected]>

See Also

dist.dna, density. Also as help, ~~~

Examples

1
2
3
4
5
6
7
8
data(anoteropsis)
anoDist <- ape::dist.dna(anoteropsis)

anoThresh <- localMinima(anoDist)
graphics::plot(anoThresh)
anoThresh$localMinima
#Often the first value is the one to go for:
anoThresh$localMinima[1]

spider documentation built on Feb. 17, 2018, 1:02 a.m.