barcoding.spe.identify: Species Identification using Protein-coding Barcodes

Description Usage Arguments Value Note Author(s) References Examples

View source: R/barcoding.spe.identify.R

Description

Species identification using protein-coding barcodes with different methods,including BP-based method (Zhang et al. 2008), fuzzy-set based method (Zhang et al. 2012), Bayesian-based method (Jin et al. 2013).

Usage

1
barcoding.spe.identify(ref, que, method = "bpNewTraining")

Arguments

ref

object of class "DNAbin" used as a reference dataset, which contains taxon information.

que

object of class "DNAbin", whose identities (species names) need to be inferred.

method

a character string indicating which method will be used to train model and/or infer species membership. One of these methods ("fuzzyId", "bpNewTraining", "bpNewTrainingOnly", "bpUseTrained","Bayesian") should be specified.

Value

a list containing model parameters used, species identification success rates using references, query sequences, species inferred, and corresponding confidence levels (bp probability for BP-based method / FMF values for fuzzy set theory based method / posterior probability for Bayesian method) when available.

Note

functions fasta2DNAbin() from package:adegenet and read.dna() from package:ape were used to obtain DNAbin object in our package. The former is used to read large aligned coding DNA barcodes, the latter unaligned ones. ref and que should be aligned with identical sequence length. We provided a pipeline to perform fast sequences alignment for reference and query sequences. Windows users could contact zhangab2008(at)mail.cnu.edu.cn for an exec version of the package. For very large DNA dataset, read.fas() package:phyloch is strongly suggested instead of fasta2DNAbin() since the latter is very slow.

Author(s)

Ai-bing ZHANG, PhD. CNU, Beijing, CHINA. zhangab2008(at)mail.cnu.edu.cn

References

Zhang, A. B., M. D. Hao, C. Q. Yang, and Z. Y. Shi. (2017). BarcodingR: an integrated R package for species identification using DNA barcodes. Methods Ecol Evol. 8(5):627-634. https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.12682.

Jin,Q., H.L. Han, X.M. Hu, X.H. Li,C.D. Zhu,S. Y. W. Ho, R. D. Ward, A.B. Zhang . (2013). Quantifying Species Diversity with a DNA Barcoding-Based Method: Tibetan Moth Species (Noctuidae) on the Qinghai-Tibetan Plateau. PloS One 8: e644. https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0064428.

Zhang, A. B., C. Muster, H.B. Liang, C.D. Zhu, R. Crozier, P. Wan, J. Feng, R. D. Ward.(2012). A fuzzy-set-theory-based approach to analyse species membership in DNA barcoding. Molecular Ecology, 21(8):1848-63. https://onlinelibrary.wiley.com/doi/10.1111/j.1365-294X.2011.05235.x

Zhang, A. B., D. S. Sikes, C. Muster, S. Q. Li. (2008). Inferring Species Membership using DNA sequences with Back-propagation Neural Networks. Systematic Biology, 57(2):202-215. https://besjournals.onlinelibrary.wiley.com/doi/10.1111/2041-210X.12682

Examples

1
2
3
4
5
6
7
8
9
data(TibetanMoth)
ref<-as.DNAbin(as.character(TibetanMoth[1:5,]))
que<-as.DNAbin(as.character(TibetanMoth[50:55,]))
bsi<-barcoding.spe.identify(ref, que, method = "fuzzyId")
bsi
bsi<-barcoding.spe.identify(ref, que, method = "bpNewTraining")
bsi
bsi<-barcoding.spe.identify(ref, que, method = "Bayesian")
bsi

Example output

Loading required package: ape
Loading required package: nnet
Loading required package: class
Loading required package: sp
$success.rates.ref
[1] 1

$output_identified
                                    queIDs                spe.Identified
