useDynLib(ape, .registration = TRUE)

export(.compressTipLabel, .PlotPhyloEnv, .uncompressTipLabel,
       "[.DNAbin", AAsubst, abbreviateGenus, ace, add.scale.bar,
       additive, alex, all.equal.DNAbin, all.equal.phylo, alview,
       arecompatible, as.AAbin, as.AAbin.character, as.alignment,
       as.bitsplits, as.bitsplits.prop.part, as.character.AAbin,
       as.character.DNAbin, as.DNAbin, as.DNAbin.alignment,
       as.DNAbin.character, as.DNAbin.list, as.evonet,
       as.evonet.phylo, as.hclust.phylo, as.igraph.evonet,
       as.igraph.phylo, as.list.AAbin, as.list.DNAbin, as.matching,
       as.matching.phylo, as.matrix.DNAbin, as.network.evonet,
       as.network.phylo, as.networx.evonet, as.phyDat.AAbin, as.phylo,
       as.phylo.evonet, as.phylo.formula, as.phylo.hclust,
       as.phylo.matching, as.phylo.phylog, as.prop.part, axisPhylo,
       balance, base.freq, bd.ext, bd.time, binaryPGLMM,
       binaryPGLMM.sim, bind.tree, bionj, bionjs, biplot.pcoa,
       birthdeath, bitsplits, boot.phylo, BOTHlabels, branching.times,
       bydir, c.DNAbin, CADM.global, CADM.post, cbind.DNAbin,
       checkAlignment, checkLabel, checkValidPhylo, cherry, chronoMPL,
       chronopl, chronos, chronos.control, circular.plot, cladewise,
       cladogram.plot, clustal, clustalomega, coalescent.intervals,
       collapse.singles, collapsed.intervals, compar.cheverud,
       compar.gee, compar.lynch, compar.ou, comparePhylo, complement,
       compute.brlen, compute.brtime, consensus, cophenetic.phylo,
       cophyloplot, corBlomberg, corBrownian, corGrafen, corMartins,
       corPagel, corphylo, correlogram.formula, countBipartitions,
       dbd, dbdTime, def, degree, del.colgapsonly, del.gaps,
       del.rowgapsonly, delta.plot, deviance.ace, di2multi,
       di2multi.multiPhylo, di2multi.phylo, dist.aa, dist.dna,
       dist.gene, dist.nodes, dist.topo, diversi.gof, diversi.time,
       diversity.contrast.test, DNAbin2indel, dnds,
       drawSupportOnEdges, drop.fossil, drop.tip, dyule, edgelabels,
       edges, editFileExtensions, estimate.dates, estimate.mu, evonet,
       ewLasso, extract.clade, extract.popsize, fancyarrows,
       fastme.bal, fastme.ols, find.skyline.epsilon, floating.pie.asp,
       Ftab, gammaStat, GC.content, getAnnotationsGenBank, getMRCA,
       has.singles, howmanytrees, image.AAbin, image.DNAbin,
       is.binary, is.binary.multiPhylo, is.binary.phylo,
       is.binary.tree, is.compatible, is.compatible.bitsplits,
       is.monophyletic, is.rooted, is.rooted.multiPhylo,
       is.rooted.phylo, is.ultrametric, is.ultrametric.multiPhylo,
       is.ultrametric.phylo, keep.tip, kronoviz, label2table,
       labels.DNAbin, ladderize, LargeNumber, latag2n, lmorigin, LTT,
       ltt.coplot, ltt.lines, ltt.plot, ltt.plot.coords,
       makeChronosCalib, makeLabel, makeLabel.character,
       makeNodeLabel, mantel.test, matexpo, mcconwaysims.test,
       mcmc.popsize, mixedFontLabel, mltt.plot, Moran.I, MPR, mrca,
       mst, multi2di, multi2di.multiPhylo, multi2di.phylo, muscle,
       mvr, mvrs, Nedge, Nedge.evonet, Nedge.multiPhylo, Nedge.phylo,
       new2old.phylo, nexus2DNAbin, nj, njs, Nnode, Nnode.multiPhylo,
       Nnode.phylo, node.depth, node.depth.edgelength, node.height,
       nodelabels, nodepath, Ntip, Ntip.multiPhylo, Ntip.phylo,
       old2new.phylo, ONEwise, SHORTwise, parafit, pcoa,
       perm.rowscols, phydataplot, phylogram.plot, phymltest, pic,
       pic.ortho, plot.evonet, plot.multiPhylo, plot.phylo,
       plotBreakLongEdges, plotPhyloCoor, plotTreeTime, polar2rect,
       postorder, postprocess.prop.part, print.AAbin, print.DNAbin,
       print.phylo, prop.clades, prop.part, rbdtree, rbind.DNAbin,
       rcoal, rDNAbin, read.caic, read.dna, read.evonet, read.FASTA,
       read.fastq, read.GenBank, read.gff, read.nexus,
       read.nexus.data, read.tree, reconstruct, rect2polar,
       reorder.evonet, reorder.multiPhylo, reorder.phylo, reorderRcpp,
       richness.yule.test, ring, rlineage, rmtree, root,
       root.multiPhylo, root.phylo, rotate, rotateConstr, rphylo,
       rmtopology, rtopology, rTraitCont, rTraitDisc, rTraitMult,
       rtree, rtt, SDM, seg.sites, skyline, skylineplot,
       skylineplot.deluxe, slowinskiguyer.test, solveAmbiguousBases,
       speciesTree, stree, stripLabel, subtreeplot, subtrees,
       summary.phylo, tcoffee, tiplabels, trans, treePop, trex,
       triangMtd, triangMtds, ultrametric, unique.multiPhylo, unroot,
       unroot.multiPhylo, unroot.phylo, unrooted.xy, updateLabel,
       varcomp, varCompPhylip, vcv, vcv.corPhyl, vcv.phylo, vcv2phylo,
       weight.taxo, weight.taxo2, where, which.edge, write.dna,
       write.evonet, write.FASTA, write.nexus, write.nexus.data,
       write.tree, Xplor, Xplorefiles, yule, yule.cov, yule.time,
       zoom, node_depth, node_depth_edgelength, node_height,
       node_height_clado, seq_root2tip)

