Learn R Programming

BarcodingR (version 1.0-3)

TDR2: TDR2 Species Membership Value

Description

To calculate TDR value for a set of queries and one potential species. Its value is in the range of [0,1], 0 indicates extremly weak species membership, values close 1 indicating strong species membership.

Usage

TDR2(oneSpe, que, boot, boot2)

Arguments

oneSpe

object of class "DNAbin" which contains DNA sequences from one species

que

object of class "DNAbin" which contains DNA sequences different samples

boot

a numeric value indicating times of resampling along sequence columns

boot2

a numeric value indicating times of resampling along sequence rows (different samples)

Value

a numeric vector represents TDR values for each query against the species

References

Jin Q, L,J.He, A.B. Zhang* (2012). A Simple 2D Non-Parametric Resampling Statistical Approach to Assess Confidence in Species Identification in DNA Barcoding-An Alternative to Likelihood and Bayesian Approaches. PLoS ONE 7(12): e50831. doi:10.1371/ journal. pone. 0050831. http://dx.plos.org/ 10.1371/ journal. pone. 0050831.

Examples

Run this code
# NOT RUN {
data(TibetanMoth)  
sampleSpeNames<-NAMES(TibetanMoth)
Spp<-gsub(".+,","",sampleSpeNames)
oneSpe<-TibetanMoth[grep("Macdunnoughia_crassisigna", Spp, value = FALSE,fixed = TRUE),] 
oneSpe<-as.DNAbin(as.character(oneSpe[1:5,]))
que<-TibetanMoth[grep("Agrotis_justa", Spp, value = FALSE,fixed = TRUE),] 
que2<-oneSpe[1:2,]
out<-TDR2(oneSpe,que, boot=10,boot2=10) ### true false identification
# }

Run the code above in your browser using DataLab