1 BM0901039M,Noctuidae_Agrotis_macrobscura      Noctuidae_Himalaea_unica
2 BM0901045M,Noctuidae_Agrotis_macrobscura      Noctuidae_Himalaea_unica
3     LS0909005M,Noctuidae_Euxoa_oberthuri      Noctuidae_Himalaea_unica
4      BM0830067M,Noctuidae_Euxoa_sibirica      Noctuidae_Himalaea_unica
5    JZ0907052M,Noctuidae_Euxoa_hypobscura Noctuidae_Amphipyra_pyramidea
6     RKZ0908002M,Noctuidae_Euxoa_kotzschi      Noctuidae_Himalaea_unica
           FMF
1 2.770930e-02
2 1.654873e-02
3 4.550433e-04
4 1.798209e-05
5 1.039866e-02
6 0.000000e+00

attr(,"class")
[1] "BarcodingR"
# weights:  460
initial  value 10.466362 
iter  10 value 3.412709
iter  20 value 2.155699
iter  30 value 1.934564
iter  40 value 1.737557
iter  50 value 0.392022
iter  60 value 0.157630
iter  70 value 0.137120
iter  80 value 0.112898
iter  90 value 0.094667
iter 100 value 0.092354
iter 110 value 0.084658
iter 120 value 0.070138
iter 130 value 0.061137
iter 140 value 0.058014
iter 150 value 0.053519
iter 160 value 0.050661
iter 170 value 0.049096
iter 180 value 0.046340
iter 190 value 0.043699
iter 200 value 0.040881
iter 210 value 0.039179
iter 220 value 0.029936
iter 230 value 0.029719
iter 240 value 0.026707
iter 250 value 0.026404
iter 260 value 0.025951
iter 270 value 0.025673
iter 280 value 0.025656
iter 290 value 0.025643
iter 300 value 0.025641
final  value 0.025640 
converged
$summary.model
a 147-3-4 network with 460 weights
options were - decay=5e-05
   b->h1   i1->h1   i2->h1   i3->h1   i4->h1   i5->h1   i6->h1   i7->h1 
   -0.05    -0.24    -0.32     0.66    -0.32     0.45    -0.24    -0.03 
  i8->h1   i9->h1  i10->h1  i11->h1  i12->h1  i13->h1  i14->h1  i15->h1 
    0.19    -0.64     0.05     0.03    -0.62    -0.48    -0.48     0.41 
 i16->h1  i17->h1  i18->h1  i19->h1  i20->h1  i21->h1  i22->h1  i23->h1 
   -0.01    -0.01    -0.01     0.21    -0.95    -0.06    -0.01     0.01 
 i24->h1  i25->h1  i26->h1  i27->h1  i28->h1  i29->h1  i30->h1  i31->h1 
   -0.06     0.66     0.21    -0.48    -0.24    -0.69    -1.01    -0.82 
 i32->h1  i33->h1  i34->h1  i35->h1  i36->h1  i37->h1  i38->h1  i39->h1 
    0.18    -0.01    -0.01    -0.01    -0.48    -0.70    -0.01    -1.11 
 i40->h1  i41->h1  i42->h1  i43->h1  i44->h1  i45->h1  i46->h1  i47->h1 
   -0.06    -0.06     0.33     0.30    -0.64     0.61     0.30     0.45 
 i48->h1  i49->h1  i50->h1  i51->h1  i52->h1  i53->h1  i54->h1  i55->h1 
   -0.40    -1.03    -0.35    -0.06    -0.22     0.32    -0.01    -0.01 
 i56->h1  i57->h1  i58->h1  i59->h1  i60->h1  i61->h1  i62->h1  i63->h1 
    0.66    -0.01    -0.01    -0.64     0.54     0.33     0.63    -0.66 
 i64->h1  i65->h1  i66->h1  i67->h1  i68->h1  i69->h1  i70->h1  i71->h1 
   -0.69    -0.02     0.63    -0.01     0.21     0.23    -0.01    -0.01 
 i72->h1  i73->h1  i74->h1  i75->h1  i76->h1  i77->h1  i78->h1  i79->h1 
    0.18    -0.68     0.33    -0.56     0.30     0.21     0.41    -0.01 
 i80->h1  i81->h1  i82->h1  i83->h1  i84->h1  i85->h1  i86->h1  i87->h1 
   -0.01    -0.48    -0.48    -1.11     0.45     0.54     0.41    -0.01 
 i88->h1  i89->h1  i90->h1  i91->h1  i92->h1  i93->h1  i94->h1  i95->h1 
   -0.01    -0.11    -0.48     0.30     0.96     0.41     0.21    -0.01 
 i96->h1  i97->h1  i98->h1  i99->h1 i100->h1 i101->h1 i102->h1 i103->h1 
    0.18    -0.32     0.96     0.21     0.66    -0.11    -0.01    -0.48 