importFrom(graphics, abline, arrows, axTicks, axis, barplot, boxplot, bxp,
           close.screen, identify, image, image.default, layout, legend,
           lines, locator, mtext, par, plot, plot.default, points, polygon,
           rect, screen, segments, split.screen, strheight, strwidth,
           symbols, text, title, xinch, yinch)
importFrom(grDevices, col2rgb, dev.cur, dev.new, dev.off, dev.set,
           devAskNewPage, deviceIsInteractive, grey, rainbow, rgb,
           topo.colors)
importFrom(lattice, xyplot, panel.lines, panel.points)
importFrom(methods, as, show)
importFrom(nlme, corMatrix, Dim, getCovariate, getCovariateFormula,
           getGroups, getGroupsFormula, gls, Initialize)
importFrom(stats, AIC, anova, as.dist, as.hclust, biplot, coef, complete.cases,
           cophenetic, cor, cor.test, cov, cov2cor, density, dgamma,
           dpois, drop1, formula, gaussian, glm, hclust, integrate,
           lm, mahalanobis, median, model.frame, model.matrix,
           model.response, na.fail, na.omit, nlm, nlminb, optim, optimize,
           p.adjust, pchisq, pf, pgamma, pnorm, ppois, printCoefmat, pt,
           qbinom, qnorm, qt, quantile, quasibinomial, rbinom, reorder, resid,
           rexp, rgamma, rnorm, runif, sd, setNames, terms, uniroot, var,
           wilcox.test)
importFrom(utils, browseURL, download.file, edit, read.table, str)
importFrom(parallel, mclapply)
importFrom(Rcpp, sourceCpp)

## Methods for the classes defined in ape, including for the generics
## defined in ape (see also below). Some methods are exported above.

S3method(is.binary, tree) # to delete when removing the function AS WELL FROM THE LIST OF EXPORTED OBJECTS ABOVE

S3method("[", AAbin)
S3method(as.character, AAbin)
S3method(as.list, AAbin)
S3method(as.matrix, AAbin)
S3method(c, AAbin)
S3method(cbind, AAbin)
S3method(image, AAbin)
S3method(labels, AAbin)
S3method(print, AAbin)
S3method(rbind, AAbin)
S3method(updateLabel, AAbin)

S3method(AIC, ace)
S3method(anova, ace)
S3method(deviance, ace)
S3method(logLik, ace)
S3method(print, ace)

S3method(print, binaryPGLMM)

S3method(as.prop.part, bitsplits)
S3method(is.compatible, bitsplits)
S3method(print, bitsplits)
S3method(sort, bitsplits)

S3method(drop1, compar.gee)
S3method(predict, compar.gee)
S3method(print, compar.gee)

S3method(print, corphylo)

S3method("[", DNAbin)
S3method(all.equal, DNAbin)
S3method(as.character, DNAbin)
S3method(as.list, DNAbin)
S3method(as.matrix, DNAbin)
S3method(c, DNAbin)
S3method(cbind, DNAbin)
S3method(image, DNAbin)
S3method(labels, DNAbin)
S3method(makeLabel, DNAbin)
S3method(print, DNAbin)
S3method(rbind, DNAbin)
S3method(updateLabel, DNAbin)

