Skip to content

Commit 64f95c5

Browse files
tanja819cran-robot
authored andcommitted
version 2.3
1 parent 52438a3 commit 64f95c5

File tree

5 files changed

+42
-14
lines changed

5 files changed

+42
-14
lines changed

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Package: TreeSim
22
Type: Package
33
Title: Simulating Phylogenetic Trees
4-
Version: 2.2
5-
Date: 2015-10-05
4+
Version: 2.3
5+
Date: 2017-03-20
66
Author: Tanja Stadler
77
Maintainer: Tanja Stadler <[email protected]>
8-
Depends: ape, laser, geiger
8+
Depends: ape, geiger
99
Description: Simulation methods for phylogenetic trees where (i) all tips are sampled at one time point or (ii) tips are sampled sequentially through time. (i) For sampling at one time point, simulations are performed under a constant rate birth-death process, conditioned on having a fixed number of final tips (sim.bd.taxa()), or a fixed age (sim.bd.age()), or a fixed age and number of tips (sim.bd.taxa.age()). When conditioning on the number of final tips, the method allows for shifts in rates and mass extinction events during the birth-death process (sim.rateshift.taxa()). The function sim.bd.age() (and sim.rateshift.taxa() without extinction) allow the speciation rate to change in a density-dependent way. The LTT plots of the simulations can be displayed using LTT.plot(), LTT.plot.gen() and LTT.average.root(). TreeSim further samples trees with n final tips from a set of trees generated by the common sampling algorithm stopping when a fixed number m>>n of tips is first reached (sim.gsa.taxa()). This latter method is appropriate for m-tip trees generated under a big class of models (details in the sim.gsa.taxa() man page). For incomplete phylogeny, the missing speciation events can be added through simulations (corsim()). (ii) sim.rateshifts.taxa() is generalized to sim.bdsky.stt() for serially sampled trees, where the trees are conditioned on either the number of sampled tips or the age. Furthermore, for a multitype-branching process with sequential sampling, trees on a fixed number of tips can be simulated using sim.bdtypes.stt.taxa(). This function further allows to simulate under epidemiological models with an exposed class. The function sim.genespeciestree() simulates coalescent gene trees within birth-death species trees, and sim.genetree() simulates coalescent gene trees.
1010
License: GPL-2
1111
LazyLoad: yes
12-
Packaged: 2015-10-05 12:14:49 UTC; tstadler
1312
NeedsCompilation: no
13+
Packaged: 2017-03-20 10:07:39 UTC; tstadler
1414
Repository: CRAN
15-
Date/Publication: 2015-10-05 17:07:39
15+
Date/Publication: 2017-03-20 10:52:26 UTC

MD5

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
47a0046bb7154773f3594f22da2cf1c0 *DESCRIPTION
2-
678578c265278b51c58f28ddbc70ad0e *NAMESPACE
1+
f52e837dffb3a6f463bfda3c51b09b43 *DESCRIPTION
2+
7c8f8c49201deada1e3b7b7608a301bd *NAMESPACE
33
1f620ac03368e1dde3727fb0da261c6a *R/LTT.average.root.R
44
f1bd630ddfdd51e3964ae6fe3dc7a288 *R/LTT.general.R
55
efd1c49a5a54a2bed44fca5acadb4707 *R/LTT.plot.R
@@ -12,6 +12,7 @@ ae2fb235c9584bfbe68ca27f8305d39e *R/LTT.plot.gen.R
1212
02985a27cdc349f044f5b6b0e9bc5f51 *R/corsim.R
1313
3023be9a5172e10b67cb0ad197876bf2 *R/cuttree.R
1414
9bdc81aac90d730775d3f2d2b67df038 *R/extinction.times.R
15+
3706474d957c3835732a41ff3573866f *R/gamStat.R
1516
eb515147d4e144c93f50ac5c981bc939 *R/get.times.polytomy.R
1617
bfbbd691dc6e80866de0c1b74829dc92 *R/getnumbs.R
1718
9f370a5245cd2e717881b85d196d8500 *R/gettimelength.R
@@ -59,7 +60,7 @@ f92f6dc1a380215e7f982a09e160fa3d *R/sim2.bd.reverse.R
5960
cc83536661d4199af6573c02cec0d114 *R/stats.R
6061
41eb03d5f2682b67a64d9fcf057245fd *man/LTT.plot.Rd
6162
f67c38b1be8d400e7abab6db31f38dcf *man/LTT.plot.gen.Rd
62-
bcf853f010ff772f18234a0a145868b5 *man/TreeSim-package.Rd
63+
09b7e9db2225effef239aeeaa331b033 *man/TreeSim-package.Rd
6364
300e04632d541c77d738022fe5c87135 *man/corsim.Rd
6465
1b7a99477ade754d1d20547bc32ca22f *man/cuttree.Rd
6566
afbdd8dde28e2d58c5127461896dbf74 *man/getx.Rd