i104->h1 i105->h1 i106->h1 i107->h1 i108->h1 i109->h1 i110->h1 i111->h1 
    0.89     0.21    -0.64    -0.64     0.30     0.30    -0.32    -0.03 
i112->h1 i113->h1 i114->h1 i115->h1 i116->h1 i117->h1 i118->h1 i119->h1 
   -1.03     0.41     1.08     0.33    -0.72     0.61     0.30    -0.01 
i120->h1 i121->h1 i122->h1 i123->h1 i124->h1 i125->h1 i126->h1 i127->h1 
   -0.22    -0.64    -0.32    -0.11     0.16     0.08     0.66     0.41 
i128->h1 i129->h1 i130->h1 i131->h1 i132->h1 i133->h1 i134->h1 i135->h1 
    0.33    -0.64    -0.22    -0.01    -0.48     0.54     0.30    -0.01 
i136->h1 i137->h1 i138->h1 i139->h1 i140->h1 i141->h1 i142->h1 i143->h1 
   -0.01    -0.01     1.08    -0.01    -0.01     0.41    -0.72     0.41 
i144->h1 i145->h1 i146->h1 i147->h1 
    0.03     0.01     1.08     0.16 
   b->h2   i1->h2   i2->h2   i3->h2   i4->h2   i5->h2   i6->h2   i7->h2 
    0.08     0.23    -0.32     0.80    -0.32    -0.41     0.23    -0.05 
  i8->h2   i9->h2  i10->h2  i11->h2  i12->h2  i13->h2  i14->h2  i15->h2 
    1.23    -0.65     0.21     0.15    -0.58     0.45     0.45    -0.54 
 i16->h2  i17->h2  i18->h2  i19->h2  i20->h2  i21->h2  i22->h2  i23->h2 
    0.02     0.02     0.02    -0.27    -0.97    -0.10     0.02     0.07 
 i24->h2  i25->h2  i26->h2  i27->h2  i28->h2  i29->h2  i30->h2  i31->h2 
   -0.10     0.80    -0.27     0.45     0.23    -0.76     0.41     0.06 
 i32->h2  i33->h2  i34->h2  i35->h2  i36->h2  i37->h2  i38->h2  i39->h2 
    1.24     0.01     0.01     0.01     0.45     0.73     0.01    -0.20 
 i40->h2  i41->h2  i42->h2  i43->h2  i44->h2  i45->h2  i46->h2  i47->h2 
   -0.10    -0.10     0.40     0.34    -0.64     0.69     0.34    -0.41 
 i48->h2  i49->h2  i50->h2  i51->h2  i52->h2  i53->h2  i54->h2  i55->h2 
   -0.86     0.34    -0.38    -0.10    -1.20    -1.16     0.02     0.01 
 i56->h2  i57->h2  i58->h2  i59->h2  i60->h2  i61->h2  i62->h2  i63->h2 
    0.80     0.01     0.02    -0.64     0.12     0.40    -0.83    -0.71 
 i64->h2  i65->h2  i66->h2  i67->h2  i68->h2  i69->h2  i70->h2  i71->h2 
   -0.76     0.03    -0.83     0.02    -0.27    -0.20     0.02     0.02 
 i72->h2  i73->h2  i74->h2  i75->h2  i76->h2  i77->h2  i78->h2  i79->h2 
    1.24    -0.76     0.40    -0.10     0.34    -0.27    -0.54     0.02 
 i80->h2  i81->h2  i82->h2  i83->h2  i84->h2  i85->h2  i86->h2  i87->h2 
    0.01     0.45     0.45    -0.20    -0.41     0.12    -0.54     0.02 
 i88->h2  i89->h2  i90->h2  i91->h2  i92->h2  i93->h2  i94->h2  i95->h2 
    0.02    -0.60     0.45     0.34    -0.43    -0.54    -0.27     0.01 
 i96->h2  i97->h2  i98->h2  i99->h2 i100->h2 i101->h2 i102->h2 i103->h2 
    1.24    -0.32    -0.43    -0.27     0.80    -0.60     0.01     0.45 