S3method(as.phylo, evonet)
S3method(degree, evonet)
S3method(Nedge, evonet)
S3method(plot, evonet)
S3method(print, evonet)
S3method(reorder, evonet)
S3method(updateLabel, evonet)

S3method("[", multiPhylo)
S3method("[<-", multiPhylo)
S3method("[[", multiPhylo)
S3method("[[<-", multiPhylo)
S3method("$", multiPhylo)
S3method("$<-", multiPhylo)
S3method(c, multiPhylo)
S3method(di2multi, multiPhylo)
S3method(is.binary, multiPhylo)
S3method(is.rooted, multiPhylo)
S3method(is.ultrametric, multiPhylo)
S3method(makeLabel, multiPhylo)
S3method(multi2di, multiPhylo)
S3method(Nedge, multiPhylo)
S3method(Nnode, multiPhylo)
S3method(Ntip, multiPhylo)
S3method(plot, multiPhylo)
S3method(print, multiPhylo)
S3method(reorder, multiPhylo)
S3method(root, multiPhylo)
S3method(str, multiPhylo)
S3method(unique, multiPhylo)
S3method(unroot, multiPhylo)

S3method("+", phylo)
S3method(all.equal, phylo)
S3method(as.hclust, phylo)
S3method(as.matching, phylo)
S3method(coalescent.intervals, phylo)
S3method(c, phylo)
S3method(cophenetic, phylo)
S3method(degree, phylo)
S3method(di2multi, phylo)
S3method(identify, phylo)
S3method(is.binary, phylo)
S3method(is.rooted, phylo)
S3method(is.ultrametric, phylo)
S3method(makeLabel, phylo)
S3method(multi2di, phylo)
S3method(Nedge, phylo)
S3method(Nnode, phylo)
S3method(Ntip, phylo)
S3method(plot, phylo)
S3method(print, phylo)
S3method(reorder, phylo)
S3method(root, phylo)
S3method(skyline, phylo)
S3method(summary, phylo)
S3method(unroot, phylo)
S3method(updateLabel, phylo)
S3method(vcv, phylo)

S3method(plot, phymltest)
S3method(print, phymltest)
S3method(summary, phymltest)

S3method(lines, popsize)
S3method(plot, popsize)

S3method(as.bitsplits, prop.part)
S3method(plot, prop.part)
S3method(print, prop.part)
S3method(summary, prop.part)

S3method(lines, skyline)
S3method(plot, skyline)

## Methods for PGLS:

## methods of coef() from stats:
S3method(coef, corBlomberg)
S3method(coef, corBrownian)
S3method(coef, corGrafen)
S3method(coef, corMartins)
S3method(coef, corPagel)

## methods to work with nlme:
S3method(corMatrix, corBlomberg)
S3method(corMatrix, corBrownian)
S3method(corMatrix, corGrafen)
S3method(corMatrix, corMartins)
S3method(corMatrix, corPagel)
S3method(Initialize, corPhyl)

## Miscellaneous classes for which there is only one method:

S3method(biplot, pcoa)

S3method(plot, correlogram)
S3method(plot, correlogramList)
S3method(plot, mst)
S3method(plot, varcomp)

S3method(print, birthdeath)
S3method(print, bitsplits)
S3method(print, chronos)
S3method(print, comparePhylo)
S3method(print, LargeNumber)
S3method(print, lmorigin)
S3method(print, parafit)

## Other methods of the generics defined in ape:

S3method(as.AAbin, AAMultipleAlignment)
S3method(as.AAbin, AAString)
S3method(as.AAbin, AAStringSet)
S3method(as.AAbin, character)
S3method(as.AAbin, list)

S3method(as.DNAbin, alignment)
S3method(as.DNAbin, character)
S3method(as.DNAbin, DNAMultipleAlignment)
S3method(as.DNAbin, DNAString)
S3method(as.DNAbin, DNAStringSet)
S3method(as.DNAbin, list)
S3method(as.DNAbin, PairwiseAlignmentsSingleSubject)

S3method(as.evonet, phylo)

S3method(as.phylo, formula)
S3method(as.phylo, hclust)
S3method(as.phylo, matching)
S3method(as.phylo, phylog)

S3method(coalescent.intervals, default)

S3method(makeLabel, character)

S3method(skyline, coalescentIntervals)
S3method(skyline, collapsedIntervals)

S3method(updateLabel, character)
S3method(updateLabel, data.frame)
S3method(updateLabel, matrix)

S3method(vcv, corPhyl)

if (getRversion() >= "3.6.0") {
    ##S3method(phangorn::as.phyDat, AAbin)
    S3method(network::as.network, phylo)
    S3method(igraph::as.igraph, phylo)
    ##S3method(phangorn::as.networx, evonet)
    S3method(network::as.network, evonet)
    S3method(igraph::as.igraph, evonet)
}
