[med-svn] [r-cran-ape] 02/05: Imported Upstream version 3.5

Dylan Aïssi bob.dybian-guest at moszumanska.debian.org
Sun Jun 12 02:52:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

bob.dybian-guest pushed a commit to branch master
in repository r-cran-ape.

commit 6ea65927aa09aec49bb3252627d45301744e5cef
Author: Dylan Aïssi <bob.dybian at gmail.com>
Date:   Fri Jun 3 00:10:14 2016 +0200

    Imported Upstream version 3.5
---
 DESCRIPTION                    |   8 +-
 MD5                            |  77 ++++-----
 NAMESPACE                      |   8 +
 R/DNA.R                        | 346 +++++++++++++++++++++++++++++++++++++++--
 R/clustal.R                    |  27 +++-
 R/dist.topo.R                  |  89 +++++------
 R/plot.phylo.R                 |  20 ++-
 R/plot.phyloExtra.R            |  30 ++++
 R/read.nexus.R                 |   2 +-
 R/root.R                       |  29 ++--
 build/vignette.rds             | Bin 194 -> 192 bytes
 data/hivtree.newick.rda        | Bin 2190 -> 2189 bytes
 data/landplants.newick.rda     | Bin 576 -> 575 bytes
 data/opsin.newick.rda          | Bin 446 -> 445 bytes
 inst/doc/MoranI.Rnw            |   2 +-
 inst/doc/MoranI.pdf            | Bin 238529 -> 238263 bytes
 man/AAbin.Rd                   | 101 ++++++++++++
 man/DNAbin.Rd                  |   2 +-
 man/DNAbin2indel.Rd            |   3 +-
 man/LTT.Rd                     |   3 +-
 man/additive.Rd                |   1 -
 man/all.equal.phylo.Rd         |   2 +-
 man/alview.Rd                  |  12 +-
 man/ape-internal.Rd            |   1 +
 man/boot.phylo.Rd              |  48 +++++-
 man/checkAlignment.Rd          |  42 +++++
 man/clustal.Rd                 |   2 +-
 man/def.Rd                     |   2 +-
 man/del.gaps.Rd                |  29 ++--
 man/dist.dna.Rd                |   6 +
 man/diversity.contrast.test.Rd |   2 +-
 man/image.DNAbin.Rd            |   3 +-
 man/makeNodeLabel.Rd           |   2 +-
 man/mcmc.popsize.Rd            |   8 +-
 man/plot.phyloExtra.Rd         |  56 +++++++
 man/read.GenBank.Rd            |   2 +-
 man/root.Rd                    |   2 +-
 man/trans.Rd                   |  52 +++++++
 man/write.nexus.data.Rd        |   4 +-
 src/ape.c                      |   6 +-
 src/dist_dna.c                 | 218 +++++++++++++++++++++++++-
 vignettes/MoranI.Rnw           |   2 +-
 42 files changed, 1074 insertions(+), 175 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 4a56a65..c23536e 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: ape
