[Deprecated] Function calculates the distribution of genetic distances in a population of viruses with the given parameters

gen_dists(
  mut_rate,
  mean_gens_pdf,
  max_link_gens = 1,
  max_gens = NULL,
  max_dist = NULL
)

Arguments

mut_rate

mean number of mutations per generation, assumed to be Poisson distributed

mean_gens_pdf

the density distribution of the mean number of generations between cases; the index of this vector is assumed to be the discrete distance between cases

max_link_gens

the maximum generations of separation for linked pairs

max_gens

the maximum number of generations to consider, if NULL (default) value is set to the highest number of generations in mean_gens_pdf with a non-zero probability

max_dist

the maximum distance to calculate, if NULL (default) value is set to max_gens * 99.9th percentile of mut_rate Poisson distribution

Value

a data frame with distances and probabilities

See also

Other mutrate_functions: get_optim_roc(), sens_spec_calc(), sens_spec_roc()

Author

Shirlee Wohl and Justin Lessler

Examples

# ebola-like pathogen
R <- 1.5
mut_rate <- 1

# use simulated generation distributions from the provided 'genDistSim' data object
data('genDistSim')
mean_gens_pdf <- as.numeric(genDistSim[genDistSim$R == R, -(1:2)])

# get theoretical genetic distance dist based on mutation rate and generation parameters
gen_dists(mut_rate = mut_rate,
          mean_gens_pdf = mean_gens_pdf,
          max_link_gens = 1)