NAMESPACE

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
2-
export(sim.bd.taxa, sim.bd.age, sim.bd.taxa.age, sim.rateshift.taxa, sim.gsa.taxa,corsim,LTT.plot,LTT.plot.gen,getx,sim.bdtypes.stt.taxa,sim.bdsky.stt,cuttree,sim.genespeciestree,sim.genetree)
1+
export(sim.bd.taxa, sim.bd.age, sim.bd.taxa.age, sim.rateshift.taxa, sim.gsa.taxa, corsim,LTT.plot, LTT.plot.gen, getx, sim.bdtypes.stt.taxa, sim.bdsky.stt, cuttree, sim.genespeciestree, sim.genetree)
32

43
import(ape)
5-
importFrom(laser,gamStat)
64
importFrom(geiger,drop.extinct)
75
importFrom(graphics, axis, lines, locator, plot)
8-
importFrom(stats, reorder, rexp, runif)
6+
importFrom(stats, reorder, rexp, runif, pnorm)

R/gamStat.R

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Function gamStat from R package laser v. 2.4-0 (now arxived).
2+
# calculates Gamma statistic by Pybus & Harvey
3+
gamStat <- function (x, return.list = TRUE)
4+
{
5+
if (!is.numeric(x))
6+
stop("object x not of class 'numeric'")
7+
res <- list()
8+
x <- rev(sort(x))
9+
N <- length(x) + 1
10+
b <- sort(x)
11+
z <- rev(c(b[1], diff(b)))
12+
T <- sum((2:N) * z)
13+
s1 <- (1/(N - 2) * sum(cumsum((2:(N - 1)) * z[1:(N - 2)])) -
14+
T/2)
15+
res$gamstat = s1/(T * sqrt(1/(12 * (N - 2))))
16+
res$pval = pnorm(res$gamstat, mean = 0, sd = 1)
17+
res$test = "one-tailed; Ho: rates have not decreased over time"
18+
if (return.list) {
19+
cat("------------------------------\n")
20+
cat("Calculated gamma:", res$gamstat)
21+
cat("\npvalue:", res$pval, "\n")
22+
cat("test:", res$test, "\n")
23+
cat("*assumes complete taxon sampling.\n")
24+
return(res)
25+
}
26+
else {
27+
return(res$gamstat)
28+
}
29+
}

man/TreeSim-package.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Simulation methods for phylogenetic trees where (i) all tips are sampled at one
1111
\tabular{ll}{
1212
Package: \tab TreeSim\cr
1313
Type: \tab Package\cr
14-
Version: \tab 2.2\cr
15-
Date: \tab 2015-10-05\cr
14+
Version: \tab 2.3\cr
15+
Date: \tab 2017-03-20\cr
1616
License: \tab GPL-2 \cr
1717
LazyLoad: \tab yes\cr
1818
}

0 commit comments

Comments
 (0)