i104->h2 i105->h2 i106->h2 i107->h2 i108->h2 i109->h2 i110->h2 i111->h2 
    0.58    -0.27    -0.64    -0.65     0.34     0.34    -0.32    -0.05 
i112->h2 i113->h2 i114->h2 i115->h2 i116->h2 i117->h2 i118->h2 i119->h2 
    0.34    -0.54     0.25     0.40     0.67     0.69     0.34     0.02 
i120->h2 i121->h2 i122->h2 i123->h2 i124->h2 i125->h2 i126->h2 i127->h2 
    0.29    -0.64    -0.32    -0.60    -0.24    -0.94     0.80    -0.54 
i128->h2 i129->h2 i130->h2 i131->h2 i132->h2 i133->h2 i134->h2 i135->h2 
    0.40    -0.64     0.29     0.02     0.45     0.12     0.34     0.02 
i136->h2 i137->h2 i138->h2 i139->h2 i140->h2 i141->h2 i142->h2 i143->h2 
    0.02     0.02     0.25     0.02     0.01    -0.54     0.67    -0.54 
i144->h2 i145->h2 i146->h2 i147->h2 
    0.15     0.07     0.25    -0.24 
   b->h3   i1->h3   i2->h3   i3->h3   i4->h3   i5->h3   i6->h3   i7->h3 
    0.33    -0.21     0.25     0.71     0.25     0.61    -0.21    -0.48 
  i8->h3   i9->h3  i10->h3  i11->h3  i12->h3  i13->h3  i14->h3  i15->h3 
    0.20     0.48     1.67     1.16     1.02    -0.42    -0.42    -0.48 
 i16->h3  i17->h3  i18->h3  i19->h3  i20->h3  i21->h3  i22->h3  i23->h3 
    0.07     0.07     0.07    -0.24     0.70    -0.96     0.07     0.58 
 i24->h3  i25->h3  i26->h3  i27->h3  i28->h3  i29->h3  i30->h3  i31->h3 
   -0.96     0.71    -0.24    -0.42    -0.21    -0.55     0.08    -0.74 
 i32->h3  i33->h3  i34->h3  i35->h3  i36->h3  i37->h3  i38->h3  i39->h3 
    0.23     0.03     0.03     0.03    -0.42    -0.14     0.03     0.03 
 i40->h3  i41->h3  i42->h3  i43->h3  i44->h3  i45->h3  i46->h3  i47->h3 
   -0.96    -0.96     0.36    -0.16     0.51    -0.31    -0.16     0.61 
 i48->h3  i49->h3  i50->h3  i51->h3  i52->h3  i53->h3  i54->h3  i55->h3 
    0.75    -0.47    -0.26    -0.96    -0.04    -0.56     0.07     0.03 
 i56->h3  i57->h3  i58->h3  i59->h3  i60->h3  i61->h3  i62->h3  i63->h3 
    0.68     0.03     0.07     0.51     0.08     0.36    -0.79    -0.04 
 i64->h3  i65->h3  i66->h3  i67->h3  i68->h3  i69->h3  i70->h3  i71->h3 
   -0.52     0.13    -0.79     0.07    -0.24     0.31     0.07     0.07 
 i72->h3  i73->h3  i74->h3  i75->h3  i76->h3  i77->h3  i78->h3  i79->h3 
    0.23    -0.55     0.36     0.01    -0.16    -0.24    -0.48     0.07 
 i80->h3  i81->h3  i82->h3  i83->h3  i84->h3  i85->h3  i86->h3  i87->h3 
    0.03    -0.42    -0.42     0.03     0.61     0.08    -0.48     0.07 
 i88->h3  i89->h3  i90->h3  i91->h3  i92->h3  i93->h3  i94->h3  i95->h3 
    0.07    -0.02    -0.42    -0.16    -0.46    -0.48    -0.24     0.03 
 i96->h3  i97->h3  i98->h3  i99->h3 i100->h3 i101->h3 i102->h3 i103->h3 
    0.23     0.25    -0.46    -0.24     0.71    -0.02     0.03    -0.45 