#> Warning: `gen_dists()` was deprecated in phylosamp 1.0.0.
#>  Please use `gendist_distribution()` instead.
#>        dist   linked_prob unlinked_prob
#>   [1,]    0  3.678794e-01  7.090339e-04
#>   [2,]    1  3.678794e-01  2.120973e-03
#>   [3,]    2  1.839397e-01  3.810662e-03
#>   [4,]    3  6.131324e-02  5.612427e-03
#>   [5,]    4  1.532831e-02  7.590688e-03
#>   [6,]    5  3.065662e-03  9.833909e-03
#>   [7,]    6  5.109437e-04  1.238470e-02
#>   [8,]    7  7.299195e-05  1.524673e-02
#>   [9,]    8  9.123994e-06  1.839695e-02
#>  [10,]    9  1.013777e-06  2.178995e-02
#>  [11,]   10  1.013777e-07  2.535940e-02
#>  [12,]   11  9.216156e-09  2.902012e-02
#>  [13,]   12  7.680130e-10  3.267160e-02
#>  [14,]   13  5.907792e-11  3.620293e-02
#>  [15,]   14  4.219851e-12  3.949867e-02
#>  [16,]   15  2.813234e-13  4.244516e-02
#>  [17,]   16  1.758271e-14  4.493683e-02
#>  [18,]   17  1.034277e-15  4.688211e-02
#>  [19,]   18  5.745985e-17  4.820856e-02
#>  [20,]   19  3.024203e-18  4.886693e-02
#>  [21,]   20  1.512101e-19  4.883396e-02
#>  [22,]   21  7.200483e-21  4.811368e-02
#>  [23,]   22  3.272947e-22  4.673709e-02
#>  [24,]   23  1.423020e-23  4.476029e-02
#>  [25,]   24  5.929251e-25  4.226109e-02
#>  [26,]   25  2.371700e-26  3.933435e-02
#>  [27,]   26  9.121925e-28  3.608642e-02
#>  [28,]   27  3.378491e-29  3.262913e-02
#>  [29,]   28  1.206604e-30  2.907367e-02
#>  [30,]   29  4.160703e-32  2.552495e-02
#>  [31,]   30  1.386901e-33  2.207678e-02
#>  [32,]   31  4.473874e-35  1.880814e-02
#>  [33,]   32  1.398086e-36  1.578079e-02
#>  [34,]   33  4.236623e-38  1.303827e-02
#>  [35,]   34  1.246066e-39  1.060613e-02
#>  [36,]   35  3.560187e-41  8.493426e-03
#>  [37,]   36  9.889410e-43  6.694922e-03
#>  [38,]   37  2.672813e-44  5.193965e-03
#>  [39,]   38  7.033720e-46  3.965563e-03
#>  [40,]   39  1.803518e-47  2.979420e-03
#>  [41,]   40  4.508795e-49  2.202706e-03
#>  [42,]   41  1.099706e-50  1.602374e-03
#>  [43,]   42  2.618348e-52  1.146955e-03
#>  [44,]   43  6.089180e-54  8.078007e-04
#>  [45,]   44  1.383905e-55  5.598156e-04
#>  [46,]   45  3.075344e-57  3.817538e-04
#>  [47,]   46  6.685530e-59  2.561771e-04
#>  [48,]   47  1.422453e-60  1.691776e-04
#>  [49,]   48  2.963444e-62  1.099572e-04
#>  [50,]   49  6.047845e-64  7.034279e-05
#>  [51,]   50  1.209569e-65  4.429686e-05
#>  [52,]   51  2.371704e-67  2.746180e-05
#>  [53,]   52  4.560969e-69  1.676242e-05
#>  [54,]   53  8.605602e-71  1.007507e-05
#>  [55,]   54  1.593630e-72  5.963713e-06
#>  [56,]   55  2.897509e-74  3.476958e-06
#>  [57,]   56  5.174123e-76  1.996890e-06
#>  [58,]   57  9.077409e-78  1.129900e-06
#>  [59,]   58  1.565071e-79  6.299665e-07
#>  [60,]   59  2.652662e-81  3.461366e-07
#>  [61,]   60  4.421103e-83  1.874529e-07
#>  [62,]   61  7.247710e-85  1.000721e-07
#>  [63,]   62  1.168986e-86  5.267117e-08
#>  [64,]   63  1.855533e-88  2.733592e-08
#>  [65,]   64  2.899270e-90  1.399128e-08
#>  [66,]   65  4.460415e-92  7.063281e-09
#>  [67,]   66  6.758204e-94  3.517564e-09
#>  [68,]   67  1.008687e-95  1.728324e-09
#>  [69,]   68  1.483364e-97  8.379472e-10
#>  [70,]   69  2.149802e-99  4.009374e-10
#>  [71,]   70 3.071146e-101  1.893496e-10
#>  [72,]   71 4.325558e-103  8.827521e-11
#>  [73,]   72 6.007719e-105  4.063104e-11
#>  [74,]   73 8.229753e-107  1.846628e-11
#>  [75,]   74 1.112129e-108  8.288191e-12
#>  [76,]   75 1.482838e-110  3.674133e-12
#>  [77,]   76 1.951103e-112  1.608867e-12
#>  [78,]   77 2.533900e-114  6.960005e-13
#>  [79,]   78 3.248590e-116  2.974932e-13
#>  [80,]   79 4.112139e-118  1.256537e-13
#>  [81,]   80 5.140174e-120  5.245135e-14
#>  [82,]   81 6.345893e-122  2.164074e-14
#>  [83,]   82 7.738894e-124  8.826172e-15
#>  [84,]   83 9.323969e-126  3.558829e-15
#>  [85,]   84 1.109996e-127  1.418813e-15
#>  [86,]   85 1.305878e-129  5.593391e-16
#>  [87,]   86 1.518463e-131  2.180742e-16
#>  [88,]   87 1.745360e-133  8.409295e-17
#>  [89,]   88 1.983363e-135  3.207649e-17
#>  [90,]   89 2.228498e-137  1.210407e-17
#>  [91,]   90 2.476109e-139  4.518956e-18
#>  [92,]   91 2.720999e-141  1.669362e-18
#>  [93,]   92 2.957607e-143  6.102565e-19
#>  [94,]   93 3.180223e-145  2.207832e-19
#>  [95,]   94 3.383216e-147  7.905933e-20
#>  [96,]   95 3.561280e-149  2.802304e-20
#>  [97,]   96 3.709666e-151  9.833158e-21
#>  [98,]   97 3.824398e-153  3.416066e-21
#>  [99,]   98 3.902447e-155  1.175045e-21
#> [100,]   99 3.941866e-157  4.002361e-22
#> [101,]  100 3.941866e-159  1.350050e-22
#> [102,]  101 3.902838e-161  4.510172e-23
#> [103,]  102 3.826311e-163  1.492391e-23
#> [104,]  103 3.714865e-165  4.891647e-24
#> [105,]  104 3.571986e-167  1.588351e-24
#> [106,]  105 3.401891e-169  5.109656e-25
#> [107,]  106 3.209332e-171  1.628643e-25
#> [108,]  107 2.999375e-173  5.143790e-26
#> [109,]  108 2.777199e-175  1.609895e-26
#> [110,]  109 2.547889e-177  4.993466e-27
#> [111,]  110 2.316263e-179  1.535075e-27
#> [112,]  111 2.086723e-181  4.677484e-28
#> [113,]  112 1.863146e-183  1.412804e-28
#> [114,]  113 1.648802e-185  4.230289e-29
#> [115,]  114 1.446317e-187  1.255762e-29
#> [116,]  115 1.257667e-189  3.695934e-30
#> [117,]  116 1.084196e-191  1.078576e-30
#> [118,]  117 9.266631e-194  3.121161e-31
#> [119,]  118 7.853077e-196  8.956737e-32
#> [120,]  119 6.599225e-198  2.549062e-32
#> [121,]  120 5.499354e-200  7.195089e-33
#> [122,]  121 4.544921e-202  2.014396e-33
#> [123,]  122 3.725345e-204  5.594150e-34
#> [124,]  123 3.028736e-206  1.541100e-34
#> [125,]  124 2.442529e-208  4.211744e-35
#> [126,]  125 1.954023e-210  1.141967e-35
#> [127,]  126 1.550812e-212  3.072074e-36
#> [128,]  127 1.221112e-214  8.200150e-37
#> [129,]  128 9.539935e-217  2.171948e-37
#> [130,]  129 7.395299e-219  5.708725e-38
#> [131,]  130 5.688691e-221  1.489072e-38
#> [132,]  131 4.342512e-223  3.854812e-39
#> [133,]  132 3.289782e-225  9.904341e-40
#> [134,]  133 2.473520e-227  2.525843e-40
#> [135,]  134 1.845911e-229  6.393945e-41
#> [136,]  135 1.367341e-231  1.606704e-41
#> [137,]  136 1.005398e-233  4.008023e-42
#> [138,]  137 7.338672e-236  9.925992e-43
#> [139,]  138 5.317878e-238  2.440559e-43
#> [140,]  139 3.825811e-240  5.957964e-44
#> [141,]  140 2.732722e-242  1.444180e-44
#> [142,]  141 1.938101e-244  3.476005e-45
#> [143,]  142 1.364860e-246  8.308000e-46
#> [144,]  143 9.544475e-249  1.971923e-46
#> [145,]  144 6.628107e-251  4.648162e-47
#> [146,]  145 4.571109e-253  1.088154e-47
#> [147,]  146 3.130896e-255  2.530098e-48
#> [148,]  147 2.129861e-257  5.843076e-49
#> [149,]  148 1.439096e-259  1.340363e-49
#> [150,]  149 9.658359e-262  3.054212e-50
#> [151,]  150 6.438906e-264  6.913382e-51
#> [152,]  151 4.264176e-266  1.554588e-51
#> [153,]  152 2.805379e-268  3.472894e-52
#> [154,]  153 1.833581e-270  7.707930e-53
#> [155,]  154 1.190637e-272  1.699698e-53
#> [156,]  155 7.681530e-275  3.724015e-54
#> [157,]  156 4.924058e-277  8.107262e-55
#> [158,]  157 3.136342e-279  1.753789e-55
#> [159,]  158 1.985027e-281  3.769971e-56
#> [160,]  159 1.248445e-283  8.053285e-57
#> [161,]  160 7.802778e-286  1.709619e-57
#> [162,]  161 4.846446e-288  3.606891e-58
#> [163,]  162 2.991633e-290  7.562942e-59
#> [164,]  163 1.835358e-292  1.576117e-59
#> [165,]  164 1.119121e-294  3.264693e-60
#> [166,]  165 6.782550e-297  6.721526e-61
#> [167,]  166 4.085873e-299  1.375564e-61
#> [168,]  167 2.446631e-301  2.798312e-62
#> [169,]  168 1.456328e-303  5.658868e-63
#> [170,]  169 8.617324e-306  1.137617e-63
#> [171,]  170 5.069014e-308  2.273580e-64