diff -Nru adhoc-1.0/debian/changelog adhoc-1.1/debian/changelog --- adhoc-1.0/debian/changelog 2017-03-18 19:05:19.000000000 +0000 +++ adhoc-1.1/debian/changelog 2017-03-18 19:05:19.000000000 +0000 @@ -1,19 +1,27 @@ -adhoc (1.0-1cran1trusty0~ubuntu16.04.1~ppa1) xenial; urgency=medium +adhoc (1.1-1cran1ppa0) xenial; urgency=medium - * No-change backport to xenial + * Compilation for Ubuntu 16.04.2 LTS - -- Michael Rutter Fri, 13 May 2016 23:38:25 -0400 + -- Michael Rutter Sat, 18 Mar 2017 19:03:48 +0000 -adhoc (1.0-1cran1trusty0) trusty; urgency=medium +adhoc (1.1-1cran1) testing; urgency=low - * Compilation for Ubuntu 14.04 LTS + * cran2deb svn: 362M with DB version 1. + + -- cran2deb4ubuntu Sat, 18 Mar 2017 11:21:12 -0400 + + +adhoc (1.0-1cran2) testing; urgency=low + + * cran2deb svn: 362M with DB version 1. + + -- cran2deb4ubuntu Sun, 23 Oct 2016 02:16:23 -0400 - -- Michael Rutter Fri, 11 Jul 2014 20:45:45 +0000 adhoc (1.0-1cran1) testing; urgency=low * cran2deb svn: 362M with DB version 1. - -- cran2deb4ubuntu Fri, 11 Jul 2014 09:47:29 -0400 + -- cran2deb4ubuntu Fri, 11 Jul 2014 09:47:39 -0400 diff -Nru adhoc-1.0/debian/compat adhoc-1.1/debian/compat --- adhoc-1.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ adhoc-1.1/debian/compat 2017-03-18 19:05:19.000000000 +0000 @@ -0,0 +1 @@ +7 \ No newline at end of file diff -Nru adhoc-1.0/debian/control adhoc-1.1/debian/control --- adhoc-1.0/debian/control 2017-03-18 19:05:19.000000000 +0000 +++ adhoc-1.1/debian/control 2017-03-18 19:05:19.000000000 +0000 @@ -2,22 +2,24 @@ Section: gnu-r Priority: optional Maintainer: cran2deb4ubuntu -Build-Depends: r-base-dev, r-cran-spider, r-cran-ape, r-cran-polynom, +Build-Depends: r-base-dev, r-cran-ape, r-cran-pegas, r-cran-polynom, xvfb, xauth, xfonts-base, r-base-core, debhelper (>> 4.1.0), cdbs Standards-Version: 3.9.1 Homepage: http://jemu.myspecies.info/computer-programs Package: r-cran-adhoc Architecture: all -Depends: r-base-core, r-cran-spider, r-cran-ape, r-cran-polynom -Description: GNU R package "calculate ad hoc distance thresholds for - DNA barcoding identification" +Depends: r-base-core, r-cran-ape, r-cran-pegas, r-cran-polynom +Description: GNU R package "Calculate Ad Hoc Distance Thresholds for + DNA Barcoding Identification" . - An ad hoc distance threshold can be calculated for each particular - reference library of DNA barcodes. Specimen identification at this ad - hoc distance threshold (using the best close match method) will - produce identifications with an estimated relative error probability - that can be fixed by the user (e.g. 5%) + Two functions to calculate intra- and interspecific pairwise distances, + evaluate DNA barcoding identification error and calculate an ad hoc + distance threshold for each particular reference library of DNA + barcodes. Specimen identification at this ad hoc distance threshold + (using the best close match method) will produce identifications with + an estimated relative error probability that can be fixed by the user + (e.g. 5%). . Author: Gontran Sonet . diff -Nru adhoc-1.0/debian/copyright adhoc-1.1/debian/copyright --- adhoc-1.0/debian/copyright 2017-03-18 19:05:19.000000000 +0000 +++ adhoc-1.1/debian/copyright 2017-03-18 19:05:19.000000000 +0000 @@ -2,7 +2,7 @@ automatically using cran2deb4ubuntu by cran2deb4ubuntu . -The original GNU R package is Copyright (C) 2014 Gontran Sonet and +The original GNU R package is Copyright (C) 2017 Gontran Sonet and possibly others. The original GNU R package is maintained by Gontran Sonet diff -Nru adhoc-1.0/DESCRIPTION adhoc-1.1/DESCRIPTION --- adhoc-1.0/DESCRIPTION 2013-12-13 11:42:11.000000000 +0000 +++ adhoc-1.1/DESCRIPTION 2017-03-17 18:56:42.000000000 +0000 @@ -1,16 +1,16 @@ Package: adhoc -Version: 1.0 +Version: 1.1 Type: Package -Title: calculate ad hoc distance thresholds for DNA barcoding - identification -Date: 2013-11-08 +Title: Calculate Ad Hoc Distance Thresholds for DNA Barcoding + Identification +Date: 2017-03-17 Author: Gontran Sonet Maintainer: Gontran Sonet -Description: An ad hoc distance threshold can be calculated for each particular reference library of DNA barcodes. Specimen identification at this ad hoc distance threshold (using the best close match method) will produce identifications with an estimated relative error probability that can be fixed by the user (e.g. 5%) +Description: Two functions to calculate intra- and interspecific pairwise distances, evaluate DNA barcoding identification error and calculate an ad hoc distance threshold for each particular reference library of DNA barcodes. Specimen identification at this ad hoc distance threshold (using the best close match method) will produce identifications with an estimated relative error probability that can be fixed by the user (e.g. 5%). URL: http://jemu.myspecies.info/computer-programs -Depends: R (>= 2.15), spider, ape, polynom +Depends: R (>= 2.15), ape, pegas, polynom License: GPL (>= 2) -Packaged: 2013-12-13 09:29:37 UTC; gsonet NeedsCompilation: no +Packaged: 2017-03-17 14:12:04 UTC; gsonet Repository: CRAN -Date/Publication: 2013-12-13 12:42:11 +Date/Publication: 2017-03-17 18:56:42 UTC diff -Nru adhoc-1.0/inst/CITATION adhoc-1.1/inst/CITATION --- adhoc-1.0/inst/CITATION 1970-01-01 00:00:00.000000000 +0000 +++ adhoc-1.1/inst/CITATION 2017-03-17 14:12:04.000000000 +0000 @@ -0,0 +1,13 @@ +citHeader("To cite package adhoc in publications use:") + +year <- 2013 + +citEntry(entry = "Article", +title = "Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification", +author = personList(as.person("Gontran Sonet"), as.person("Kurt Jordaens"), as.person("Zoltan T. Nagy"), as.person("Floris C. Breman"), as.person("Marc De Meyer"), as.person("Thierry Backeljau"), as.person("Massimiliano Virgilio")), +year = "2013", +journal = "Zookeys", +volume = "365", +pages = "329--336", +url = "http://zookeys.pensoft.net/articles.php?id=3057", +textVersion = paste0("Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T & Virgilio M", "(2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification, Zookeys, 365:329-336")) diff -Nru adhoc-1.0/man/adhoc-package.Rd adhoc-1.1/man/adhoc-package.Rd --- adhoc-1.0/man/adhoc-package.Rd 2013-12-13 09:29:36.000000000 +0000 +++ adhoc-1.1/man/adhoc-package.Rd 2017-03-17 14:12:04.000000000 +0000 @@ -25,7 +25,7 @@ } \references{ -Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T, Virgilio M (2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification. Zookeys. +Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T & Virgilio M", "(2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification, Zookeys, 365:329-336. http://zookeys.pensoft.net/articles.php?id=3057. Virgilio M, Jordaens K, Breman FC, Backeljau T, De Meyer M. (2012) Identifying insects with incomplete DNA barcode libraries, African Fruit flies (Diptera: Tephritidae) as a test case. PLoS ONE 7(2) e31581. doi: 10.1371/journal.pone.0031581. } diff -Nru adhoc-1.0/man/adhocTHR.Rd adhoc-1.1/man/adhocTHR.Rd --- adhoc-1.0/man/adhocTHR.Rd 2013-12-13 09:29:36.000000000 +0000 +++ adhoc-1.1/man/adhocTHR.Rd 2017-03-17 14:12:04.000000000 +0000 @@ -29,7 +29,7 @@ \item{redflaggedSP}{ lists all species names that are involved in the same ambiguous identification. } } \references{ -Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T, Virgilio M (2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification. Zookeys. +Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T & Virgilio M", "(2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification, Zookeys, 365:329-336. http://zookeys.pensoft.net/articles.php?id=3057. Venables B, Hornik K, Maechler M (2013) polynom: a collection of functions to implement a class for univariate polynomial manipulations. R package version 1.3-7. http://cran.r-project.org/web/packages/polynom/index.html. diff -Nru adhoc-1.0/man/checkDNAbcd.Rd adhoc-1.1/man/checkDNAbcd.Rd --- adhoc-1.0/man/checkDNAbcd.Rd 2013-12-13 09:29:36.000000000 +0000 +++ adhoc-1.1/man/checkDNAbcd.Rd 2017-03-17 14:12:04.000000000 +0000 @@ -14,6 +14,10 @@ \item{DistModel}{ "K80" (for Kimura two-parameter) or "raw" (for p-distances) or any other nucleotide substitution model available in the function \code{"dist.dna"} (Paradis et al. 2004). } } +\details{ +Sequence labels of \code{"seq"} should have the following structure: ">species_name_any_additional_information" as in the following example (note that character strings have to be separated by underscores): ">Bactrocera_amplexa_Kenya_voucher1052_JEMU". +} + \value{ checkDNAbcd returns a list of 6 components: \item{mylabels}{ a data.frame providing both parts of the species names and the complete label of each sequence (as extracted from the first argument). } @@ -23,10 +27,11 @@ \item{spdist}{ a list of all pairwise interspecific distances (inter) and all pairwise intraspecific distances (intra). } \item{seq}{ an object of class \code{"DNAbin"} with all sequences in the reference library (= first argument). } } + \references{ Paradis E, Claude J, Strimmer K (2004) APE: analyses of phylogenetics and evolution in R language. Bioinformatics 20: 289-290. -Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T, Virgilio M (2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification. Zookeys. +Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T & Virgilio M", "(2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification, Zookeys, 365:329-336. http://zookeys.pensoft.net/articles.php?id=3057. } \author{ Gontran Sonet @@ -37,10 +42,21 @@ \examples{ data(tephdata); out1<-checkDNAbcd(tephdata); -layout(matrix(c(1:4),1,4)); + +#Plot distribution of sequence lengths hist(out1$DNAlength,main="Seq. lengths",xlab="Seq. length (bp)"); + +#Plot distribution of pairwise interspecific distances hist(out1$spdist$inter,main="Intersp. dist",xlab="Distance",col="#0000ff99"); + +#Plot distribution of pairwise intraspecific distances hist(out1$spdist$intra, main="Intrasp. dist.",xlab="Distance",col="#0000ff22"); + +#Plot distribution of both pairwise intra- and interspecific distances hist(out1$spdist$inter,main="Intra- & intersp. dist",xlab="Distance",col="#0000ff99"); hist(out1$spdist$intra, add=TRUE,col="#0000ff22"); -} + +#Idem as previous example with zoom on intraspecific values +hist(out1$spdist$intra,main="Zoom intra- & intersp. dist",xlab="Distance",col="#0000ff99"); +hist(out1$spdist$inter, add=TRUE,col="#0000ff22"); +} \ No newline at end of file diff -Nru adhoc-1.0/man/tephdata.Rd adhoc-1.1/man/tephdata.Rd --- adhoc-1.0/man/tephdata.Rd 2013-12-13 09:29:36.000000000 +0000 +++ adhoc-1.1/man/tephdata.Rd 2017-03-17 14:12:04.000000000 +0000 @@ -11,7 +11,7 @@ } \references{ -Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T, Virgilio M (2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification. Zookeys. +Sonet G, Jordaens K, Nagy ZT, Breman FC, De Meyer M, Backeljau T & Virgilio M", "(2013) Adhoc: an R package to calculate ad hoc distance thresholds for DNA barcoding identification, Zookeys, 365:329-336. http://zookeys.pensoft.net/articles.php?id=3057. Virgilio M, Jordaens K, Breman FC, Backeljau T, De Meyer M. (2012) Identifying insects with incomplete DNA barcode libraries, African Fruit flies (Diptera: Tephritidae) as a test case. PLoS ONE 7(2) e31581. doi: 10.1371/journal.pone.0031581. } diff -Nru adhoc-1.0/MD5 adhoc-1.1/MD5 --- adhoc-1.0/MD5 2013-12-13 11:42:11.000000000 +0000 +++ adhoc-1.1/MD5 2017-03-17 18:56:42.000000000 +0000 @@ -1,9 +1,10 @@ -b7816cd6de485c224dc7eac7a515b7c8 *DESCRIPTION -6a3dc815b858f6118cc2d371c3cac609 *NAMESPACE -0a7bcbf84c3e498af29df36f938a3ba9 *R/adhocTHR.R -90e0f693df885d019ce745b0261f949f *R/checkDNAbcd.R +30397f4f7cedf27401b5c8248748c511 *DESCRIPTION +2f7b3a1309ee576574bbf932c1ba2f8f *NAMESPACE +ae398e663656ff3d208bcc150d126b7b *R/adhocTHR.R +45e63705be58cdad680f0f00f1458653 *R/checkDNAbcd.R 7516060dbf1a35260a20a7d5c6f3fe46 *data/tephdata.rda -06dd908e93dd35a2ce830ca3afa0eeeb *man/adhoc-package.Rd -7d696115771410e86d85e3ae3d4b0be2 *man/adhocTHR.Rd -9cbc09259b6916b24ac0c49952268cb5 *man/checkDNAbcd.Rd -526fd5eede0de13ebd09e8c1b382a767 *man/tephdata.Rd +3360c01828692d2a285fc8de129895d7 *inst/CITATION +10b961609d0a86907424350dc300cbfc *man/adhoc-package.Rd +09aa644a3beae87a075538d5203ea035 *man/adhocTHR.Rd +ca948b9aade5cfbfc0258226eae5aabf *man/checkDNAbcd.Rd +a67ed5306504bf8ff0d9785f02202c04 *man/tephdata.Rd diff -Nru adhoc-1.0/NAMESPACE adhoc-1.1/NAMESPACE --- adhoc-1.0/NAMESPACE 2013-12-13 09:29:36.000000000 +0000 +++ adhoc-1.1/NAMESPACE 2017-03-17 14:12:04.000000000 +0000 @@ -1,2 +1,5 @@ -export("checkDNAbcd", "adhocTHR") -import(spider,polynom, ape) +import(pegas, polynom) +importFrom("stats", "lm","na.omit") +importFrom("utils", "write.csv") +importFrom("ape", "dist.dna") +export("checkDNAbcd", "adhocTHR") \ No newline at end of file diff -Nru adhoc-1.0/R/adhocTHR.R adhoc-1.1/R/adhocTHR.R --- adhoc-1.0/R/adhocTHR.R 2013-12-13 09:29:36.000000000 +0000 +++ adhoc-1.1/R/adhocTHR.R 2017-03-17 14:12:04.000000000 +0000 @@ -110,7 +110,7 @@ myreg<-c(); THR<-c(); myreg<-lm(RE~thres,IDcheck); - myreg$coefficients[3:4]<-0;# this is to uniformise the format of the regression with the polynomial regression (coefficient for x^2 and x^3 = 0) + myreg$coefficients[3:4]<-0;# this is to uniformise the format of the regression with the polynomial regression (coefficients for x^2 and x^3 = 0) } #### POLYNOMIAL REGRESSION #### @@ -122,14 +122,15 @@ IDcheck$thres2<-IDcheck$thres^2; IDcheck$thres3<-IDcheck$thres^3; myreg<- lm(RE ~ thres + thres2 + thres3, IDcheck); - fp<-polynomial(myreg$coefficient); + fp<-polynomial(myreg$coefficients); solp<-solve(fp,ErrProb); THR<-solp[(solp > 0) & (solp < max(IDcheck$thres))]; } #### OUTPUT #### if (length(grep("FP", BM$IDcheck))==0) stop("All identifications are correct when using the best match method (no distance threshold considered). An ad hoc distance threshold for best close match identification cannot be calculated"); - THR<-(ErrProb-as.numeric(myreg$coefficient[1]))/as.numeric(myreg$coefficient[2]); - if (THR<0) stop("The estimated relative identification error (RE) cannot be reached using this reference library"); + if (Reg=="linear" && myreg$coefficients<0) stop("The estimated relative identification error (RE) cannot be reached using this reference library (check reference library or increase argument ErrProb, cf. Sonet et al. 2013)."); + THR<-(ErrProb-as.numeric(myreg$coefficients[1]))/as.numeric(myreg$coefficients[2]); + if (THR<0) stop("The estimated relative identification error (RE) cannot be reached using this reference library (check reference library or increase argument ErrProb, cf. Sonet et al. 2013)."); return(list(BM=BM,IDcheck=IDcheck, reg=myreg, ErrProb=ErrProb, THR=THR, redflagged=redflagged, redflaggedSP=redflaggedSP)); } diff -Nru adhoc-1.0/R/checkDNAbcd.R adhoc-1.1/R/checkDNAbcd.R --- adhoc-1.0/R/checkDNAbcd.R 2013-12-13 09:29:36.000000000 +0000 +++ adhoc-1.1/R/checkDNAbcd.R 2017-03-17 14:12:04.000000000 +0000 @@ -1,5 +1,5 @@ -checkDNAbcd <- -function(seq,DistModel="K80") { +#FUNCTION checkdata +checkDNAbcd<-function(seq,DistModel="K80") { mysplit<-c(); mylabels<-c(); listsp<-data.frame(); @@ -17,14 +17,37 @@ else { listsp$Nhap[[i]]<- listsp$Nseq[[i]]; } - } - DNAlength<-dim(seq)[2]-as.numeric(checkDNA(seq)); + } + mytbl<-c(); + for (j in 1:dim(seq)[1]){ + mytbl<-table(as.character(seq[j,])); + DNAlength[j]<-dim(seq)[2]-sum(mytbl[which(names(mytbl)=="-" |names(mytbl)=="?"| names(mytbl)=="N"| names(mytbl)=="N" |names(mytbl)=="_")]); + } + +#INTRA- AND INTERSPECIFIC DISTANCES dist<-dist.dna(seq,DistModel,as.matrix=TRUE,pairwise.deletion=TRUE); diag(dist)<-NA - spdist<-c(); - spdist<-sppDist(dist,paste(mylabels$genus,mylabels$species,sep="_")) + disttmp<-matrix(); + disttmp<-dist; + disttmp[upper.tri(disttmp,diag=TRUE)]<-NA; + spdist<-list(); #intra and inter + for (i in 1:length(listsp$species)){ #intraspecific dist + if (length(grep(as.character(listsp$species[i]),labels(seq)))>0) { + x<-matrix(); + x<-disttmp[grep(as.character(listsp$species[i]),labels(seq)),grep(as.character(listsp$species[i]),labels(seq))]; + spdist$intra<-c(spdist$intra,as.vector(as.numeric(x))); + spdist$intra<-na.omit(spdist$intra); + } + } + for (i in 1:length(listsp$species)){ #interspecific dist + x<-matrix(); + x<-disttmp[grep(as.character(listsp$species[i]),labels(seq)),-grep(as.character(listsp$species[i]),labels(seq))]; + spdist$inter<-c(spdist$inter,as.vector(as.numeric(x))); + spdist$inter<-na.omit(spdist$inter); + } colnames(dist)<-paste(mylabels$genus,mylabels$species,sep="_"); - write.csv(mylabels,"mylabels.csv"); - write.csv(listsp,"listsp.csv"); + write.csv(mylabels,"mylabels.csv"); + write.csv(listsp,"listsp.csv"); return(list(mylabels=mylabels, listsp=listsp, DNAlength=DNAlength, dist=dist, spdist=spdist, seq=seq)); } +