i104->h3 i105->h3 i106->h3 i107->h3 i108->h3 i109->h3 i110->h3 i111->h3 
    0.95    -0.24     0.51     0.48    -0.16    -0.16     0.25    -0.48 
i112->h3 i113->h3 i114->h3 i115->h3 i116->h3 i117->h3 i118->h3 i119->h3 
   -0.47    -0.48     0.17     0.36    -0.69    -0.31    -0.16     0.07 
i120->h3 i121->h3 i122->h3 i123->h3 i124->h3 i125->h3 i126->h3 i127->h3 
    0.34     0.51     0.26    -0.02    -0.22    -0.80     0.71    -0.48 
i128->h3 i129->h3 i130->h3 i131->h3 i132->h3 i133->h3 i134->h3 i135->h3 
    0.36     0.51     0.34     0.07    -0.42     0.08    -0.16     0.07 
i136->h3 i137->h3 i138->h3 i139->h3 i140->h3 i141->h3 i142->h3 i143->h3 
    0.07     0.07     0.17     0.07     0.03    -0.48    -0.69    -0.48 
i144->h3 i145->h3 i146->h3 i147->h3 
    1.16     0.58     0.17    -0.19 
 b->o1 h1->o1 h2->o1 h3->o1 
 -0.22  -4.80   4.81  -4.54 
 b->o2 h1->o2 h2->o2 h3->o2 
 -0.15  -4.88  -4.61   4.85 
 b->o3 h1->o3 h2->o3 h3->o3 
  0.03   4.87  -4.80  -4.80 
 b->o4 h1->o4 h2->o4 h3->o4 
 -8.47   4.03   4.48   4.39 

$convergence
[1] 0

$success.rates.ref
[1] 1

$output_identified
                                    queIDs                spe.Identified
1 BM0901039M,Noctuidae_Agrotis_macrobscura      Noctuidae_Himalaea_unica
2 BM0901045M,Noctuidae_Agrotis_macrobscura Noctuidae_Amphipyra_pyramidea
3     LS0909005M,Noctuidae_Euxoa_oberthuri      Noctuidae_Himalaea_unica
4      BM0830067M,Noctuidae_Euxoa_sibirica        Noctuidae_Auchmis_saga
5    JZ0907052M,Noctuidae_Euxoa_hypobscura Noctuidae_Amphipyra_pyramidea
6     RKZ0908002M,Noctuidae_Euxoa_kotzschi        Noctuidae_Auchmis_saga
    bp.prob
1 0.1605032
2 0.1475647
3 0.2331130
4 0.1964010
5 0.2814527
6 0.2330684

attr(,"class")
[1] "BarcodingR"
$output_identified
                                    queIDs                spe.Identified
1 BM0901039M,Noctuidae_Agrotis_macrobscura        Noctuidae_Auchmis_saga
2 BM0901045M,Noctuidae_Agrotis_macrobscura Noctuidae_Amphipyra_pyramidea
3     LS0909005M,Noctuidae_Euxoa_oberthuri      Noctuidae_Himalaea_unica
4      BM0830067M,Noctuidae_Euxoa_sibirica        Noctuidae_Auchmis_saga
5    JZ0907052M,Noctuidae_Euxoa_hypobscura Noctuidae_Amphipyra_pyramidea
6     RKZ0908002M,Noctuidae_Euxoa_kotzschi        Noctuidae_Auchmis_saga
  Bayesian.prob
1     0.9980040
2     0.9994993
3     0.9999995
4     0.9999980
5     0.9999995
6     0.9999980

attr(,"class")
[1] "BarcodingR"

BarcodingR documentation built on April 14, 2020, 6:04 p.m.