Source
Brown S.D.J., Collins R.A., Boyer S., Lefort M.-C., Malumbres-Olarte J., Vink C.J., Cruickshank, R.H. 2012. Spider: An R package for the analysis of species identity and evolution, with particular reference to DNA barcoding. Molecular Ecology Resources, 12: 562-565.
Arguments
- distobj
A distance object (usually from dist.dna).
- threshold
Distance cutoff for clustering. Default of 0.01. See localMinima for details.
- haps
Optional. A vector of haplotypes to keep into the tbl_df.
- delimname
Character. String to rename the delimitation method in the table. Default to 'locmin'.
Value
An object of class tbl_df.
Details
spider
package uses localMinima to
determine possible thresholds for any distance matrix and tclust
to cluster samples within a given threshold
into species partitions.
locmin_tbl()
turns these inputs into a tibble which matches
the output from gmyc_tbl and bgmyc_tbl.
Examples
# create a distance matrix
mat <- ape::dist.dna(geophagus, model = "raw", pairwise.deletion = TRUE)
# run Local Minima
locmin_res <- spider::localMinima(mat)
#> [1] 0.006828358 0.018994392 0.040791871 0.055999413 0.067151612 0.082105695
# create a tibble
locmin_df <- locmin_tbl(mat,
threshold = locmin_res$localMinima[1],
haps = ape::as.phylo(geophagus_beast)$tip.label)
# check
locmin_df
#> # A tibble: 137 × 2
#> labels locmin
#> <chr> <int>
#> 1 MZ504301.1 1
#> 2 MZ504318.1 1
#> 3 MZ504341.1 1
#> 4 MZ504337.1 1
#> 5 MZ504342.1 1
#> 6 MZ504304.1 1
#> 7 MZ504332.1 1
#> 8 MZ504343.1 1
#> 9 MZ504315.1 1
#> 10 MZ504345.1 1
#> # ℹ 127 more rows