coalescent.intervals: Coalescent Intervals

Description Usage Arguments Value Author(s) See Also Examples

View source: R/coalescent.intervals.R

Description

This function extracts or generates information about coalescent intervals (number of lineages, interval lengths, interval count, total depth) from a phylogenetic tree or a list of internode distances. The input tree needs to be ultra-metric (i.e. clock-like).

Usage

1

Arguments

x

either an ultra-metric phylogenetic tree (i.e. an object of class "phylo") or, alternatively, a vector of interval lengths.

Value

An object of class "coalescentIntervals" with the following entries:

lineages

A vector with the number of lineages at the start of each coalescent interval.

interval.length

A vector with the length of each coalescent interval.

interval.count

The total number of coalescent intervals.

total.depth

The sum of the lengths of all coalescent intervals.

Author(s)

Korbinian Strimmer

See Also

branching.times, collapsed.intervals, read.tree.

Examples

1
2
3
4
5
6
7
data("hivtree.newick") # example tree in NH format
tree.hiv <- read.tree(text = hivtree.newick) # load tree
ci <- coalescent.intervals(tree.hiv) # from tree
ci
data("hivtree.table") # same tree, but in table format
ci <- coalescent.intervals(hivtree.table$size) # from vector of interval lengths
ci

Example output

$lineages
  [1] 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176
 [19] 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158
 [37] 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140
 [55] 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122
 [73] 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104
 [91] 103 102 101 100  99  98  97  96  95  94  93  92  91  90  89  88  87  86
[109]  85  84  83  82  81  80  79  78  77  76  75  74  73  72  71  70  69  68
[127]  67  66  65  64  63  62  61  60  59  58  57  56  55  54  53  52  51  50
[145]  49  48  47  46  45  44  43  42  41  40  39  38  37  36  35  34  33  32
[163]  31  30  29  28  27  26  25  24  23  22  21  20  19  18  17  16  15  14
[181]  13  12  11  10   9   8   7   6   5   4   3   2

$interval.length
  [1] 0.021161 0.028661 0.000236 0.004386 0.003136 0.000040 0.000962 0.000754
  [9] 0.000390 0.002121 0.001165 0.002138 0.000392 0.002225 0.000479 0.000039
 [17] 0.001056 0.000290 0.000094 0.000405 0.000376 0.000892 0.005770 0.000606
 [25] 0.000311 0.000354 0.000049 0.001303 0.000111 0.000191 0.000113 0.000701
 [33] 0.000012 0.000004 0.000343 0.000466 0.000701 0.000001 0.000286 0.000404
 [41] 0.000048 0.000264 0.000382 0.000723 0.000025 0.000063 0.001082 0.000293
 [49] 0.001458 0.000057 0.000268 0.000822 0.000035 0.000141 0.000038 0.000393
 [57] 0.000263 0.000061 0.000697 0.000011 0.000331 0.000198 0.000637 0.000161
 [65] 0.000722 0.000568 0.000016 0.000892 0.000233 0.000124 0.000044 0.000210
 [73] 0.000137 0.000162 0.000066 0.000319 0.000039 0.000226 0.000001 0.000035
 [81] 0.000794 0.000107 0.000162 0.000130 0.000588 0.000128 0.000063 0.000001
 [89] 0.002044 0.000081 0.000115 0.000144 0.000222 0.001136 0.000794 0.000014
 [97] 0.000069 0.000001 0.000437 0.000191 0.000470 0.000654 0.000164 0.000048
[105] 0.000460 0.000098 0.000207 0.000326 0.000001 0.000002 0.000161 0.000873
[113] 0.000141 0.000868 0.000224 0.000342 0.000700 0.000222 0.000151 0.000631
[121] 0.000663 0.001550 0.000323 0.000711 0.000086 0.000651 0.000346 0.000001
[129] 0.000067 0.000255 0.000146 0.000260 0.000169 0.000071 0.000142 0.001229
[137] 0.000106 0.001085 0.000116 0.000204 0.000214 0.000810 0.000112 0.000132
[145] 0.000208 0.000093 0.001182 0.000143 0.000083 0.000003 0.001560 0.000368
[153] 0.000150 0.000537 0.001174 0.000957 0.002662 0.000001 0.000001 0.000095
[161] 0.001008 0.001359 0.000001 0.000103 0.000747 0.000245 0.000829 0.002804
[169] 0.000699 0.000001 0.000119 0.004393 0.002748 0.001334 0.002036 0.001906
[177] 0.001858 0.001173 0.004342 0.009066 0.001531 0.000545 0.009855 0.001407
[185] 0.001059 0.002167 0.011000 0.004665 0.000001 0.007899 0.000001 0.004212