-Version: 3.4
-Date: 2015-11-29
+Version: 3.5
+Date: 2016-05-23
 Title: Analyses of Phylogenetics and Evolution
 Authors at R: c(person("Emmanuel", "Paradis", role = c("aut", "cre", "cph"), email = "Emmanuel.Paradis at ird.fr"),
   person("Simon", "Blomberg", role = c("aut", "cph")),
@@ -35,7 +35,7 @@ Description: Functions for reading, writing, plotting, and manipulating phylogen
 License: GPL (>= 2)
 URL: http://ape-package.ird.fr/
 NeedsCompilation: yes
-Packaged: 2015-11-29 08:54:16 UTC; paradis
+Packaged: 2016-05-23 07:32:24 UTC; paradis
 Author: Emmanuel Paradis [aut, cre, cph],
   Simon Blomberg [aut, cph],
   Ben Bolker [aut, cph],
@@ -62,4 +62,4 @@ Author: Emmanuel Paradis [aut, cre, cph],
   Damien de Vienne [aut, cph]
 Maintainer: Emmanuel Paradis <Emmanuel.Paradis at ird.fr>
 Repository: CRAN
-Date/Publication: 2015-11-29 19:14:31
+Date/Publication: 2016-05-24 05:38:54
diff --git a/MD5 b/MD5
index 6d06c47..3a67d27 100644
--- a/MD5
+++ b/MD5
@@ -1,12 +1,12 @@
 eb723b61539feef013de476e68b5c50a *COPYING
-57b1f36bda7714d59b4a842112555cde *DESCRIPTION
-3da79160e5c27538ff5cab02127c05a8 *NAMESPACE
+d13712c284641e2ad23e16dc3ea68ec6 *DESCRIPTION
+030bd4cdd235a95eeb7a9463793b1865 *NAMESPACE
 854a025cb7e5da3e4fe230c0be950d08 *NEWS
 0c7bc9101516fd26fb3ddbedbe25b6a3 *R/CADM.global.R
 e042efca1d8a00d4178204f5f481b64d *R/CADM.post.R
 df7599318fae6e660d57461413148967 *R/CDF.birth.death.R
 fdb9cfa0cbda82bda982b290693e44e3 *R/Cheverud.R
-f5be79ac583e238aa7f86184f9e650de *R/DNA.R
+43dc0cac925dff273611fe3530075d2a *R/DNA.R
 0fbc7715dfdc8d54ded16d78ca3100f8 *R/MPR.R
 bb95af56d882b6162aa517a77140175e *R/MoranI.R
 218b8cf3c13a700c757b7b2303dc897e *R/PGLS.R
@@ -31,7 +31,7 @@ e43b5dec7eae6d4bf9371e50117bf6ed *R/cherry.R
 02bdacc928572e8ab2d88380a075d7a8 *R/chronoMPL.R
 74e1019810b06458e808a447bb099a91 *R/chronopl.R
 8ae1af4a30c40d15676d70e180f3d593 *R/chronos.R
-452d7e2d19f9eccb3798d34e0a97e270 *R/clustal.R
+3121541e330547af3b5eb7e2ea78b6b3 *R/clustal.R
 4f52fb37d822be586f0c5971295167dc *R/coalescent.intervals.R
 c3d44d960238a711764aaeebe9570559 *R/collapse.singles.R
 338accc0accb8e67f31db5a90c033d2f *R/collapsed.intervals.R
@@ -46,7 +46,7 @@ fd39268020a494980293c92d0971caca *R/corphylo.R
 3822f0bb0a9ed4c8c19654e86ef34359 *R/def.R
 93480a5b64e0d37f5450891629557615 *R/delta.plot.R
 dfd5bb35f1cb1fd9154d023e0e4cfc2b *R/dist.gene.R
-eba6cb1e8dd0359568a46907c445351e *R/dist.topo.R
+9ed23c3cf1f576f93de0dfb725289ab1 *R/dist.topo.R
 b28ced504fedeb7f991f7eba10ad06df *R/diversi.gof.R
 8b2ec4004022afdc7e2cb42f2657b628 *R/diversi.time.R
 ea5fcbd0f207ab1d874c0d032392967d *R/drop.tip.R
@@ -82,7 +82,8 @@ fc0260f9e8e17fc1446117580bbc93cc *R/pcoa.R
 431d25db557d480985ac16bfc3d6425c *R/phydataplot.R
 e71db002c66c277bfb57f6914ca143d4 *R/phymltest.R
 61d1360195bf4d5e6e2d8c30de335dc8 *R/pic.R
-92c0db6a14b334c5777e9128c7a06f12 *R/plot.phylo.R
+7feec819ed70a21c0119d137da22c7d9 *R/plot.phylo.R
+377ed3a292afcad0773924b52444f6b4 *R/plot.phyloExtra.R
 e579ec65c808c29e1ecaae1501784b37 *R/plot.popsize.R
 736506e2f67e90cf9326abead437d298 *R/plotPhyloCoor.R
 1e2485437566ca9af99d93b4580cbbc2 *R/print.lmorigin.R
@@ -91,12 +92,12 @@ d0e8bd41d5acc217fdee3578adcf635b *R/print.parafit.R
 1895483cd4f45095860092900e0672c8 *R/read.GenBank.R
 b13dfb8f455b1c9e74a364085f72dbce *R/read.caic.R
 c1fc8ab4715f1d58145f533fbaf776e4 *R/read.dna.R
-56361b2157d0afb1050233a6ab8ee1b5 *R/read.nexus.R
+12cc225d7dbe722e9e61cd3911de0b5a *R/read.nexus.R
 13ce7f5c7d1bcb7101469d12651e99c8 *R/read.nexus.data.R
 88e633c80886f5a6c9f2b34918452d15 *R/read.tree.R
 86361682a3d477e8e63fff53dc67279e *R/reconstruct.R
 4a39f9ba8cc833bdabe7bf32d9e40651 *R/reorder.phylo.R
-1d1f46c727948c8d07f5cb7da8b0327b *R/root.R
+623e12a556b5d22e6615b1bb1205ce04 *R/root.R
 f584366b32e7414c669714ba5b84951b *R/rotate.R
 b7158b84c7ee7d9dcb2e0abeb6005cb0 *R/rtree.R
 6d359208c90e5aff93426f3c6ce39f46 *R/rtt.R
@@ -122,7 +123,7 @@ a918c086a449bcca5ccbb04f7e6d50a9 *R/yule.R
 c8d3aa3fe64e75e61af07a1b11c74f3f *R/yule.time.R
 1eb44ff9e5a036eb845faa1598ce5009 *R/zoom.R
 3387c0d0c1f913f8471e1bb34bd2e516 *R/zzz.R
-2ea9c2e09861e4e7f78e4ca935ff5079 *build/vignette.rds
+e5443aa31e5f8c448d6d3458b580b2e6 *build/vignette.rds
 db9083e8750aff839d5ebf3ed982f1f1 *data/HP.links.rda
 9d9f9232839665422709ded1e541d038 *data/bird.families.rda
 a14a6df0f3a735ebc056065077788c90 *data/bird.orders.rda
@@ -130,36 +131,37 @@ f74f9ed80c04756021cc093d40ca9ff9 *data/carnivora.csv.gz
 4eaf8cbaefa2e8f8d395a9b482ee9967 *data/chiroptera.rda
 1c74c3b99d08b0e17eea3ec1065c12d2 *data/cynipids.rda
 7fe760c2f3b4deba0554aae6138cb602 *data/gopher.D.rda
-b188e7bd92e1630728de2d7df20892e2 *data/hivtree.newick.rda
+3a0678a086d0d8ff8c1a722fd7baac19 *data/hivtree.newick.rda
 8d14f95319d0a5cdc8faa60a1d0085ce *data/hivtree.table.txt.gz
-4e20263989bfa454171269174966162e *data/landplants.newick.rda
+41e2b0f8336384bf030aca421c987d0f *data/landplants.newick.rda
 31be81fe3faca11f98d3e74c090bc59e *data/lice.D.rda
 38edbd84a0a067322c40db8d71fb1289 *data/lmorigin.ex1.rda
 e3ce9e3444182fea2e65df2e150ea0db *data/lmorigin.ex2.rda
 ce7a56faebdf286fdf5ba6c8c3699a79 *data/mat3.RData
 e2d1339025ed901009bfed58dc6505ff *data/mat5M3ID.RData
 101d0ab2e981b0987cde704a2dee1d8d *data/mat5Mrand.RData
-95cef0772cc4b7eb2203317468659102 *data/opsin.newick.rda
+68e738ac2bee2dd81f65bc1d138e25f4 *data/opsin.newick.rda
 39e4fece2bdc527d7a9d4d83d023a947 *data/woodmouse.rda
 828290996b613493f96e0fab024beebb *inst/CITATION
 3f54f3775bcf382e25df2a12228894f6 *inst/doc/MoranI.R
-abf2e3e84707634e32f3e7cc6a5ee7ae *inst/doc/MoranI.Rnw
-946e0a4afd6cc366bfa269f2b9116464 *inst/doc/MoranI.pdf
+2277b0efdb2f70dfdc5df8278702c6b6 *inst/doc/MoranI.Rnw
+a5c7aca72eeb81a034cebbc363457a5f *inst/doc/MoranI.pdf
+e6b3b19323b56c8e10cffc858b3af117 *man/AAbin.Rd
 e6876b193a0df06697c788a8e48cf4bc *man/CADM.global.Rd
-b79f29b6efb97d7d4cb5408810a23893 *man/DNAbin.Rd
-4bf4cce57153ff6b1728d9bb2b49fd2e *man/DNAbin2indel.Rd
+dfa15a3e3bb57c9b21a30b8d5d790c62 *man/DNAbin.Rd
+d94f358593695b1713840df5a8c000ba *man/DNAbin2indel.Rd
 8b9bc214e32cde4c6e5970e48ff30c5f *man/Initialize.corPhyl.Rd
-c81533f37d8e6d9b8b1ca8a9118608e9 *man/LTT.Rd
+4ed78ca9d87b32808b064e0ecd6756cb *man/LTT.Rd
 ff05fd6fa0a2750b53abf025cdc021d3 *man/MPR.Rd
 303135aa8664be5cb518e0cbf2018b2c *man/MoranI.Rd
 17486c0fd29fb6f4a752c53fe37142c4 *man/SDM.Rd
 b4b2d3c708bf1ebca6f1f3b4cb752243 *man/ace.Rd
 60adac0f324c7b08a756d8f45c02b024 *man/add.scale.bar.Rd
-32d8ad6eeea971901aee33f1f654ae7c *man/additive.Rd
+0d68dd79c42bad2f3a68635ba75a59b0 *man/additive.Rd
 25a2859708b9a281a0d682e4376f3f53 *man/alex.Rd
-179ad4f32184a21ebd65564c41d0d02e *man/all.equal.phylo.Rd
-f8fc170ab95008fc9bbcba0a85889e64 *man/alview.Rd
-e02eb0f3c7ff30ae3e085e7a27f5397a *man/ape-internal.Rd
+f0b85d459edb5ead2e6d39a86cbb350c *man/all.equal.phylo.Rd
+c987c7b1cf09a272a6ce77eb3e9554dc *man/alview.Rd
+51a4ced7c3c2533b34887117e566c46f *man/ape-internal.Rd
 587cbd9d9a326b3990ed20bfe5016165 *man/ape-package.Rd
 5bba4ae4bfc66b613855cfc182d9b1bc *man/as.alignment.Rd
 2771f272ad46b279022892d9f5d21eb2 *man/as.bitsplits.Rd
@@ -177,17 +179,18 @@ f929bc1b6391c57a6b0099c4561fd7be *man/binaryPGLMM.Rd
 71a008cfe65c4f524a5b66e68bbf81ab *man/bird.families.Rd
 0e41770e1e6d0b8d90c4cf51049213cb *man/bird.orders.Rd
 ef1c15d5d93410c21179997431112209 *man/birthdeath.Rd
-428a6f9e08291416b6b96d945d734aac *man/boot.phylo.Rd
+22fbad77d4728f10b2e117e2c6a53efe *man/boot.phylo.Rd
 5a64b90d3a6c7a8204946b00f45f4cfc *man/branching.times.Rd
 7dad9d632d914de8122f2455f0762546 *man/c.phylo.Rd
 9d3f9614732671a610cc8a37454885e2 *man/carnivora.Rd
+7c4994dab4cfa672ad54e945011fa560 *man/checkAlignment.Rd
 5ff8c7e8fad519d978f166948c03059c *man/checkValidPhylo.Rd
 64c3996ca6bcc97d0d2e2cf3361f8f71 *man/cherry.Rd
 f82a24dc4bb17b5675ec7b422d575587 *man/chiroptera.Rd
 b40dd77fd2529626e983ee0300be6781 *man/chronoMPL.Rd
 c1f01c6200b2f1e2901d45d40daae404 *man/chronopl.Rd
 506d0332fb092ab87ca7674faef63ab7 *man/chronos.Rd
-63d84f7fa6540b7a17e980f346861d6f *man/clustal.Rd
+61a3ac5c65d72509d2ef3fcb56507f30 *man/clustal.Rd
 866af6e8d769b3d6972ef8e1ac849a12 *man/coalescent.intervals.Rd
 18c77b4104aa22d3e6cb88339f2eff90 *man/collapse.singles.Rd
 bff5a7826f5a39767601e32ceb776247 *man/collapsed.intervals.Rd
@@ -210,15 +213,15 @@ e259ee771509883d3afe8eafd41e9cb1 *man/corphylo.Rd
 d7eb9b4fdf7036e82b5964bfd85e5e36 *man/correlogram.formula.Rd
 c199605f9d353b303acad4896f9b39a5 *man/cynipids.Rd
 34164e368efd0d5d961fe62e9ede75e8 *man/dbd.Rd
-006b1175da065de114ad006fe1e581d5 *man/def.Rd
-f4e8a12b122ff902a1bce3ec49e17da6 *man/del.gaps.Rd
+c0763a70c4965a6b03df3e5be68e450d *man/def.Rd
+95621da51b61fe6a551369222015192f *man/del.gaps.Rd
 fbcd1d4bcf74e21fc93c195c7af3db98 *man/delta.plot.Rd
-e9a4068c29af95a6c2474192b3e1af1b *man/dist.dna.Rd
+d4c1853e139f84101de2b9309823f366 *man/dist.dna.Rd
 38011e81d28a120d88eead09e62c154a *man/dist.gene.Rd
 e813d96ce8d458a535fffbb072701300 *man/dist.topo.Rd
 c7cc398115be066740ca4fb037394727 *man/diversi.gof.Rd
 d646ea0343999bd0e38e86dcf6c12018 *man/diversi.time.Rd
-0003bd93b9418ba7a7a4f89faf2f7338 *man/diversity.contrast.test.Rd
+da8898476bb15b627b34ee1093b9aeb4 *man/diversity.contrast.test.Rd
 55ed69cf42cb2fb768467870ef5e4c99 *man/drop.tip.Rd
 6ae02a689abea279f7e6650678aa7ae2 *man/edges.Rd
 7ad398603675bd4e0e1c5f5eeb1105bc *man/evonet.Rd
@@ -228,7 +231,7 @@ eea313e8ee32597b4cec120d23113642 *man/gammaStat.Rd
 3991fa7864e326579f1ab8b671095e4b *man/hivtree.Rd
 18012643a904f657fc5f5896f3d14054 *man/howmanytrees.Rd
 86c49d080fdffd614d8056021e91cc55 *man/identify.phylo.Rd
-0d49b03a4a0fb96add881f4d0f8d6ae8 *man/image.DNAbin.Rd
+5edaf778ad69fe8c9984bf3817a86a88 *man/image.DNAbin.Rd
 9957425ef61231ba72538e771c6565b5 *man/is.binary.tree.Rd
 80a5a228a43679edf75903590253a875 *man/is.compatible.Rd
 d2de8fd9549ef01a1dddeb726dd77fcf *man/is.monophyletic.Rd
@@ -240,14 +243,14 @@ d2de8fd9549ef01a1dddeb726dd77fcf *man/is.monophyletic.Rd
 4b86460e4e5d993abf13c99b9744dbd6 *man/lmorigin.Rd
 21bb31db5bcc8d8650467ef73fe0c0d3 *man/ltt.plot.Rd
 7ca1aeffd0cd8106e00d0ee1952b5ccb *man/makeLabel.Rd
-376a9b2d1653806bbef6c4e53db16fab *man/makeNodeLabel.Rd
+491c376d22c2f05443840b3835dc6e25 *man/makeNodeLabel.Rd
 817b23b342fe170de6500d13d9f54c82 *man/mantel.test.Rd
 97cf5ddb9352b0545ed225d16d750ffb *man/mat3.Rd
 f56f6f49c89c6bc850a7aee1bce5e0bd *man/mat5M3ID.Rd
 0d8eb60696c80de3cc9cc85ba66373a5 *man/mat5Mrand.Rd
 69ae0cb181240bb8ec168e69f1ba44bb *man/matexpo.Rd
 a8b9d6b04d35d75f43d1b283361a1642 *man/mcconwaysims.test.Rd
-d47c22d9e889ae5c878940c41c59d31f *man/mcmc.popsize.Rd
+8c3dfdb6c70caee1051b1e576e3eaa74 *man/mcmc.popsize.Rd
 c1d52335ab9d9ccac265c06c9fae019c *man/mixedFontLabel.Rd
 dbcdc231c2f1f221818307bb33486159 *man/mrca.Rd
 5c88230ad597ea9fe41536a8321c326b *man/mst.Rd
@@ -268,12 +271,13 @@ c2e2f35f4e233265c86b7967ec2d0630 *man/parafit.Rd
 0363aa3fa3e86160934e2359c8ac5323 *man/pic.ortho.Rd
 265527313d479d3625df7680c7479cd1 *man/plot.correlogram.Rd
 d23d21863b2dffa5388f3fc128368af4 *man/plot.phylo.Rd
+a66c2f038b7657e5d619dee5ee9ed9ba *man/plot.phyloExtra.Rd
 6bb1cf751772b9b6acf560b5f3c6f3c1 *man/plot.varcomp.Rd
 b24438c42cea969302ec6ba61002426e *man/print.phylo.Rd
 80bf68fd21b5e665329cf30b10a1655f *man/rTraitCont.Rd
 59e81eaae91dc77b4275c9a5b2910dda *man/rTraitDisc.Rd
 81f756fdf2ec4c968095595dece8338f *man/rTraitMult.Rd
-71b55f1d67b63610555f316ac454fb58 *man/read.GenBank.Rd
+38877ac887281607cb0a1bcd6325f983 *man/read.GenBank.Rd
 9e31bccfa08c1d2da2180cd8f50ab250 *man/read.caic.Rd
 0c91321b05d51c501e0f5c51de78538c *man/read.dna.Rd
 5c9aed0b6f0a7e0f0fac9b5a59ac732f *man/read.nexus.Rd
@@ -283,7 +287,7 @@ bc02e36c51d67074e661468993ed359b *man/read.nexus.data.Rd
 61e0bc86ae5a1f04ee6e88cdc92a2089 *man/reorder.phylo.Rd
 af19f262b468dfd7c12448d9d8085331 *man/richness.yule.test.Rd
 3afe25cebe4628e4844e41aad512d6e4 *man/rlineage.Rd
-bb3a58966e6d9d72a4b885bbe9fb935f *man/root.Rd
+0f62fb19db3810dfc66da173fec46104 *man/root.Rd
 6b97ea2fd96bf948fca764deab3a6e76 *man/rotate.Rd
 1a7314ee0aa76712737e76162df6cc74 *man/rtree.Rd
 e53b4b3f7e009289c628e16143b3e8b4 *man/rtt.Rd
@@ -296,6 +300,7 @@ a0db170675b1c265f1f4e7d56e88d7cb *man/speciesTree.Rd
 1f1309e2ec6327974952d546241a6024 *man/subtreeplot.Rd
 ef8aa9721275f20ddd38612cddf8300c *man/subtrees.Rd
 0091fcdcb4aa48aa364da2512545f6c1 *man/summary.phylo.Rd
+18eb8ab87509076b49c50cd86b231cf7 *man/trans.Rd
 3340a4f09c55010c15c0149a20b41c99 *man/treePop.Rd
 7749863f505076f2288c106eb465805e *man/trex.Rd
 dbb269e680caf8c722cf53c9b5ce7ace *man/triangMtd.Rd
@@ -310,7 +315,7 @@ ef9658f5343bdcbfc3673c7f936934f5 *man/which.edge.Rd
 9b83a148295dcfcb3994fdb6eaab0174 *man/woodmouse.Rd
 f613518d0ecd88b4a80c779b0453ad7f *man/write.dna.Rd
 b9fe1836be61c56a521386b00021fa67 *man/write.nexus.Rd
-80e6bcbf556ad15770c7157aef3d28d8 *man/write.nexus.data.Rd
+bf9417a54722e3185ece06cf01b5e899 *man/write.nexus.data.Rd
 b2302d65196726ab4cc573a22ee2d8e3 *man/write.tree.Rd
 2568c6529e40fae7effe88b6c73998a1 *man/yule.Rd
 7df89ac6996c82b52c4c9b3734807de1 *man/yule.cov.Rd
@@ -322,14 +327,14 @@ a00006ae345bb9379312e81694de3885 *man/zoom.Rd
 122ba51b574f7f7acd5ea4b6256cea5f *src/SPR.c
 d11fb19958f2953583a9c5876da82df9 *src/TBR.c
 9733c82cd67c4bd41aea44981f4ac8b8 *src/additive.c
-fff638ac2fab946388330ec67cba990d *src/ape.c
+91ee394e252f7eec643d899f60ac4b76 *src/ape.c
 7eaffd3d85df9a1e4460905e9ca5eced *src/ape.h
 19b564aab62c464c092cdf2f0d5cf447 *src/bNNI.c
 79ca5c473decf13964192524caebf9f1 *src/bionjs.c
 f782a97466ed8008d31afd7a3e9d4ea9 *src/bipartition.c
 a5d4f692aca36f6b50e123b443792fa1 *src/bitsplits.c
 81e4ad60b418966cdd09e608e074bb28 *src/delta_plot.c
-97d837be6e2d862a26a8028d4a56af4b *src/dist_dna.c
+58108a4ba25655f5b5101ebdfea78d1e *src/dist_dna.c
 2a6a59a3a220eb855a3c48bc73dc54ba *src/dist_nodes.c
 005ab69356525fbbc1b69950341308c2 *src/ewLasso.c
 afa27403972145d083d7f7f8b2536b98 *src/heap.c
@@ -353,5 +358,5 @@ d7d48424f600f5dad372a8c3ccfbbcad *src/treePop.c
 5937b5ba96d2ff5615badf55dff9ed5a *src/triangMtd.c
 ace51cbbe1e728d1e94e78ca99a6d019 *src/triangMtds.c
 72e04107c752568641219bf57b5731a8 *src/ultrametric.c
-abf2e3e84707634e32f3e7cc6a5ee7ae *vignettes/MoranI.Rnw
+2277b0efdb2f70dfdc5df8278702c6b6 *vignettes/MoranI.Rnw
 70d5ed89ae0c78af85e1309702679087 *vignettes/ape.bib
diff --git a/NAMESPACE b/NAMESPACE
index a752a53..1b635ff 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -28,6 +28,12 @@ importFrom(utils, download.file, read.table, setTxtProgressBar, str,
 ## Methods for the classes defined in ape, including for the generics
 ## defined in ape (see also below). Some methods are exported above.
 
+S3method("[", AAbin)
+S3method(as.character, AAbin)
+S3method(image, AAbin)
+S3method(labels, AAbin)
+S3method(print, AAbin)
+
 S3method(AIC, ace)
 S3method(anova, ace)
 S3method(deviance, ace)
@@ -141,6 +147,8 @@ S3method(print, parafit)
 
 ## Other methods of the generics defined in ape:
 
+S3method(as.AAbin, character)
+
 S3method(as.DNAbin, alignment)
 S3method(as.DNAbin, character)
 S3method(as.DNAbin, DNAMultipleAlignment)
diff --git a/R/DNA.R b/R/DNA.R
index 0217c28..15367d5 100644
--- a/R/DNA.R
+++ b/R/DNA.R
@@ -1,8 +1,8 @@
-## DNA.R (2015-11-18)
+## DNA.R (2016-02-18)
 
-##   Manipulations and Comparisons of DNA Sequences
+##   Manipulations and Comparisons of DNA and AA Sequences
 
-## Copyright 2002-2015 Emmanuel Paradis, 2015 Klaus Schliep
+## Copyright 2002-2016 Emmanuel Paradis, 2015 Klaus Schliep
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -48,13 +48,26 @@ del.gaps <- function(x)
     x
 }
 
-del.colgapsonly <- function(x)
+del.rowgapsonly <- function(x, threshold = 1, freq.only = FALSE)
 {
     if (!inherits(x, "DNAbin")) x <- as.DNAbin(x)
-    if (!is.matrix(x))
-        stop("DNA sequences not in a matrix")
-    foo <- function(x) all(x == 4)
-    i <- which(apply(x, 2, foo))
+    if (!is.matrix(x)) stop("DNA sequences not in a matrix")
+    foo <- function(x) sum(x == 4)
+    g <- apply(x, 1, foo)
+    if (freq.only) return(g)
+    i <- which(g / ncol(x) >= threshold)
+    if (length(i)) x <- x[-i, ]
+    x
+}
+
+del.colgapsonly <- function(x, threshold = 1, freq.only = FALSE)
+{
+    if (!inherits(x, "DNAbin")) x <- as.DNAbin(x)
+    if (!is.matrix(x)) stop("DNA sequences not in a matrix")
+    foo <- function(x) sum(x == 4)
+    g <- apply(x, 2, foo)
+    if (freq.only) return(g)
+    i <- which(g / nrow(x) >= threshold)
     if (length(i)) x <- x[, -i]
     x
 }
@@ -257,7 +270,7 @@ as.DNAbin <- function(x, ...) UseMethod("as.DNAbin")
 ## by Klaus:
 as.DNAbin.character <- function(x, ...)
 {
-    ans <- as.raw(._bs_)[match(x, ._cs_)]
+    ans <- as.raw(._bs_)[match(tolower(x), ._cs_)]
     if (is.matrix(x)) {
         dim(ans) <- dim(x)
         dimnames(ans) <- dimnames(x)
@@ -558,3 +571,318 @@ as.DNAbin.DNAMultipleAlignment <- function(x, ...) .DNAAlignment2DNAbinMatrix(x)
 ## setAs("DNAStringSet", "DNAbin", .DNAStringSet2DNAbin)
 ## setAs("PairwiseAlignmentsSingleSubject", "DNAbin", .DNAAlignment2DNAbinMatrix)
 ## setAs("DNAMultipleAlignment", "DNAbin", .DNAAlignment2DNAbinMatrix)
+
+complement <- function(x)
+{
+    f <- function(x) {
+        ## reorder the vector of raws to match the complement:
+        comp <- as.raw(._bs_[c(4:1, 10:9, 7:8, 6:5, 14:11, 15:17)])
+        ans <- comp[match(as.integer(x), ._bs_)]
+        rev(ans) # reverse before returning
+    }
+    if (is.matrix(x)) {
+        for (i in 1:nrow(x)) x[i, ] <- f(x[i, ])
+        return(x)
+    } else if (is.list(x)) {
+        x <- lapply(x, f)
+    } else x <- f(x)
+    class(x) <- "DNAbin"
+    x
+}
+
+trans <- function(x, code = 1, codonstart = 1)
+{
+    f <- function(x, s, code)
+        .C(trans_DNA2AA, x, as.integer(s), raw(s/3), as.integer(code),
+           NAOK = TRUE)[[3]]
+    if (code > 2)
+        stop("only the standard and the vertebrate mitochondrial codes are available for now")
+
+    if (codonstart > 1) {
+        del <- -(1:(codonstart - 1))
+        if (is.list(x)) {
+            for (i in seq_along(x)) x[[i]] <- x[[i]][del]
+        } else {
+            x <- if (is.matrix(x)) x[, del] else x[del]
+        }
+    }
+
+    if (is.list(x)) {
+        res <- lapply(x, trans, code = code)
+    } else {
+        s <- if (is.matrix(x)) ncol(x) else length(x)
+        rest <- s %% 3
+        if (rest != 0) {
+            s <- s - rest
+            x <- if (is.matrix(x)) x[, 1:s] else x[1:s]
+            msg <- paste("sequence length not a multiple of 3:", rest, "nucleotide")
+            if (rest == 2) msg <- paste0(msg, "s")
+            warning(paste(msg, "dropped"))
+        }
+        res <- if (is.matrix(x)) t(apply(x, 1, f, s = s, code = code)) else f(x, s, code)
+    }
+    class(res) <- "AAbin"
+    res
+}
+
+print.AAbin <- function(x, ...)
+{
+    if (is.list(x)) {
+        n <- length(x)
+        cat(n, "amino acid sequence")
+        if (n > 1) cat("s")
+        cat(" in a list\n\n")
+        tmp <- unlist(lapply(x, length))
+        maxi <- max(tmp)
+        mini <- min(tmp)
+        if (mini == maxi)
+            cat("All sequences of the same length:", maxi, "\n")
+        else {
+            cat("Mean sequence length:", round(mean(tmp), 3),
+                "\n   Shortest sequence:", mini,
+                "\n    Longest sequence:", maxi, "\n")
+        }
+    } else if (is.matrix(x)) {
+        n <- nrow(x)
+        cat(n, "amino acid sequence")
+        if (n > 1) cat("s")
+        cat(" in a matrix\n")
+        if (n == 1) cat("Sequence length: ")
+        else cat("All sequences of the same length: ")
+        cat(ncol(x), "\n")
+    } else {
+        cat("1 amino acid sequence in a vector:\n\n",
+            rawToChar(x))
+    }
+    cat("\n")
+}
+
+"[.AAbin" <- function (x, i, j, drop = FALSE)
+{
+    ans <- NextMethod("[", drop = drop)
+    class(ans) <- "AAbin"
+    ans
+}
+
+as.character.AAbin <- function(x, ...)
+{
+    f <- function(x) strsplit(rawToChar(x), "")[[1]]
+    if (is.list(x)) return(lapply(x, f))
+    if (is.matrix(x)) return(apply(t(x), 1, f))
+    f(x)
+}
+
+as.AAbin <- function(x, ...) UseMethod("as.AAbin")
+
+as.AAbin.character <- function(x, ...)
+{
+    f <- function(x) charToRaw(paste(x, collapse = ""))
+    res <- if (is.vector(x)) f(x) else t(apply(x, 1, f))
+    class(res) <- "AAbin"
+    res
+}
+
+labels.AAbin <- function(object, ...) labels.DNAbin(object, ...)
+
+if (getRversion() >= "2.15.1") utils::globalVariables("phyDat")
+as.phyDat.AAbin <- function(x, ...) phyDat(as.character(x), type = "AA")
+
+dist.aa <- function(x, pairwise.deletion = FALSE, scaled = FALSE)
+{
+    n <- nrow(x)
+    d <- numeric(n*(n - 1)/2)
+    X <- charToRaw("X")
+    k <- 0L
+    if (!pairwise.deletion) {
+        del <- apply(x, 2, function(y) any(y == X))
+        if (any(del)) x <- x[, !del]
+        for (i in 1:(n - 1)) {
+            for (j in (i + 1):n) {
+                k <- k + 1L
+                d[k] <- sum(x[i, ] != x[j, ])
+            }
+        }
+        if (scaled) d <- d/ncol(x)
+    } else {
+        for (i in 1:(n - 1)) {
+            a <- x[i, ]
+            for (j in (i + 1):n) {
+                b <- x[j, ]
+                del <- a == X | b == X
+                p <- length(b <- b[!del])
+                tmp <- sum(a[!del] != b)
+                k <- k + 1L
+                d[k] <- if (scaled) tmp else tmp/p
+            }
+        }
+    }
+    attr(d, "Size") <- n
+    attr(d, "Labels") <- rownames(x)
+    attr(d, "Diag") <- attr(d, "Upper") <- FALSE
+    attr(d, "call") <- match.call()
+    class(d) <- "dist"
+    d
+}
+
+AAsubst <- function(x)
+{
+    X <- charToRaw("X")
+    f <- function(y) length(unique.default(y[y != X]))
+    which(apply(x, 2, f) > 1)
+}
+
+.AA_3letter <- c("Ala", "Cys", "Asp", "Glu", "Phe", "Gly", "His", "Ile",  "Lys", "Leu",
+                 "Met", "Asn", "Pro", "Gln", "Arg", "Ser", "Thr",  "Val", "Trp", "Tyr",
+                 "Xaa", "Stp")
+
+.AA_1letter <- c("A", "C", "D", "E", "F", "G", "H", "I", "K", "L",
+                 "M", "N", "P", "Q", "R", "S", "T", "V", "W", "Y", "X", "*")
+
+.AA_raw <- sapply(.AA_1letter, charToRaw)
+
+.AA_3cat <- list(Hydrophobic = .AA_raw[c("V", "I", "L", "F", "W", "Y", "M")],
+                 Small = .AA_raw[c("P", "G", "A", "C")],
+                 Hydrophilic = .AA_raw[c("S", "T", "H", "N", "Q", "D", "E", "K", "R")])
+
+image.AAbin <- function(x, what, col, bg = "white", xlab = "", ylab = "",
+                        show.labels = TRUE, cex.lab = 1, legend = TRUE, ...)
+{
+    if (missing(what))
+        what <- c("Hydrophobic", "Small", "Hydrophilic")
+    if (missing(col)) col <- c("red", "yellow", "blue")
+    n <- (dx <- dim(x))[1]
+    s <- dx[2]
+    y <- integer(N <- length(x))
+    ncl <- length(what)
+    col <- rep(col, length.out = ncl)
+    brks <- 0.5:(ncl + 0.5)
+    sm <- 0L
+    for (i in ncl:1) {
+        k <- .AA_3cat[[i]]
+        sel <- which(x %in% k)
+        if (L <- length(sel)) {
+            y[sel] <- i
+            sm <- sm + L
+        }
+        else {
+            what <- what[-i]
+            col <- col[-i]
+            brks <- brks[-i]
+        }
+    }
+    dim(y) <- dx
+    if (sm == N) {
+        leg.co <- co <- col
+        leg.txt <- what
+    }
+    else {
+        co <- c(bg, col)
+        leg.txt <- c(what, "Unknown")
+        leg.co <- c(col, bg)
+        brks <- c(-0.5, brks)
+    }
+    yaxt <- if (show.labels) "n" else "s"
+    image.default(1:s, 1:n, t(y), col = co, xlab = xlab, ylab = ylab,
+                  yaxt = yaxt, breaks = brks, ...)
+    if (show.labels)
+        mtext(rownames(x), side = 2, line = 0.1, at = 1:n, cex = cex.lab,
+              adj = 1, las = 1)
+    if (legend) {
+        psr <- par("usr")
+        xx <- psr[2]/2
+        yy <- psr[4] * (0.5 + 0.5/par("plt")[4])
+        legend(xx, yy, legend = leg.txt, pch = 22, pt.bg = leg.co,
+               pt.cex = 2, bty = "n", xjust = 0.5, yjust = 0.5,
+               horiz = TRUE, xpd = TRUE)
+    }
+}
+
+checkAlignment <- function(x, check.gaps = TRUE, plot = TRUE, what = 1:4)
+{
+    cat("\nNumber of sequences:", n <- nrow(x),
+        "\nNumber of sites:", s <- ncol(x), "\n")
+if (check.gaps) {
+    cat("\n")
+    y <- DNAbin2indel(x)
+    gap.length <- sort(unique.default(y))[-1]
+    if (!length(gap.length)) cat("No gap in alignment.\n")
+    else {
+        rest <- gap.length %% 3
+        if (any(cond <- rest > 0)) {
+            cat("Some gap length are not multiple of 3:", gap.length[cond])
+        } else cat("All gap lengths are multiple of 3.")
+
+        tab <- tabulate(y, gap.length[length(gap.length)])
+        tab <- tab[gap.length]
+        cat("\n\nFrequencies of gap lengths:\n")
+        names(tab) <- gap.length
+        print(tab)
+
+        ## find base segments:
+        A <- B <- numeric()
+        for (i in seq_len(n)) {
+            j <- which(y[i, ] != 0) # j: start of each gap in the i-th sequence
+            if (!length(j)) next
+            k <- j + y[i, j] # k: start of each base segment in the i-th sequence
+            if (j[1] != 1) k <- c(1, k) else j <- j[-1]
+            if (k[length(k)] > s) k <- k[-length(k)] else j <- c(j, s)
+            A <- c(A, j)
+            B <- c(B, k)
+        }
+        AB <- unique(cbind(A, B))
+        not.multiple.of.3 <- (AB[, 1] - AB[, 2]) %% 3 != 0
+        left.border <- AB[, 2] == 1
+        right.border <- AB[, 1] == s
+        Nnot.mult3 <- sum(not.multiple.of.3)
+        cat("\nNumber of unique contiguous base segments:", nrow(AB), "\n")
+        if (!Nnot.mult3) cat("All segment lengths multiple of 3")
+        else {
+            Nleft <- sum(not.multiple.of.3 & left.border)
+            Nright <- sum(not.multiple.of.3 & right.border)
+            cat("Number of segment lengths not multiple of 3:", Nnot.mult3, "\n",
+                "   => on the left border of the alignement:", Nleft, "\n",
+                "   => on the right border                 :", Nright, "\n")
+            if (Nright + Nleft < Nnot.mult3) {
+                cat("    => positions of these segments inside the alignment: ")
+                sel <- not.multiple.of.3 & !left.border & !right.border
+                cat(paste(AB[sel, 2], AB[sel, 1] - 1, sep = "--"), "\n")
+            }
+        }
+    }
+} else gap.length <- numeric()
+    ss <- seg.sites(x)
+    cat("\nNumber of segregating sites (including gaps):", length(ss))
+    BF.col <- matrix(NA_real_, length(ss), 4)
+    for (i in seq_along(ss))
+        BF.col[i, ] <- base.freq(x[, ss[i]])#, freq = TRUE)
+    tmp <- apply(BF.col, 1, function(x) sum(x > 0))
+    cat("\nNumber of sites with at least one substitution:", sum(tmp > 1))
+    cat("\nNumber of sites with 1, 2, 3 or 4 observed bases:\n")
+    tab2 <- tabulate(tmp, 4L)
+    tab2[1] <- s - sum(tab2)
+    names(tab2) <- 1:4
+    print(tab2)
+    cat("\n")
+    H <- numeric(s)
+    H[ss] <- apply(BF.col, 1, function(x) {x <- x[x > 0]; -sum(x * log(x))})
+
+    G <- rep(1, s)
+    G[ss] <- tmp
+    if (plot) {
+        if (length(what) == 4) {
+            mat <- if (length(gap.length)) 1:4 else c(1, 0, 2, 3)
+            layout(matrix(mat, 2, 2))
+        } else {
+            if (length(what) != 1) {
+                what <- what[1]
+                warning("argument 'what' has length > 1: the first value is taken")
+            }
+        }
+        if (1 %in% what) image(x)
+        if (2 %in% what && length(gap.length)) barplot(tab, xlab = "Gap length")
+        if (3 %in% what)
+            plot(1:s, H, "h", xlab = "Sequence position", ylab = "Shannon index (H)")
+        if (4 %in% what)
+            plot(1:s, G, "h", xlab = "Sequence position", ylab = "Number of observed bases")
+    }
+}
diff --git a/R/clustal.R b/R/clustal.R
index 8125e52..02a9a0a 100644
--- a/R/clustal.R
+++ b/R/clustal.R
@@ -1,8 +1,8 @@
-## clustal.R (2015-07-06)
+## clustal.R (2016-01-26)
 
 ##   Multiple Sequence Alignment with External Applications
 
-## Copyright 2011-2015 Emmanuel Paradis
+## Copyright 2011-2016 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -20,6 +20,10 @@ clustalomega <- function(x, exec = NULL, MoreArgs = "", quiet = TRUE)
         return(invisible(NULL))
     }
 
+    x <- as.list(x)
+    labels.bak <- names(x)
+    names(x) <- paste0("Id", 1:length(x))
+
     d <- tempdir()
     inf <- paste(d, "input_clustalo.fas", sep = "/")
     outf <- paste(d, "output_clustalo.fas", sep = "/")
@@ -28,7 +32,9 @@ clustalomega <- function(x, exec = NULL, MoreArgs = "", quiet = TRUE)
     if (!quiet) opts <- paste(opts, "-v")
     opts <- paste(opts, MoreArgs)
     system(paste(exec, opts), ignore.stdout = quiet)
-    read.dna(outf, "fasta")
+    res <- read.dna(outf, "fasta")
+    rownames(res) <- labels.bak
+    res
 }
 
 clustal <- function(x, pw.gapopen = 10, pw.gapext = 0.1,
@@ -46,6 +52,10 @@ clustal <- function(x, pw.gapopen = 10, pw.gapext = 0.1,
         return(invisible(NULL))
     }
 
+    x <- as.list(x)
+    labels.bak <- names(x)
+    names(x) <- paste0("Id", 1:length(x))
+
     d <- tempdir()
     inf <- paste(d, "input_clustal.fas", sep = "/")
     outf <- paste(d, "input_clustal.aln", sep = "/")
@@ -57,6 +67,7 @@ clustal <- function(x, pw.gapopen = 10, pw.gapext = 0.1,
     system(paste(exec, opts), ignore.stdout = quiet)
     res <- read.dna(outf, "clustal")
     if (original.ordering) res <- res[labels(x), ]
+    rownames(res) <- labels.bak
     res
 }
 
@@ -67,6 +78,10 @@ muscle <- function(x, exec = "muscle", MoreArgs = "", quiet = TRUE, original.ord
         return(invisible(NULL))
     }
 
+    x <- as.list(x)
+    labels.bak <- names(x)
+    names(x) <- paste0("Id", 1:length(x))
+
     d <- tempdir()
     inf <- paste(d, "input_muscle.fas", sep = "/")
     outf <- paste(d, "output_muscle.fas", sep = "/")
@@ -77,6 +92,7 @@ muscle <- function(x, exec = "muscle", MoreArgs = "", quiet = TRUE, original.ord
     system(paste(exec, opts))
     res <- read.dna(outf, "fasta")
     if (original.ordering) res <- res[labels(x), ]
+    rownames(res) <- labels.bak
     res
 }
 
@@ -87,6 +103,10 @@ tcoffee <- function(x, exec = "t_coffee", MoreArgs = "", quiet = TRUE, original.
         return(invisible(NULL))
     }
 
+    x <- as.list(x)
+    labels.bak <- names(x)
+    names(x) <- paste0("Id", 1:length(x))
+
     d <- tempdir()
     od <- setwd(d)
     on.exit(setwd(od))
@@ -97,5 +117,6 @@ tcoffee <- function(x, exec = "t_coffee", MoreArgs = "", quiet = TRUE, original.
     system(paste(exec, opts))
     res <- read.dna("input_tcoffee.aln", "clustal")
     if (original.ordering) res <- res[labels(x), ]
+    rownames(res) <- labels.bak
     res
 }
diff --git a/R/dist.topo.R b/R/dist.topo.R
index b50c70d..b9c8c6f 100644
--- a/R/dist.topo.R
+++ b/R/dist.topo.R
@@ -1,9 +1,9 @@
-## dist.topo.R (2015-04-24)
+## dist.topo.R (2016-03-23)
 
 ##      Topological Distances, Tree Bipartitions,
 ##   Consensus Trees, and Bootstrapping Phylogenies
 
-## Copyright 2005-2015 Emmanuel Paradis
+## Copyright 2005-2016 Emmanuel Paradis, 2016 Klaus Schliep
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -180,45 +180,37 @@ plot.prop.part <- function(x, barcol = "blue", leftmar = 4, col = "red", ...)
     mtext(attr(x, "labels"), side = 2, at = 1:n, las = 1)
 }
 
+### by Klaus (2016-03-23):
 prop.clades <- function(phy, ..., part = NULL, rooted = FALSE)
 {
     if (is.null(part)) {
         obj <- .getTreesFromDotdotdot(...)
+        ## avoid double counting of edges if trees are rooted
+        if (!rooted) obj <- lapply(obj, unroot)
         part <- prop.part(obj, check.labels = TRUE)
     }
-
-    ## until ape 3.0-7 it was assumed implicitly that the labels in phy
-    ## are in the same order than in 'part' (bug report by Rupert Collins)
-    if (!identical(phy$tip.label, attr(part, "labels"))) {
-        i <- match(phy$tip.label, attr(part, "labels"))
+    LABS <- attr(part, "labels")
+    if (!identical(phy$tip.label, LABS)) {
+        i <- match(phy$tip.label, LABS)
         j <- match(seq_len(Ntip(phy)), phy$edge[, 2])
         phy$edge[j, 2] <- i
-        phy$tip.label <- attr(part, "labels")
+        phy$tip.label <- LABS
     }
     bp <- prop.part(phy)
     if (!rooted) {
-        bp <- postprocess.prop.part(bp)
-        part <- postprocess.prop.part(part) # fix by Klaus Schliep
-        ## actually the above line in not needed if called from boot.phylo()
-    }
-
-    n <- numeric(phy$Nnode)
-    for (i in seq_along(bp)) {
-        for (j in seq_along(part)) {
-            ## we rely on the fact the values returned by prop.part are
-            ## sorted and without attributes, so identical can be used:
-            if (identical(bp[[i]], part[[j]])) {
-                n[i] <- attr(part, "number")[j]
-                done <-  TRUE
-                break
-            }
-        }
+        ## avoid messing up the order and length if phy is rooted in some cases
+        bp <- ONEwise(bp)
+        part <- postprocess.prop.part(part)
     }
+    pos <- match(bp, part)
+    tmp <- which(!is.na(pos))
+    n <- rep(NA_real_, phy$Nnode)
+    n[tmp] <- attr(part, "number")[pos[tmp]]
     n
 }
 
 boot.phylo <- function(phy, x, FUN, B = 100, block = 1,
-                       trees = FALSE, quiet = FALSE, rooted = FALSE)
+                       trees = FALSE, quiet = FALSE, rooted = is.rooted(phy))
 {
     if (is.null(dim(x)) || length(dim(x)) != 2)
         stop("the data 'x' must have two dimensions (e.g., a matrix or a data frame)")
@@ -241,12 +233,14 @@ boot.phylo <- function(phy, x, FUN, B = 100, block = 1,
         boot.tree[[i]] <- FUN(x[, boot.samp])
         if (!quiet) setTxtProgressBar(progbar, i/B)
     }
-    if (!quiet) close(progbar)
 
     ## for (i in 1:B) storage.mode(boot.tree[[i]]$Nnode) <- "integer"
     ## storage.mode(phy$Nnode) <- "integer"
 
-    if (!quiet) cat("Calculating bootstrap values...")
+    if (!quiet) {
+        close(progbar)
+        cat("Calculating bootstrap values...")
+    }
 
      if (rooted) {
         pp <- prop.part(boot.tree)
@@ -272,39 +266,27 @@ boot.phylo <- function(phy, x, FUN, B = 100, block = 1,
 ### split though they are different clades. The aggregation is done
 ### arbitrarily. The call to ONEwise() insures that all splits include
 ### the first tip.
+### (rewritten by Klaus)
 postprocess.prop.part <- function(x)
 {
-    n <- length(x[[1]])
-    N <- length(x)
     w <- attr(x, "number")
+    labels <- attr(x, "labels")
+
+    x <- ONEwise(x)
+    drop <- duplicated(x)
 
-    drop <- logical(N)
-    V <- numeric(n)
-    for (i in 2:(N - 1)) {
-        if (drop[i]) next
-        A <- x[[i]]
-        for (j in (i + 1):N) {
-            if (drop[j]) next
-            B <- x[[j]]
-            if (length(A) + length(B) != n) next
-            V[] <- 0L
-            V[A] <- 1L
-            V[B] <- 1L
-            if (all(V == 1L)) {
-                drop[j] <- TRUE
-                w[i] <- w[i] + w[j]
-            }
-        }
-    }
     if (any(drop)) {
-        labels <- attr(x, "labels")
+        ind1 <- match(x[drop], x)
+        ind2 <- which(drop)
+        for (i in seq_along(ind2))
+            w[ind1[i]] <- w[ind1[i]] + w[ind2[i]]
         x <- x[!drop]
         w <- w[!drop]
-        attr(x, "number") <- w
-        attr(x, "labels") <- labels
-        class(x) <- "prop.part"
     }
-    ONEwise(x)
+    attr(x, "number") <- w
+    attr(x, "labels") <- labels
+    class(x) <- "prop.part"
+    x
 }
 
 ### This function changes an object of class "prop.part" so that they
@@ -312,8 +294,7 @@ postprocess.prop.part <- function(x)
 ### changed to 1:2.
 ONEwise <- function(x)
 {
-    n <- length(x[[1L]])
-    v <- 1:n
+    v <- seq_along(x[[1L]])
     for (i in 2:length(x)) {
         y <- x[[i]]
         if (y[1] != 1) x[[i]] <- v[-y]
diff --git a/R/plot.phylo.R b/R/plot.phylo.R
index d38ca3a..8669c10 100644
--- a/R/plot.phylo.R
+++ b/R/plot.phylo.R
@@ -1,8 +1,8 @@
-## plot.phylo.R (2015-09-20)
+## plot.phylo.R (2016-02-09)
 
 ##   Plot Phylogenies
 
-## Copyright 2002-2015 Emmanuel Paradis
+## Copyright 2002-2016 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -351,15 +351,21 @@ if (plot) {
     }
     if (root.edge) {
         rootcol <- if (length(edge.color) == 1) edge.color else "black"
+        rootw <- if (length(edge.width) == 1) edge.width else 1
+        rootlty <- if (length(edge.lty) == 1) edge.lty else 1
         if (type == "fan") {
             tmp <- polar2rect(x$root.edge, theta[ROOT])
-            segments(0, 0, tmp$x, tmp$y, col = rootcol)
+            segments(0, 0, tmp$x, tmp$y, col = rootcol, lwd = rootw, lty = rootlty)
         } else {
             switch(direction,
-                   "rightwards" = segments(0, yy[ROOT], x$root.edge, yy[ROOT], col = rootcol),
-                   "leftwards" = segments(xx[ROOT], yy[ROOT], xx[ROOT] + x$root.edge, yy[ROOT], col = rootcol),
-                   "upwards" = segments(xx[ROOT], 0, xx[ROOT], x$root.edge, col = rootcol),
-                   "downwards" = segments(xx[ROOT], yy[ROOT], xx[ROOT], yy[ROOT] + x$root.edge, col = rootcol))
+                   "rightwards" = segments(0, yy[ROOT], x$root.edge, yy[ROOT],
+                                           col = rootcol, lwd = rootw, lty = rootlty),
+                   "leftwards" = segments(xx[ROOT], yy[ROOT], xx[ROOT] + x$root.edge, yy[ROOT],
+                                          col = rootcol, lwd = rootw, lty = rootlty),
+                   "upwards" = segments(xx[ROOT], 0, xx[ROOT], x$root.edge,
+                                        col = rootcol, lwd = rootw, lty = rootlty),
+                   "downwards" = segments(xx[ROOT], yy[ROOT], xx[ROOT], yy[ROOT] + x$root.edge,
+                                          col = rootcol, lwd = rootw, lty = rootlty))
         }
     }
     if (show.tip.label) {
diff --git a/R/plot.phyloExtra.R b/R/plot.phyloExtra.R
new file mode 100644
index 0000000..f56225b
--- /dev/null
+++ b/R/plot.phyloExtra.R
@@ -0,0 +1,30 @@
+## plot.phyloExtra.R (2016-02-18)
+
+##   Extra Functions for Plotting and Annotating
+
+## Copyright 2016 Emmanuel Paradis
+
+## This file is part of the R-package `ape'.
+## See the file ../COPYING for licensing issues.
+
+plotBreakLongEdges <- function(phy, n = 1, ...) {
+    o <- order(phy$edge.length, decreasing = TRUE)
+    i <- o[seq_len(n)]
+    phy$edge.length[i] <- max(phy$edge.length[-i])
+    plot.phylo(phy, ...)
+    edgelabels(edge = i, pch = 19, col = "white")
+    edgelabels("//", i, frame = "n")
+}
+
+drawSupportOnEdges <- function(value, ...)
+{
+    lastPP <- get("last_plot.phylo", envir = .PlotPhyloEnv)
+    n <- lastPP$Ntip
+    m <- lastPP$Nnode
+    if (length(value) == m) value <- value[-1]
+    else if (length(value) != m - 1)
+        stop("incorrect number of support values")
+    nodes <- 2:m + n
+    i <- match(nodes, lastPP$edge[, 2])
+    edgelabels(value, i, ...)
+}
diff --git a/R/read.nexus.R b/R/read.nexus.R
index abaa540..2c9412c 100644
--- a/R/read.nexus.R
+++ b/R/read.nexus.R
@@ -95,7 +95,7 @@ clado.build <- function(tp)
     obj <- list(edge = edge, tip.label = tip.label,
                 Nnode = nb.node, node.label = node.label)
     obj$node.label <-
-        if (all(obj$node.label == "NA")) NULL
+        if (all(obj$node.label == "NA", na.rm = TRUE)) NULL
         else gsub("^NA", "", obj$node.label)
     class(obj) <- "phylo"
     attr(obj, "order") <- "cladewise"
diff --git a/R/root.R b/R/root.R
index 5b37875..9c89319 100644
--- a/R/root.R
+++ b/R/root.R
@@ -1,8 +1,8 @@
-## root.R (2015-11-29)
+## root.R (2016-04-05)
 
 ##   Root of Phylogenetic Trees
 
-## Copyright 2004-2015 Emmanuel Paradis
+## Copyright 2004-2016 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -152,6 +152,10 @@ root <- function(phy, outgroup, node = NULL,
     N <- Nedge(phy)
     oldNnode <- phy$Nnode
 
+    Nclade <- tabulate(e1)[ROOT] # degree of the root node
+    ## if only 2 edges connect to the root, we have to fuse them:
+    fuseRoot <- Nclade == 2
+
     if (newroot == ROOT) {
         if (!resolve.root) return(phy) # else (resolve.root == TRUE)
         if (length(outgroup) > 1) outgroup <- MRCA.outgroup
@@ -172,10 +176,6 @@ root <- function(phy, outgroup, node = NULL,
         }
     } else {
         phy$root.edge <- NULL # just in case
-        Nclade <- tabulate(e1)[ROOT] # degree of the root node
-
-        ## if only 2 edges connect to the root, we have to fuse them:
-        fuseRoot <- Nclade == 2
 
         INV <- logical(N)
         w <- which(e2 == newroot)
@@ -201,16 +201,15 @@ root <- function(phy, outgroup, node = NULL,
         if (!fuseRoot) INV[i] <- TRUE
 
         ## bind the other clades...
-        for (j in 1:Nclade) {
-            ## do we have to fuse the two basal edges?
-            if (fuseRoot) {
-                k <- which(e1 == ROOT)
-                k <- if (k[2] > w) k[2] else k[1]
-                phy$edge[k, 1] <- phy$edge[i, 2]
-                if (wbl)
-                    phy$edge.length[k] <- phy$edge.length[k] + phy$edge.length[i]
-            }
+#        for (j in 1:Nclade) { # fix by EP (2016-01-04)
+        if (fuseRoot) { # do we have to fuse the two basal edges?
+            k <- which(e1 == ROOT)
+            k <- if (k[2] > w) k[2] else k[1]
+            phy$edge[k, 1] <- phy$edge[i, 2]
+            if (wbl)
+                phy$edge.length[k] <- phy$edge.length[k] + phy$edge.length[i]
         }
+#        }
 
         if (fuseRoot) phy$Nnode <- oldNnode - 1L
 
diff --git a/build/vignette.rds b/build/vignette.rds
index 9c3179d..597d4e5 100644
Binary files a/build/vignette.rds and b/build/vignette.rds differ
diff --git a/data/hivtree.newick.rda b/data/hivtree.newick.rda
index 0c7420c..b731460 100644
Binary files a/data/hivtree.newick.rda and b/data/hivtree.newick.rda differ
diff --git a/data/landplants.newick.rda b/data/landplants.newick.rda
index 62e1bee..284b0e1 100644
Binary files a/data/landplants.newick.rda and b/data/landplants.newick.rda differ
diff --git a/data/opsin.newick.rda b/data/opsin.newick.rda
index 8fa6439..b6d33b9 100644
Binary files a/data/opsin.newick.rda and b/data/opsin.newick.rda differ
diff --git a/inst/doc/MoranI.Rnw b/inst/doc/MoranI.Rnw
index 04de862..ae1720e 100644
--- a/inst/doc/MoranI.Rnw
+++ b/inst/doc/MoranI.Rnw
@@ -201,7 +201,7 @@ have been changed for the end-user at this level:
   order of the taxonomic hierarchy: e.g.,
   \code{Order/SuperFamily/Family/Genus}. Not respecting this order
   resulted in an error. In the new version, any order is accepted, but
-  the order given it is then respected when plotted the correlogram.
+  the order given is then respected when plotted the correlogram.
 \item Variable transformations (e.g., log) were allowed on the lhs of
   the formula. Because of the simplification of the code, this is no
   more possible. So it is the responsibility of the user to apply any
diff --git a/inst/doc/MoranI.pdf b/inst/doc/MoranI.pdf
index 70ba2bb..846cec6 100644
Binary files a/inst/doc/MoranI.pdf and b/inst/doc/MoranI.pdf differ
diff --git a/man/AAbin.Rd b/man/AAbin.Rd
new file mode 100644
index 0000000..7f46f25
--- /dev/null
+++ b/man/AAbin.Rd
@@ -0,0 +1,101 @@
+\name{AAbin}
+\alias{AAbin}
+\alias{print.AAbin}
+\alias{[.AAbin}
+\alias{as.character.AAbin}
+\alias{labels.AAbin}
+\alias{image.AAbin}
+\alias{as.AAbin}
+\alias{as.AAbin.character}
+\alias{as.phyDat.AAbin}
+\alias{dist.aa}
+\alias{AAsubst}
+\title{Amino Acid Sequences}
+\description{
+  These functions help to create and manipulate AA sequences.
+}
+\usage{
+\method{print}{AAbin}(x, \dots)
+
+\method{[}{AAbin}(x, i, j, drop = FALSE)
+
+\method{as.character}{AAbin}(x, \dots)
+
+\method{labels}{AAbin}(object, \dots)
+
+\method{image}{AAbin}(x, what, col, bg = "white", xlab = "", ylab = "",
+      show.labels = TRUE, cex.lab = 1, legend = TRUE, \dots)
+
+as.AAbin(x, \dots)
+\method{as.AAbin}{character}(x, \dots)
+
+\method{as.phyDat}{AAbin}(x, \dots)
+
+dist.aa(x, pairwise.deletion = FALSE, scaled = FALSE)
+AAsubst(x)
+}
+\arguments{
+\item{x, object}{an object of class \code{"AAbin"}.}
+\item{i, j}{indices of the rows and/or columns to select or to
+drop. They may be numeric, logical, or character (in the same way than
+for standard \R objects).}
+\item{drop}{logical; if \code{TRUE}, the returned object is of the
+lowest possible dimension.}
+\item{what}{a vector of characters specifying the amino acids to
+visualize. Currently, the only possible choice is to show the three
+categories hydrophobic, small, and hydrophilic.}
+\item{col}{a vector of colours. If missing, this is set to ``red'',
+``yellow'' and ``blue''.}
+\item{bg}{the colour used for AA codes not among \code{what} (typically
+X and *).}
+\item{xlab}{the label for the \emph{x}-axis; none by default.}
+\item{ylab}{Idem for the \emph{y}-axis. Note that by default, the labels
+of the sequences are printed on the \emph{y}-axis (see next option).}
+\item{show.labels}{a logical controlling whether the sequence labels are
+printed (\code{TRUE} by default).}
+\item{cex.lab}{a single numeric controlling the size of the sequence
+labels. Use \code{cex.axis} to control the size of the annotations on
+the \emph{x}-axis.}
+\item{legend}{a logical controlling whether the legend is plotted
+(\code{TRUE} by default).}
+\item{pairwise.deletion}{a logical indicating whether to delete the
+sites with missing data in a pairwise way. The default is to delete the
+sites with at least one missing data for all sequences.}
+\item{scaled}{a logical value specifying whether to scale the number of
+AA differences by the sequence length.}
+\item{\dots}{further arguments to be passed to or from other methods.}
+}
+\details{
+These functions help to manipulate amino acid sequences of class
+\code{"AAbin"}. These objects are stored in vectors, matrices, or lists
+which can be manipulated with the usual \code{[} operator.
+
+There are conversion functions to and from characters, and to
+\code{"phyDat"}.
+
+The function \code{dist.aa} computes the number of AA differences
+between each pair of sequences in a matrix; this can be scaled by the
+sequence length. See the function \code{\link[phangorn]{dist.ml}} in
+\pkg{phangorn} for evolutionary distances with AA sequences.
+
+The function \code{AAsubst} returns the indices of the polymorphic sites
+(similar to \code{\link{seg.sites}} for DNA sequences; see examples below).
+}
+\note{
+Package \pkg{phangorn} has the function \code{read.aa} to read amino
+acid sequence files in FASTA format.
+}
+\value{
+an object of class \code{"AAbin"}, \code{"character"}, \code{"phyDat"},
+\code{"dist"}, or \code{"numeric"}, depending on the function.
+}
+\author{Emmanuel Paradis}
+\seealso{
+\code{\link{trans}}, \code{\link{alview}}
+}
+\examples{
+data(woodmouse)
+AA <- trans(woodmouse, 2)
+seg.sites(woodmouse)
+AAsubst(AA)
+}
\ No newline at end of file
diff --git a/man/DNAbin.Rd b/man/DNAbin.Rd
index 1cbce70..e589f5d 100644
--- a/man/DNAbin.Rd
+++ b/man/DNAbin.Rd
@@ -89,7 +89,7 @@
 \seealso{
   \code{\link{as.DNAbin}}, \code{\link{read.dna}},
   \code{\link{read.GenBank}}, \code{\link{write.dna}},
-  \code{\link{image.DNAbin}}
+  \code{\link{image.DNAbin}},\code{\link{AAbin}}
 
   The corresponding generic functions are documented in the package
   \pkg{base}.
diff --git a/man/DNAbin2indel.Rd b/man/DNAbin2indel.Rd
index 3e237d7..29ec870 100644
--- a/man/DNAbin2indel.Rd
+++ b/man/DNAbin2indel.Rd
@@ -23,6 +23,7 @@ DNAbin2indel(x)
 \author{Emmanuel Paradis}
 \seealso{
   \code{\link{DNAbin}}, \code{\link{as.DNAbin}}, \code{\link{del.gaps}},
-  \code{\link{seg.sites}}, \code{\link{image.DNAbin}}
+  \code{\link{seg.sites}}, \code{\link{image.DNAbin}},
+  \code{\link{checkAlignment}}
 }
 \keyword{manip}
diff --git a/man/LTT.Rd b/man/LTT.Rd
index db2ce35..afa642e 100644
--- a/man/LTT.Rd
+++ b/man/LTT.Rd
@@ -50,7 +50,8 @@ LTT(birth = 0.1, death = 0, N = 100, Tmax = 50, PI = 95,
   661--672.
 
   Paradis, E. (2015) Random phylogenies and the distribution of
-  branching times. In revision.
+  branching times. \emph{Journal of Theoretical Biology}, \bold{387},
+  39--45.
 }
 \author{Emmanuel Paradis}
 \seealso{
diff --git a/man/additive.Rd b/man/additive.Rd
index df8c649..ae1dd88 100644
--- a/man/additive.Rd
+++ b/man/additive.Rd
@@ -20,7 +20,6 @@ ultrametric(X)
   Makarenkov, V. and Lapointe, F.-J. (2004) A weighted least-squares
   approach for inferring phylogenies from incomplete distance
   matrices. \emph{Bioinformatics}, \bold{20}, 2113--2121.
-  \url{http://dx.doi.org/10.1093/bioinformatics/bth211}
 }
 \author{Andrei Popescu \email{niteloserpopescu at gmail.com}}
 \keyword{manip}
diff --git a/man/all.equal.phylo.Rd b/man/all.equal.phylo.Rd
index 64a8519..2fd63d3 100644
--- a/man/all.equal.phylo.Rd
+++ b/man/all.equal.phylo.Rd
@@ -40,7 +40,7 @@
   topologies (i.e., ignoring tip labels) of unrooted trees. This also
   affects \code{\link{unique.multiPhylo}} which calls the present function. See:
 
-  \url{https://stat.ethz.ch/pipermail/r-sig-phylo/2011-August/001562.html}
+  \url{http://www.mail-archive.com/r-sig-phylo@r-project.org/msg01445.html}.
 }
 \value{
   A logical value, or a two-column matrix.
diff --git a/man/alview.Rd b/man/alview.Rd
index e2558bc..deaca18 100644
--- a/man/alview.Rd
+++ b/man/alview.Rd
@@ -1,14 +1,18 @@
 \name{alview}
 \alias{alview}
-\title{Print DNA Sequence Alignements}
+\title{Print DNA or AA Sequence Alignement}
 \description{
-  This function displays in the console or a file an alignment of DNA sequences. The first sequence is printed on the first row and the bases of the other sequences are replaced by dots if they are identical with the first sequence.
+  This function displays in the console or a file an alignment of DNA or
+  AAsequences. The first sequence is printed on the first row and the
+  bases of the other sequences are replaced by dots if they are
+  identical with the first sequence.
 }
 \usage{
 alview(x, file = "", uppercase = TRUE)
 }
 \arguments{
-  \item{x}{a matrix or a list of DNA sequences (class \code{"DNAbin"}).}
+  \item{x}{a matrix or a list of DNA sequences (class \code{"DNAbin"})
+    or a matrix of AA sequences (class \code{"AAbin"}).}
   \item{file}{a character string giving the name of the file where to print the sequences; by default, they are printed in the console.}
   \item{uppercase}{a logical specifying whether to print the bases as uppercase letters.}
 }
@@ -18,7 +22,7 @@ The first line of the output shows the position of the last column of the printe
 \author{Emmanuel Paradis}
 \seealso{
   \code{\link{DNAbin}}, \code{\link{image.DNAbin}}, \code{\link{alex}},
-  \code{\link{clustal}}
+  \code{\link{clustal}}, \code{\link{checkAlignment}}
 }
 \examples{
 data(woodmouse)
diff --git a/man/ape-internal.Rd b/man/ape-internal.Rd
index 32de966..d320282 100644
--- a/man/ape-internal.Rd
+++ b/man/ape-internal.Rd
@@ -75,6 +75,7 @@
 \alias{getSumSquare}
 \alias{getMLHessian}
 \alias{getREMLHessian}
+\alias{trans_DNA2AA}
 \title{Internal Ape Functions}
 \description{
   Internal \pkg{ape} functions.
diff --git a/man/boot.phylo.Rd b/man/boot.phylo.Rd
index 8c699f4..d685e31 100644
--- a/man/boot.phylo.Rd
+++ b/man/boot.phylo.Rd
@@ -22,7 +22,7 @@
 }
 \usage{
 boot.phylo(phy, x, FUN, B = 100, block = 1,
-           trees = FALSE, quiet = FALSE, rooted = FALSE)
+           trees = FALSE, quiet = FALSE, rooted = is.rooted(phy))
 prop.part(..., check.labels = TRUE)
 prop.clades(phy, ..., part = NULL, rooted = FALSE)
 \method{print}{prop.part}(x, ...)
@@ -42,7 +42,7 @@ prop.clades(phy, ..., part = NULL, rooted = FALSE)
     trees (\code{FALSE} by default).}
   \item{quiet}{a logical: a progress bar is displayed by default.}
   \item{rooted}{a logical specifying whether the trees should be treated
-    as rooted or not (the default).}
+    as rooted or not.}
   \item{\dots}{either (i) a single object of class \code{"phylo"}, (ii) a
     series of such objects separated by commas, or (iii) a list
     containing such objects. In the case of \code{plot} further
@@ -92,9 +92,10 @@ prop.clades(phy, ..., part = NULL, rooted = FALSE)
   might be faster to first call, e.g., \code{pp <- prop.part(...)}, then
   use the option \code{part}: \code{prop.clades(phy, part = pp)}.
 
-  You have to be careful that by default \code{prop.clades} considers
-  the trees as unrooted and this may result in spurious results if the
-  trees are rooted (see examples).
+  Since \pkg{ape} 3.5, \code{prop.clades} should return sensible results
+  for all values of \code{rooted}: if \code{FALSE}, the numbers of
+  bipartitions (or splits); if \code{TRUE}, the number of clades (of
+  hopefully rooted trees).
 }
 \value{
   \code{prop.part} returns an object of class \code{"prop.part"} which
@@ -146,11 +147,44 @@ plot(pp10, pch = "x", col = 2)
 plot(pp20, pch = "x", col = 2)
 
 set.seed(1)
-tr <- rtree(10) # rooted by default
-prop.clades(tr, tr) # clearly wrong
+tr <- rtree(10) # rooted
+## the following used to return a wrong result with ape <= 3.4:
+prop.clades(tr, tr)
 prop.clades(tr, tr, rooted = TRUE)
 tr <- rtree(10, rooted = FALSE)
 prop.clades(tr, tr) # correct
+
+### an illustration of the use of prop.clades with bootstrap trees:
+
+fun <- function(x) as.phylo(hclust(dist.dna(x), "average")) # upgma() in phangorn
+tree <- fun(woodmouse)
+## get 100 bootstrap trees:
+bstrees <- boot.phylo(tree, woodmouse, fun, trees = TRUE)$trees
+## get proportions of each clade:
+clad <- prop.clades(tree, bstrees, rooted = TRUE)
+## get proportions of each bipartition:
+boot <- prop.clades(tree, bstrees)
+plot(tree, main = "Bipartitions vs. Clades Support Values")
+drawSupportOnEdges(boot)
+nodelabels(clad)
+legend("bottomleft", legend = c("Bipartitions", "Clades"), pch = 22,
+       pt.bg = c("green", "lightblue"), pt.cex = 2.5)
+
+\dontrun{
+## an example of double bootstrap:
+nrep1 <- 100
+nrep2 <- 100
+p <- ncol(woodmouse)
+DB <- 0
+
+for (b in 1:nrep1) {
+    X <- woodmouse[, sample(p, p, TRUE)]
+    DB <- DB + boot.phylo(tr, X, f, nrep2, quiet = TRUE)
+}
+DB
+## to compare with:
+boot.phylo(tr, woodmouse, f, 1e4)
+}
 }
 \keyword{manip}
 \keyword{htest}
diff --git a/man/checkAlignment.Rd b/man/checkAlignment.Rd
new file mode 100644
index 0000000..a64fe15
--- /dev/null
+++ b/man/checkAlignment.Rd
@@ -0,0 +1,42 @@
+\name{checkAlignment}
+\alias{checkAlignment}
+\title{Check DNA Alignments}
+\description{
+  This function performs a series of diagnostics on a DNA alignement.
+}
+\usage{
+checkAlignment(x, check.gaps = TRUE, plot = TRUE, what = 1:4)
+}
+\arguments{
+\item{x}{an object of class \code{"DNAbin"}.}
+\item{check.gaps}{a logical value specifying whether to check the
+  distribution of alignment gaps.}
+\item{plot}{a logical value specifying whether to do the plots.}
+\item{what}{an integer value giving the plot to be done. By default,
+  four plots are done on the same figure.}
+}
+\details{
+  This function prints on the console a series of diagnostics on the
+  set a aligned DNA sequences. If alignment gaps are present, their
+  width distribution is analysed, as well as the width of contiguous
+  base segments. The pattern of nucleotide diversity on each site is
+  also analysed, and a relevant table is printed.
+
+  If \code{plot = TRUE}, four plots are done: an image of the
+  alignement, the distribution of gap widths (if present), the Shannon
+  index of nucleotide diversity along the sequence, and the number of
+  observed bases along the sequence.
+
+  If the sequences contain many gaps, it might be better to set
+  \code{check.gaps = FALSE} to skip the analysis of contiguous
+  segments.
+}
+\value{NULL}
+\author{Emmanuel Paradis}
+\seealso{
+\code{\link{alview}}, \code{\link{image.DNAbin}}
+}
+\examples{
+data(woodmouse)
+checkAlignment(woodmouse)
+}
\ No newline at end of file
diff --git a/man/clustal.Rd b/man/clustal.Rd
index fc5b843..a0d77df 100644
--- a/man/clustal.Rd
+++ b/man/clustal.Rd
@@ -78,7 +78,7 @@ tcoffee(x, exec = "t_coffee", MoreArgs = "", quiet = TRUE,
 \author{Emmanuel Paradis}
 \seealso{
   \code{\link{image.DNAbin}}, \code{\link{del.gaps}},
-  \code{\link{alex}}, \code{\link{alview}}
+  \code{\link{alex}}, \code{\link{alview}}, \code{\link{checkAlignment}}
 
   The package \pkg{ips} which has similar functions for MAFFT and
   Prank.
diff --git a/man/def.Rd b/man/def.Rd
index 3b51382..7760f4d 100644
--- a/man/def.Rd
+++ b/man/def.Rd
@@ -18,7 +18,7 @@ def(x, ..., default = NULL, regexp = FALSE)
 }
 \details{
 The idea of this function is to make the definition of colours, etc.,
-simpler than what is done usually. A typical use will:
+simpler than what is done usually. A typical use is:
 
 \code{def(tr$tip.label, Homo_sapiens = "blue")}
 
diff --git a/man/del.gaps.Rd b/man/del.gaps.Rd
index 59039b0..3459f08 100644
--- a/man/del.gaps.Rd
+++ b/man/del.gaps.Rd
@@ -1,37 +1,46 @@
 \name{del.gaps}
 \alias{del.gaps}
 \alias{del.colgapsonly}
+\alias{del.rowgapsonly}
 \title{Delete Alignment Gaps in DNA Sequences}
 \description{
-  These functions remove indel gaps (\code{"-"}) in a sample of DNA
-  sequences.
+  These functions remove gaps (\code{"-"}) in a sample of DNA sequences.
 }
 \usage{
 del.gaps(x)
-del.colgapsonly(x)
+del.colgapsonly(x, threshold = 1, freq.only = FALSE)
+del.rowgapsonly(x, threshold = 1, freq.only = FALSE)
 }
 \arguments{
   \item{x}{a matrix, a list, or a vector containing the DNA
-    sequences; only matrices for \code{del.colgapsonly}.}
+    sequences; only matrices for \code{del.colgapsonly} and for
+    \code{del.rowgapsonly}.}
+  \item{threshold}{the largest gap proportion to delete the column or row.}
+  \item{freq.only}{if \code{TRUE}, returns only the numbers of gaps for
+    each column or row.}
 }
 \details{
   \code{del.gaps} remove all gaps, so the returned sequences may not
   have all the same lengths and are therefore returned in a list.
 
-  \code{del.colgapsonly} removes the columns that contain only gaps
-  (useful when a small matrix is extracted from a large alignment).
+  \code{del.colgapsonly} removes the columns with a proportion at least
+  \code{threshold} of gaps. Thus by default, only the columns with gaps
+  only are removed (useful when a small matrix is extracted from a large
+  alignment). \code{del.rowgapsonly} does the same for the rows.
 
   The sequences can be either in \code{"DNAbin"} or in another format,
   but the returned object is always of class \code{"DNAbin"}.
 }
 \value{
   \code{del.gaps} returns a vector (if there is only one input sequence)
-  or a list of class \code{"DNAbin"}; \code{del.colgapsonly} returns a
-  matrix.
+  or a list of class \code{"DNAbin"}; \code{del.colgapsonly} and
+  \code{del.rowgapsonly} return a matrix of class \code{"DNAbin"} or a
+  numeric vector (with names for the second function) if \code{freq.only
+  = TRUE}.
 }
 \author{Emmanuel Paradis}
 \seealso{
-  \code{\link{base.freq}}, \code{\link{GC.content}},
-  \code{\link{seg.sites}}, \code{\link{image.DNAbin}}
+  \code{\link{base.freq}}, \code{\link{seg.sites}},
+  \code{\link{image.DNAbin}}, \code{\link{checkAlignment}}
 }
 \keyword{univar}
diff --git a/man/dist.dna.Rd b/man/dist.dna.Rd
index d67ea13..00ce697 100644
--- a/man/dist.dna.Rd
+++ b/man/dist.dna.Rd
@@ -130,6 +130,12 @@ dist.dna(x, model = "K80", variance = FALSE,
     \code{A--} is 3 because there are three different blocks of gaps, whereas
     the ``indel'' distance will be 2.}
 }}
+\note{
+  If the sequences are very different, most evolutionary distances are
+  undefined and a non-finite value (Inf or NaN) is returned. You may do
+  \code{dist.dna(, model = "raw")} to check whether some values are
+  higher than 0.75.
+}
 \value{
   an object of class \link[stats]{dist} (by default), or a numeric
   matrix if \code{as.matrix = TRUE}. If \code{model = "BH87"}, a numeric
diff --git a/man/diversity.contrast.test.Rd b/man/diversity.contrast.test.Rd
index c55acc7..b8970dd 100644
--- a/man/diversity.contrast.test.Rd
+++ b/man/diversity.contrast.test.Rd
@@ -20,7 +20,7 @@ diversity.contrast.test(x, method = "ratiolog",
     \code{"difference"}, \code{"logratio"}, or any unambiguous
     abbreviation of these.}
   \item{alternative}{a character string defining the alternative
-    hypothesis:  \code{"two.sided"} (default),  \code{"less"},
+    hypothesis:  \code{"two.sided"} (default), \code{"less"},
     \code{"greater"}, or any unambiguous abbreviation of these.}
   \item{nrep}{the number of replications of the randomization test; by
     default, a Wilcoxon test is done.}
diff --git a/man/image.DNAbin.Rd b/man/image.DNAbin.Rd
index 0b011fb..fedb652 100644
--- a/man/image.DNAbin.Rd
+++ b/man/image.DNAbin.Rd
@@ -44,7 +44,8 @@
 \author{Emmanuel Paradis}
 \seealso{
   \code{\link{DNAbin}}, \code{\link{del.gaps}}, \code{\link{alex}},
-  \code{\link{alview}}, \code{\link{clustal}}, \code{\link[graphics]{grid}}
+  \code{\link{alview}}, \code{\link{clustal}},
+  \code{\link[graphics]{grid}}, \code{\link{image.AAbin}}
 }
 \examples{
 data(woodmouse)
diff --git a/man/makeNodeLabel.Rd b/man/makeNodeLabel.Rd
index 9d22c64..ec4abb1 100644
--- a/man/makeNodeLabel.Rd
+++ b/man/makeNodeLabel.Rd
@@ -48,7 +48,7 @@ makeNodeLabel(phy, method = "number", prefix = "Node", nodeList = list(), ...)
 \value{
   an object of class \code{"phylo"}.
 }
-\author{Emmanuel Paradis \email{Emmanuel.Paradis at mpl.ird.fr}}
+\author{Emmanuel Paradis}
 \seealso{
   \code{\link{makeLabel}}, \code{\link[base]{grep}},
   \code{\link{mixedFontLabel}}, \code{\link{label2table}}
diff --git a/man/mcmc.popsize.Rd b/man/mcmc.popsize.Rd
index b909eed..fbf99c4 100644
--- a/man/mcmc.popsize.Rd
+++ b/man/mcmc.popsize.Rd
@@ -83,10 +83,10 @@ extract.popsize(mcmc.out, credible.interval=0.95, time.points=200, thinning=1, b
 }
 
 
-\author{Rainer Opgen-Rhein and
-        Korbinian Strimmer (\url{http://strimmerlab.org}).
-        Parts of the rjMCMC sampling procedure are adapted from \R code by Karl Browman
-	 (\url{http://www.biostat.wisc.edu/~kbroman/})}
+\author{
+  Rainer Opgen-Rhein and Korbinian Strimmer
+  (\url{http://strimmerlab.org}). Parts of the rjMCMC sampling procedure
+  are adapted from \R code by Karl Browman (\url{http://kbroman.org/})}
 
 \seealso{
 \code{\link{skyline}} and \code{\link{skylineplot}}. }
diff --git a/man/plot.phyloExtra.Rd b/man/plot.phyloExtra.Rd
new file mode 100644
index 0000000..b839972
--- /dev/null
+++ b/man/plot.phyloExtra.Rd
@@ -0,0 +1,56 @@
+\name{plot.phylo.extra}
+\alias{plot.phylo.extra}
+\alias{plotBreakLongEdges}
+\alias{drawSupportOnEdges}
+\title{Extra Fuctions to Plot and Annotate Phylogenies}
+\description{
+  These are extra functions to plot and annotate phylogenies, mostly
+  calling basic graphical functions in \pkg{ape}.
+}
+\usage{
+plotBreakLongEdges(phy, n = 1, ...)
+drawSupportOnEdges(value, ...)
+}
+\arguments{
+  \item{phy}{an object of class \code{"phylo"}.}
+  \item{n}{the numner of long branches to be broken.}
+  \item{value}{the values to be printed on the internal branches of the tree.}
+  \item{\dots}{further arguments to be passed to \code{plot.phylo} or to
+    \code{edgelabels}.}
+}
+\details{
+  \code{drawSupportOnEdges} assumes the tree is unrooted, so the vector
+  \code{value} should have as many values than the number of internal
+  branches (= number of nodes - 1). If there is one additional value, it
+  is assumed that it relates to the root node and is dropped (see examples).
+}
+\value{NULL}
+\author{Emmanuel Paradis}
+\seealso{
+  \code{\link{plot.phylo}}, \code{\link{edgelabels}},
+  \code{\link{boot.phylo}}
+}
+\examples{
+tr <- rtree(10)
+tr$edge.length[c(1, 18)] <- 100
+op <- par(mfcol = 1:2)
+plot(tr); axisPhylo()
+plotBreakLongEdges(tr, 2); axisPhylo()
+
+## from ?boot.phylo:
+f <- function(x) nj(dist.dna(x))
+data(woodmouse)
+tw <- f(woodmouse) # NJ tree with K80 distance
+set.seed(1)
+## bootstrap with 100 replications:
+(bp <- boot.phylo(tw, woodmouse, f, quiet = TRUE))
+## the first value relates to the root node and is always 100
+## it is ignored below:
+plot(tw, "u")
+drawSupportOnEdges(bp)
+## more readable but the tree is really unrooted:
+plot(tw)
+drawSupportOnEdges(bp)
+par(op)
+}
+\keyword{hplot}
diff --git a/man/read.GenBank.Rd b/man/read.GenBank.Rd
index d7ea055..42ca2e5 100644
--- a/man/read.GenBank.Rd
+++ b/man/read.GenBank.Rd
@@ -46,7 +46,7 @@ read.GenBank(access.nb, seq.names = access.nb, species.names = TRUE,
 \author{Emmanuel Paradis}
 \examples{
 ### This won't work if your computer is not connected
-### to the Internet!!!
+### to the Internet
 ###
 ### Get the 8 sequences of tanagers (Ramphocelus)
 ### as used in Paradis (1997)
diff --git a/man/root.Rd b/man/root.Rd
index 499605c..b20fe46 100644
--- a/man/root.Rd
+++ b/man/root.Rd
@@ -60,7 +60,7 @@ is.rooted(phy)
   clade on the right of \code{node} (when the tree is plotted by
   default) as the ingroup. See a detailed explanation there:
 
-  \url{https://stat.ethz.ch/pipermail/r-sig-phylo/2015-April/003979.html}.
+  \url{http://www.mail-archive.com/r-sig-phylo@r-project.org/msg03805.html}.
 }
 \value{
   an object of class \code{"phylo"} for \code{root} and \code{unroot}; a
diff --git a/man/trans.Rd b/man/trans.Rd
new file mode 100644
index 0000000..67431a2
--- /dev/null
+++ b/man/trans.Rd
@@ -0,0 +1,52 @@
+\name{trans}
+\alias{trans}
+\alias{complement}
+\title{Translation from DNA to Amino Acid Sequences}
+\description{
+  \code{trans} translates DNA sequences into amino acids.
+  \code{complement} returns the (reverse) complement sequences.
+}
+\usage{
+trans(x, code = 1, codonstart = 1)
+complement(x)
+}
+\arguments{
+\item{x}{an object of class \code{"DNAbin"} (vector, matrix or list).}
+\item{code}{an integer value giving the genetic code to be
+  used. Currently only 1 (standard code) and 2 (vertebrate mitochondrial
+  code) are supported.}
+\item{codonstart}{an integer giving where to start the translation. This
+  should be 1, 2, or 3, but larger values are accepted and have for
+  effect to start the translation further within the sequence.}
+}
+\details{
+  With \code{trans}, if the sequence length is not a multiple of three,
+  a warning message is printed. Alignment gaps are simply ignored (i.e.,
+  \code{AG-} returns \code{X} with no special warning or message). Base
+  ambiguities are taken into account where relevant: for instance,
+  \code{GGN}, \code{GGA}, \code{GGR}, etc, all return \code{G}.
+}
+\value{
+  an object of class \code{"AAbin"} or \code{"DNAbin"}, respectively.
+}
+\note{
+  These functions are equivalent to \code{translate} and \code{comp} in
+  the package \pkg{seqinr} with the difference that there is no need to
+  convert the sequences into character strings.
+}
+\references{
+\url{http://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/index.cgi?chapter=cgencodes}
+}
+\author{Emmanuel Paradis}
+\seealso{
+\code{\link{AAbin}}, \code{\link{checkAlignment}}, \code{\link{alview}}
+}
+\examples{
+data(woodmouse)
+X <- trans(woodmouse) # not correct
+X2 <- trans(woodmouse, 2) # using the correct code
+identical(X, X2)
+alview(X[1:2, 1:60]) # some codon Stop (*)
+alview(X2[, 1:60])
+X2
+}
\ No newline at end of file
diff --git a/man/write.nexus.data.Rd b/man/write.nexus.data.Rd
index d434b7e..ff6aad5 100644
--- a/man/write.nexus.data.Rd
+++ b/man/write.nexus.data.Rd
@@ -1,8 +1,6 @@
 \name{write.nexus.data}
 \alias{write.nexus.data}
-\title{
-  Write Character Data in NEXUS Format
-}
+\title{Write Character Data in NEXUS Format}
 \description{
   This function writes in a file a list of sequences in the NEXUS
   format. The names of the vectors of the list are used as taxon names.
diff --git a/src/ape.c b/src/ape.c
index c76caa8..9e6c7a3 100644
--- a/src/ape.c
+++ b/src/ape.c
@@ -1,6 +1,6 @@
-/* ape.c    2015-10-15 */
+/* ape.c    2016-02-18 */
 
-/* Copyright 2011-2015 Emmanuel Paradis, and 2007 R Development Core Team */
+/* Copyright 2011-2016 Emmanuel Paradis, and 2007 R Development Core Team */
 
 /* This file is part of the R-package `ape'. */
 /* See the file ../COPYING for licensing issues. */
@@ -79,6 +79,7 @@ void bitsplits_phylo(int *n, int *m, int *e, int *N, int *nr, unsigned char *mat
 void CountBipartitionsFromTrees(int *n, int *m, int *e, int *N, int *nr, int *nc,
 				unsigned char *mat, double *freq);
 void DNAbin2indelblock(unsigned char *x, int *n, int *s, int *y);
+void trans_DNA2AA(unsigned char *x, int *s, unsigned char *res, int *code);
 
 SEXP bipartition(SEXP edge, SEXP nbtip, SEXP nbnode);
 SEXP prop_part(SEXP TREES, SEXP nbtree, SEXP keep_partitions);
@@ -121,6 +122,7 @@ static R_CMethodDef C_entries[] = {
     {"bitsplits_phylo", (DL_FUNC) &bitsplits_phylo, 6},
     {"CountBipartitionsFromTrees", (DL_FUNC) &CountBipartitionsFromTrees, 8},
     {"DNAbin2indelblock", (DL_FUNC) &DNAbin2indelblock, 4},
+    {"trans_DNA2AA", (DL_FUNC) &trans_DNA2AA, 4},
     {NULL, NULL, 0}
 };
 
diff --git a/src/dist_dna.c b/src/dist_dna.c
index b95554a..41a9bbb 100644
--- a/src/dist_dna.c
+++ b/src/dist_dna.c
@@ -1,6 +1,6 @@
-/* dist_dna.c       2015-10-15 */
+/* dist_dna.c       2016-02-18 */
 
-/* Copyright 2005-2015 Emmanuel Paradis */
+/* Copyright 2005-2016 Emmanuel Paradis */
 
 /* This file is part of the R-package `ape'. */
 /* See the file ../COPYING for licensing issues. */
@@ -1201,3 +1201,217 @@ void C_where(unsigned char *x, unsigned char *pat, int *s, int *p,
 	}
 	*n = ln;
 }
+
+unsigned char codon2aa_Code1(unsigned char x, unsigned char y, unsigned char z)
+{
+    if (KnownBase(x)) {
+	if (IsAdenine(x)) {
+	    if (KnownBase(y)) {
+		if (IsAdenine(y)) {
+		    if (IsPurine(z)) return 0x4b; /* codon is AAR => 'K' */
+		    if (IsPyrimidine(z)) return 0x4e; /* codon is AAY => 'N' */
+		    return 0x58; /* 'X' */
+		}
+		if (IsCytosine(y)) {
+		    if (z > 4) return 0x54; /* codon is ACN => 'T' */
+		    return 0x58;
+		}
+		if (IsGuanine(y)) {
+		    if (IsPurine(z)) return 0x52; /* codon is AGR => 'R' */
+		    if (IsPyrimidine(z)) return 0x53; /* codon is AGY => 'S' */
+		    return 0x58;
+		}
+		if (IsThymine(y)) {
+		    if (IsGuanine(z)) return 0x4d; /* codon is ATG => 'M' */
+		    if (z & 176) return 0x49; /* codon is ATH => 'I' */
+		    return 0x58;
+		}
+	    }
+	    return 0x58;
+	}
+	if (IsCytosine(x)) {
+	    if (IsAdenine(y)) {
+		if (IsPurine(z)) return 0x51; /* codon is CAR => 'Q'*/
+		if (IsPyrimidine(z)) return 0x48; /* codon is CAY => 'H' */
+		return 0x58;
+	    }
+	    if (IsCytosine(y)) {
+		if (z > 4) return 0x50; /* codon is CCN => 'P'*/
+		return 0x58;
+	    }
+	    if (IsGuanine(y)) {
+		if (z > 4) return 0x52; /* codon is CGN => 'R' */
+		return 0x58;
+	    }
+	    if (IsThymine(y)) {
+		if (z > 4) return 0x4c; /* codon is CTN => 'L' */
+		return 0x58;
+	    }
+	    return 0x58;
+	}
+	if (IsGuanine(x)) {
+	    if (IsAdenine(y)) {
+		if (IsPurine(z)) return 0x45; /* codon is GAR => 'E' */
+		if (IsPyrimidine(z)) return 0x44; /* codon is GAY => 'D' */
+		return 0x58;
+	    }
+	    if (IsCytosine(y)) {
+		if (z > 4) return 0x41; /* codon is GCN => 'A' */
+		return 0x58;
+	    }
+	    if (IsGuanine(y)) {
+		if (z > 4) return 0x47; /* codon is GGN => 'G' */
+		return 0x58;
+	    }
+	    if (IsThymine(y)) {
+		if (z > 4) return 0x56; /* codon is GTN => 'V' */
+		return 0x58;
+	    }
+	    return 0x58;
+	}
+	if (IsThymine(x)) {
+	    if (KnownBase(y)) {
+		if (IsAdenine(y)) {
+		    if (IsPurine(z)) return 0x2a; /* codon is TAR => '*' */
+		    if (IsPyrimidine(z)) return 0x59; /* codon is TAY => 'Y' */
+		    return 0x58;
+		}
+		if (IsCytosine(y)) {
+		    if (z > 4) return 0x53; /* codon is TCN => 'S' */
+		    return 0x58;
+		}
+		if (IsGuanine(y)) {
+		    if (IsAdenine(z)) return 0x2a; /* codon is TGA => '*' */
+		    if (IsGuanine(z)) return 0x57; /* codon is TGG => 'W' */
+		    if (IsPyrimidine(z)) return 0x43; /* codon is TGY => 'C' */
+		    return 0x58;
+		}
+		if (IsThymine(y)) {
+		    if (IsPurine(z)) return 0x4c; /* codon is TTR => 'L' */
+		    if (IsPyrimidine(z)) return 0x46; /* codon is TTY => 'F' */
+		    return 0x58;
+		}
+	    } else if (IsPurine(y) & IsAdenine(z)) return 0x2a; /* codon is TRA => '*' */
+	    return 0x58;
+	}
+    } else {
+	if (x == 144 & IsThymine(y) & IsPurine(z)) return 0x52; /* codon is MGR => 'R'*/
+	if (x == 48 & IsThymine(y) & IsPurine(z)) return 0x4c; /* codon is YTR => 'L'*/
+    }
+    return 0x58;
+}
+
+unsigned char codon2aa_Code2(unsigned char x, unsigned char y, unsigned char z)
+{
+    if (KnownBase(x)) {
+	if (IsAdenine(x)) {
+	    if (KnownBase(y)) {
+		if (IsAdenine(y)) {
+		    if (IsPurine(z)) return 0x4b; /* codon is AAR => 'K' */
+		    if (IsPyrimidine(z)) return 0x4e; /* codon is AAY => 'N' */
+		    return 0x58; /* 'X' */
+		}
+		if (IsCytosine(y)) {
+		    if (z > 4) return 0x54; /* codon is ACN => 'T' */
+		    return 0x58;
+		}
+		if (IsGuanine(y)) {
+		    if (IsPurine(z)) return 0x2a; /* codon is AGR => '*' */
+		    if (IsPyrimidine(z)) return 0x53; /* codon is AGY => 'S' */
+		    return 0x58;
+		}
+		if (IsThymine(y)) {
+		    if (IsPurine(z)) return 0x4d; /* codon is ATR => 'M' */
+		    if (IsPyrimidine(z)) return 0x49; /* codon is ATY => 'I' */
+		    return 0x58;
+		}
+	    }
+	    return 0x58;
+	}
+	if (IsCytosine(x)) {
+	    if (IsAdenine(y)) {
+		if (IsPurine(z)) return 0x51; /* codon is CAR => 'Q'*/
+		if (IsPyrimidine(z)) return 0x48; /* codon is CAY => 'H' */
+		return 0x58;
+	    }
+	    if (IsCytosine(y)) {
+		if (z > 4) return 0x50; /* codon is CCN => 'P'*/
+		return 0x58;
+	    }
+	    if (IsGuanine(y)) {
+		if (z > 4) return 0x52; /* codon is CGN => 'R' */
+		return 0x58;
+	    }
+	    if (IsThymine(y)) {
+		if (z > 4) return 0x4c; /* codon is CTN => 'L' */
+		return 0x58;
+	    }
+	    return 0x58;
+	}
+	if (IsGuanine(x)) {
+	    if (IsAdenine(y)) {
+		if (IsPurine(z)) return 0x45; /* codon is GAR => 'E' */
+		if (IsPyrimidine(z)) return 0x44; /* codon is GAY => 'D' */
+		return 0x58;
+	    }
+	    if (IsCytosine(y)) {
+		if (z > 4) return 0x41; /* codon is GCN => 'A' */
+		return 0x58;
+	    }
+	    if (IsGuanine(y)) {
+		if (z > 4) return 0x47; /* codon is GGN => 'G' */
+		return 0x58;
+	    }
+	    if (IsThymine(y)) {
+		if (z > 4) return 0x56; /* codon is GTN => 'V' */
+		return 0x58;
+	    }
+	    return 0x58;
+	}
+	if (IsThymine(x)) {
+	    if (KnownBase(y)) {
+		if (IsAdenine(y)) {
+		    if (IsPurine(z)) return 0x2a; /* codon is TAR => '*' */
+		    if (IsPyrimidine(z)) return 0x59; /* codon is TAY => 'Y' */
+		    return 0x58;
+		}
+		if (IsCytosine(y)) {
+		    if (z > 4) return 0x53; /* codon is TCN => 'S' */
+		    return 0x58;
+		}
+		if (IsGuanine(y)) {
+		    if (IsPurine(z)) return 0x57; /* codon is TGR => 'W' */
+		    if (IsPyrimidine(z)) return 0x43; /* codon is TGY => 'C' */
+		    return 0x58;
+		}
+		if (IsThymine(y)) {
+		    if (IsPurine(z)) return 0x4c; /* codon is TTR => 'L' */
+		    if (IsPyrimidine(z)) return 0x46; /* codon is TTY => 'F' */
+		    return 0x58;
+		}
+	    }
+	    return 0x58;
+	}
+    } else {
+	if (x == 48 & IsThymine(y) & IsPurine(z)) return 0x4c; /* codon is YTR => 'L'*/
+    }
+    return 0x58;
+}
+
+void trans_DNA2AA(unsigned char *x, int *s, unsigned char *res, int *code)
+{
+    int i = 0, j = 0;
+    unsigned char (*FUN)(unsigned char x, unsigned char y, unsigned char z);
+
+    /* NOTE: using 'switch' provokes a memory leak */
+    if (*code == 1) {
+	FUN = &codon2aa_Code1;
+    } else {
+	FUN = &codon2aa_Code2;
+    }
+
+    while (i < *s) {
+	res[j] = FUN(x[i], x[i + 1], x[i + 2]);
+	j++; i += 3;
+    }
+}
diff --git a/vignettes/MoranI.Rnw b/vignettes/MoranI.Rnw
index 04de862..ae1720e 100644
--- a/vignettes/MoranI.Rnw
+++ b/vignettes/MoranI.Rnw
@@ -201,7 +201,7 @@ have been changed for the end-user at this level:
   order of the taxonomic hierarchy: e.g.,
   \code{Order/SuperFamily/Family/Genus}. Not respecting this order
   resulted in an error. In the new version, any order is accepted, but
-  the order given it is then respected when plotted the correlogram.
+  the order given is then respected when plotted the correlogram.
 \item Variable transformations (e.g., log) were allowed on the lhs of
   the formula. Because of the simplification of the code, this is no
   more possible. So it is the responsibility of the user to apply any

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-cran-ape.git



More information about the debian-med-commit mailing list