$interval.count
[1] 192

$total.depth
[1] 0.209112

attr(,"class")
[1] "coalescentIntervals"
$lineages
  [1] 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176
 [19] 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158
 [37] 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140
 [55] 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122
 [73] 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104
 [91] 103 102 101 100  99  98  97  96  95  94  93  92  91  90  89  88  87  86
[109]  85  84  83  82  81  80  79  78  77  76  75  74  73  72  71  70  69  68
[127]  67  66  65  64  63  62  61  60  59  58  57  56  55  54  53  52  51  50
[145]  49  48  47  46  45  44  43  42  41  40  39  38  37  36  35  34  33  32
[163]  31  30  29  28  27  26  25  24  23  22  21  20  19  18  17  16  15  14
[181]  13  12  11  10   9   8   7   6   5   4   3   2

$interval.length
  [1] 0.021163 0.028658 0.000237 0.004382 0.003138 0.000046 0.000956 0.000754
  [9] 0.000394 0.002115 0.001170 0.002138 0.000391 0.002226 0.000478 0.000035
 [17] 0.001063 0.000289 0.000093 0.000406 0.000374 0.000894 0.005766 0.000608
 [25] 0.000313 0.000351 0.000051 0.001306 0.000103 0.000196 0.000114 0.000699
 [33] 0.000014 0.000002 0.000340 0.000467 0.000706 0.000001 0.000281 0.000405
 [41] 0.000044 0.000269 0.000381 0.000727 0.000024 0.000061 0.001083 0.000291
 [49] 0.001460 0.000056 0.000268 0.000818 0.000041 0.000138 0.000037 0.000397
 [57] 0.000262 0.000060 0.000699 0.000008 0.000332 0.000197 0.000641 0.000158
 [65] 0.000722 0.000562 0.000023 0.000893 0.000232 0.000122 0.000045 0.000212
 [73] 0.000138 0.000158 0.000070 0.000316 0.000040 0.000221 0.000004 0.000037
 [81] 0.000795 0.000105 0.000162 0.000129 0.000588 0.000132 0.000065 0.000001
 [89] 0.002039 0.000083 0.000108 0.000152 0.000221 0.001135 0.000794 0.000013
 [97] 0.000069 0.000001 0.000439 0.000189 0.000468 0.000656 0.000163 0.000052
[105] 0.000456 0.000100 0.000206 0.000328 0.000001 0.000001 0.000162 0.000872
[113] 0.000142 0.000869 0.000222 0.000342 0.000699 0.000225 0.000149 0.000632
[121] 0.000661 0.001551 0.000325 0.000710 0.000084 0.000656 0.000343 0.000001
[129] 0.000062 0.000260 0.000149 0.000257 0.000169 0.000067 0.000146 0.001228
[137] 0.000108 0.001083 0.000115 0.000206 0.000214 0.000810 0.000113 0.000129
[145] 0.000211 0.000090 0.001179 0.000149 0.000080 0.000006 0.001562 0.000365
[153] 0.000148 0.000540 0.001173 0.000955 0.002667 0.000001 0.000001 0.000092
[161] 0.001009 0.001358 0.000001 0.000103 0.000742 0.000244 0.000833 0.002804
[169] 0.000700 0.000005 0.000116 0.004393 0.002747 0.001338 0.002033 0.001904
[177] 0.001861 0.001175 0.004338 0.009062 0.001534 0.000548 0.009855 0.001403
[185] 0.001063 0.002169 0.010997 0.004668 0.000001 0.007897 0.000001 0.004214

$interval.count
[1] 192

$total.depth
[1] 0.209117

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

ape documentation built on Nov. 17, 2017, 5:18 a.m.