Skip to contents

Calculate the probability of genotypes based on the product of allele frequencies over all loci.

Usage

pgen(gid, pop = NULL, by_pop = TRUE, log = TRUE, freq = NULL, ...)

Arguments

gid

a genind or genclone object.

pop

either a formula to set the population factor from the strata slot or a vector specifying the population factor for each sample. Defaults to NULL.

by_pop

When this is TRUE (default), the calculation will be done by population.

log

a logical if log =TRUE (default), the values returned will be log(Pgen). If log = FALSE, the values returned will be Pgen.

freq

a vector or matrix of allele frequencies. This defaults to NULL, indicating that the frequencies will be determined via round-robin approach in rraf. If this matrix or vector is not provided, zero-value allele frequencies will automatically be corrected. For details, please see the documentation on correcting rare alleles.

...

options from correcting rare alleles. The default is to correct allele frequencies to 1/n

Value

A vector containing Pgen values per locus for each genotype in the object.

Details

Pgen is the probability of a given genotype occuring in a population assuming HWE. Thus, the value for diploids is

$$P_{gen} = \left(\prod_{i=1}^m p_i\right)2^h$$

where \(p_i\) are the allele frequencies and h is the count of the number of heterozygous sites in the sample (Arnaud-Haond et al. 2007; Parks and Werth, 1993). The allele frequencies, by default, are calculated using a round-robin approach where allele frequencies at a particular locus are calculated on the clone-censored genotypes without that locus.

To avoid issues with numerical precision of small numbers, this function calculates pgen per locus by adding up log-transformed values of allele frequencies. These can easily be transformed to return the true value (see examples).

Note

For haploids, Pgen at a particular locus is the allele frequency. This function cannot handle polyploids. Additionally, when the argument pop is not NULL, by_pop is automatically TRUE.

References

Arnaud-Haond, S., Duarte, C. M., Alberto, F., & Serrão, E. A. 2007. Standardizing methods to address clonality in population studies. Molecular Ecology, 16(24), 5115-5139.

Parks, J. C., & Werth, C. R. 1993. A study of spatial features of clones in a population of bracken fern, Pteridium aquilinum (Dennstaedtiaceae). American Journal of Botany, 537-544.

Author

Zhian N. Kamvar, Jonah Brooks, Stacy A. Krueger-Hadfield, Erik Sotka

Examples

data(Pram)
head(pgen(Pram, log = FALSE))
#>             PrMS6A1 Pr9C3A1 PrMS39A1 PrMS45A1    PrMS43A1
#> 1411152-10B     0.5     0.5     0.15      0.5 0.111111111
#> 82              0.5     0.5     0.35      0.5 0.111111111
#> 83              0.5     0.5     0.15      0.5 0.002298851
#> 84              0.5     0.5     0.35      0.5 0.004597701
#> 85              0.5     0.5     0.35      0.5 0.222222222
#> 81-NM-1         0.5     0.5     0.35      0.5 0.111111111

# \dontrun{
# You can also supply the observed allele frequencies
pramfreq <- Pram %>% genind2genpop() %>% tab(freq = TRUE)
#> 
#>  Converting data from a genind to a genpop object... 
#> 
#> ...done.
#> 
head(pgen(Pram, log = FALSE, freq = pramfreq))
#>             PrMS6A1 Pr9C3A1  PrMS39A1 PrMS45A1    PrMS43A1
#> 1411152-10B     0.5     0.5 0.1301308      0.5 0.048799049
#> 82              0.5     0.5 0.3664209      0.5 0.129488704
#> 83              0.5     0.5 0.1301308      0.5 0.011771700
#> 84              0.5     0.5 0.3664209      0.5 0.001355529
#> 85              0.5     0.5 0.3664209      0.5 0.134197384
#> 81-NM-1         0.5     0.5 0.3664209      0.5 0.129488704

# You can get the Pgen values over all loci by summing over the logged results:
pgen(Pram, log = TRUE) %>%  # calculate pgen matrix
  rowSums(na.rm = TRUE) %>% # take the sum of each row
  exp()                     # take the exponent of the results
#>             1411152-10B                      82                      83 
#>            2.083333e-03            4.861111e-03            4.310345e-05 
#>                      84                      85                 81-NM-1 
#>            2.011494e-04            9.722222e-03            4.861111e-03 
#>               06-1413-1               07-83-7-A         ODA-06-1029-82B 
#>            4.185268e-03            4.715795e-04            4.185268e-03 
#>         ODA-06-1029-82C        ODA-06-1029-109A        ODA-06-1029-109B 
#>            4.185268e-03            4.185268e-03            4.185268e-03 
#>                118-28-A             08-206-44-B             08-206-44-D 
#>            4.185268e-04            1.395089e-03            1.395089e-03 
#>             08-206-44-E                 351-5-A                 351-5-C 
#>            1.395089e-03            1.771191e-05            1.771191e-05 
#>                 351-5-D                 351-5-E                 04-76-C 
#>            1.771191e-05            1.771191e-05            5.580357e-04 
#>               04-335-2A               04-189-B4            03-74-N10A-B 
#>            4.185268e-03            8.370536e-04            8.370536e-04 
#>              05-2033-72              05-2033-73              05-2086-12 
#>            4.715795e-04            4.715795e-04            1.395089e-03 
#>              05-2086-20              05-2086-31              05-2086-34 
#>            4.715795e-04            1.571932e-04            1.395089e-03 
#>               05-2088-3                   06-30                 06-81-2 
#>            4.185268e-03            4.185268e-03            1.395089e-03 
#>             06-1036-71B             06-1036-71C            06-1029-122D 
#>            4.185268e-03            4.185268e-03            4.185268e-03 
#>            06-1029-122C            06-1029-122A             06-1029-98C 
#>            4.185268e-04            4.185268e-04            1.771191e-05 
#>              06-1027-90               1369017-9               1352535-6 
#>            4.185268e-03            4.861111e-03            4.861111e-03 
#>              1343990-17               1344272-8             1411152-10A 
#>            1.005747e-04            4.861111e-03            2.083333e-03 
#>              1341321-16               1418983-2               1402871-B 
#>            4.161712e-06            1.041667e-03            2.011494e-04 
#>               1373915-5              1343990-10              1360295-17 
#>            2.011494e-04            4.861111e-03            2.011494e-04 
#>              1341321-32               1339849-3               1339849-5 
#>            2.011494e-04            4.861111e-03            4.861111e-03 
#>               1339849-6               1339849-7               1339849-8 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>              1339849-10              1339849-12              1339849-13 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>              1339849-15              1339849-16              1339849-17 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                 1429425               07-83-7-B              07-83-37-D 
#>            4.861111e-03            1.395089e-03            4.185268e-03 
#>              07-83-38-B              07-83-38-D               1370431-1 
#>            4.185268e-03            4.185268e-04            9.722222e-03 
#>               1370431-2               1370431-3               1370431-4 
#>            9.722222e-03            2.011494e-04            2.011494e-04 
#>               1370431-5               1428631-1                04-278-3 
#>            9.722222e-03            1.005747e-04            4.185268e-03 
#>               04-335-2B               04-335-2C               1314176-9 
#>            4.185268e-03            3.143863e-05            4.861111e-03 
#>              1314176-13                 1387968                 1418886 
#>            4.861111e-03            1.005747e-04            2.011494e-04 
#>                  04-83D              Phytr-06-4             Phytr-0-217 
#>            5.580357e-04            2.430556e-03            4.861111e-03 
#>                  NOR1.2                  MCK1.1                  MCK1.2 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>    4123.100000000000364              07-1161-1C              07-1161-1E 
#>            1.571932e-04            8.370536e-03            4.185268e-03 
#>              07-1161-4A              07-1161-4B             07-1161-3-1 
#>            4.185268e-03            1.395089e-03            4.185268e-03 
#>             07-1161-3-2             07-1161-3-3              07-1161-5A 
#>            4.185268e-03            4.185268e-03            1.395089e-03 
#>              07-1161-5D              1314070-20               07-1240-1 
#>            1.395089e-03            4.861111e-03            4.185268e-03 
#>                 08-15-1                 08-16-1              1368791-19 
#>            4.185268e-03            4.185268e-03            2.083333e-03 
#>              1368791-21               1429891-1               1429891-2 
#>            1.041667e-03            2.083333e-03            8.620690e-05 
#>               1429891-3               1429891-4               1429891-6 
#>            4.861111e-03            2.083333e-03            2.083333e-03 
#>               1429891-7              1429891-10              1429891-11 
#>            2.083333e-03            2.083333e-03            2.083333e-03 
#>              1437044-28              1454471-29              1454471-31 
#>            8.620690e-05            1.783591e-06            1.783591e-06 
#>               1309326-1                 1480397               1368791-2 
#>            4.861111e-03            2.083333e-03            1.005747e-04 
#>               1281744-1               1281744-3               1281744-5 
#>            2.083333e-03            2.083333e-03            1.041667e-03 
#>               1281744-6               1281744-7               1281744-9 
#>            2.083333e-03            8.620690e-05            4.166667e-03 
#>              1281744-10              1281744-15              1281744-16 
#>            2.083333e-03            2.083333e-03            4.166667e-03 
#>              1281744-21              1454527-12               1480844-4 
#>            2.083333e-03            4.861111e-03            4.861111e-03 
#>               1480844-5               1480844-8              1480844-10 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>               1281744-4               1480841-6               1281789-1 
#>            2.083333e-03            2.083333e-03            2.083333e-03 
#>               1281789-2              1431833-31              1431833-32 
#>            2.083333e-03            4.861111e-03            4.861111e-03 
#>              1431833-39              1309305-21                118-28-B 
#>            4.861111e-03            2.011494e-04            4.185268e-03 
#>                118-28-E                134-19-E                134-20-E 
#>            4.185268e-04            8.370536e-03            4.185268e-03 
#>          Pr 519- LTR1.2          Pr 520- MCK1.1            09-133-4 ODA 
#>            9.722222e-03            4.861111e-03            1.395089e-03 
#>        SOD OR 10-59-3-A        SOD OR 10-59-3-D        SOD OR 10-59-3-E 
#>            4.185268e-03            4.185268e-03            4.185268e-03 
#>        SOD OR 10-59-3-F        SOD OR 10-59-3-H                  Pr 731 
#>            4.185268e-03            4.185268e-03            5.208333e-04 
#>                  Pr 732                  Pr 733                  Pr 734 
#>            5.208333e-04            1.215278e-03            1.215278e-03 
#>                  Pr 735              1441558-37              1441558-39 
#>            1.215278e-03            4.861111e-03            9.722222e-03 
#>              1469925-55               1538371-8              1560692-17 
#>            1.783591e-06            9.722222e-03            1.340996e-04 
#>              1623730-36               1623827-6              1631078-10 
#>            9.722222e-03            9.722222e-03            4.861111e-03 
#>              1631078-12 #4177 Blomquist back up               1631081-1 
#>            9.722222e-03            4.861111e-03            4.861111e-03 
#>               1631081-2               1631081-3              1631081-15 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>              1631081-17              1631081-22               1644850-1 
#>            9.722222e-03            4.861111e-03            9.722222e-03 
#>               1644850-2               1644850-4               1644850-5 
#>            9.722222e-03            9.722222e-03            9.722222e-03 
#>               1644850-6               1644850-7               1644850-8 
#>            9.722222e-03            4.861111e-03            9.722222e-03 
#>              1644856-18              1644856-35               1341878-7 
#>            9.722222e-03            9.722222e-03            8.620690e-05 
#>              1341878-49                 1365048                 1496607 
#>            2.083333e-03            2.011494e-04            2.011494e-04 
#>              1560191-36               1583329-B               1583329-C 
#>            4.161712e-06            2.011494e-04            4.861111e-03 
#>                 1596853                 1596854               1621925-9 
#>            9.722222e-03            8.620690e-05            9.722222e-03 
#>              1621925-11               1621926-8               1626660-3 
#>            9.722222e-03            9.722222e-03            9.722222e-03 
#>                 1625769              1626651-10               1626656-1 
#>            2.011494e-04            9.722222e-03            9.722222e-03 
#>               1644994-2              PC#11-1366                ODA 81-8 
#>            9.722222e-03            4.861111e-03            1.771191e-05 
#>                ODA 81-9               ODA 81-37               ODA 114-6 
#>            1.771191e-05            1.771191e-05            1.771191e-05 
#>                  120187                  120189                  120231 
#>            3.143863e-05            4.861111e-03            2.011494e-04 
#>              1404252-18              1497058-26               1644623-8 
#>            2.011494e-04            8.620690e-05            2.011494e-04 
#>              1644623-26          230P06005897-8          230P06005897-9 
#>            4.161712e-06            2.011494e-04            2.011494e-04 
#>         230P06005898-20         230P06005898-21                10998-V2 
#>            2.011494e-04            2.011494e-04            1.571932e-05 
#>                  1004.1                  1008.1                  1019.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  1021.1                  1030.1                  1031.1 
#>            3.128552e-05            1.962943e-02            1.962943e-02 
#>                  1032.1                  1033.1                    1041 
#>            1.962943e-02            1.877131e-04            1.962943e-02 
#>                    1044                    1055                  2029.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2043.1                  2091.1                    2092 
#>            1.962943e-02            1.962943e-02            1.673328e-04 
#>                    2096                  2099.1                  2108.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2108.2                  2110.4                  4088.1 
#>            1.877131e-04            1.962943e-02            3.271572e-03 
#>                  4089.1                    4120                  4122.4 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4131                  4143.1                  4144.1 
#>            1.962943e-02            3.271572e-03            1.962943e-02 
#>                  4146.1                    4154                  4158.2 
#>            1.962943e-02            3.128552e-05            1.962943e-02 
#>                  4167.1                  4168.2                  4169.1 
#>            1.877131e-04            1.877131e-04            1.962943e-02 
#>                  4172.2                  4173.2                  5013.1 
#>            1.962943e-02            3.271572e-03            1.962943e-02 
#>                    5019                  1020.1                  2018.1 
#>            1.962943e-02            1.138507e-02            1.962943e-02 
#>                  2148.1                  2153.3                  2157.3 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2176                    2178                    2179 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2180                    2181                    2183 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2184                    2190                    2192 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2193                    2194                    2195 
#>            1.962943e-02            1.795071e-06            1.962943e-02 
#>                    2206                    2220                    4215 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4242                  4251.1                  4252.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4280                    4297                  4301.1 
#>            1.877131e-04            1.877131e-04            1.877131e-04 
#>                  4318.1                  4320.1                    5410 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  5448.1                  5449.1                    5450 
#>            1.962943e-02            1.673328e-04            1.962943e-02 
#>                    5451                    5464                    5467 
#>            1.877131e-04            1.962943e-02            1.795071e-06 
#>             WA12-101402              WA9-111302                    2027 
#>            1.269976e-02            2.024096e-05            1.600177e-06 
#>                    1105                    2222                  2234.1 
#>            1.962943e-02            1.962943e-02            3.271572e-03 
#>                  2234.2                  2235.1                  2235.2 
#>            3.128552e-05            3.271572e-03            1.877131e-04 
#>                    2236                 2236.10                  2236.6 
#>            1.877131e-04            1.962943e-02            1.962943e-02 
#>                  2236.7                  2243.1                  2243.3 
#>            1.962943e-02            1.877131e-04            1.962943e-02 
#>                  2243.5                  2243.6                  2243.8 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2271                    2274                    2295 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2336.1                  2336.2                  2336.3 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2336.4                  2336.5                    2340 
#>            1.962943e-02            1.962943e-02            1.795071e-06 
#>                    2344                    2402                  2404.1 
#>            1.962943e-02            3.271572e-03            1.962943e-02 
#>                    2424                    2542                    2552 
#>            1.962943e-02            1.620370e-03            1.962943e-02 
#>                  2554.4                  2554.5                    2572 
#>            1.962943e-02            1.877131e-04            1.308629e-04 
#>                    2598                  2611.1                  2611.2 
#>            1.877131e-04            1.962943e-02            1.962943e-02 
#>                  2611.3                    2615                  2617.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2617.2                  2617.3                  2622.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2622.2                  2622.3                    2624 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2628                    2631                    2634 
#>            1.962943e-02            1.795071e-06            1.308629e-04 
#>                  2641.1                  2641.2                    2642 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2643                    2644                  2644.1 
#>            1.877131e-04            1.962943e-02            1.962943e-02 
#>                  2644.2                  2644.3                    2647 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2647.1                  2647.2                    2648 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2649                  2649.1                    4239 
#>            3.271572e-03            1.962943e-02            1.962943e-02 
#>                    4240                    4347                    4349 
#>            1.962943e-02            1.795071e-06            1.673328e-04 
#>                    4351                    4352                    4353 
#>            3.271572e-03            3.271572e-03            3.271572e-03 
#>                    4354                    4355                    4358 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4359                    4361                    4362 
#>            1.877131e-04            1.877131e-04            1.962943e-02 
#>                    4364                    4367                    4375 
#>            1.877131e-04            3.128552e-05            3.271572e-03 
#>                    4377                    4378                    4379 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4380                    4382                    4383 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4396                  4400.1             WA12-030403 
#>            1.877131e-04            3.128552e-05            1.269976e-02 
#>           WA12-1-101403           WA12-1-111003             WA12-112403 
#>            1.269976e-02            1.269976e-02            1.269976e-02 
#>           WA12-2-031803           WA12-2-111003           WA12-3-091603 
#>            1.269976e-02            1.269976e-02            1.269976e-02 
#>           WA12-3-111003           WA12-4-081803           WA15-1-031803 
#>            1.269976e-02            1.269976e-02            1.161367e-06 
#>           WA15-3-080403            WA1-7-031803            WA4-4-031803 
#>            5.474034e-03            2.116626e-03            1.269976e-02 
#>            WA9.1-030403       WA9-081803 = 1712                    2234 
#>            2.024096e-05            1.214458e-04            7.180284e-08 
#>                 2222.12                    2294                    2452 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2486                    2561                    2562 
#>            1.962943e-02            7.851772e-04            7.851772e-04 
#>                    2595                    2849                    2850 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2851                  2965.2                    2976 
#>            1.962943e-02            1.877131e-04            1.962943e-02 
#>                    2985                    2987                    2988 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    4542                    9004                    9013 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    9022                    9023                    9032 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    9034                    9038        WA1.2BA15-030104 
#>            1.877131e-04            1.962943e-02            1.214458e-04 
#>              WA1-011304              WA1-032204             WA12-011304 
#>            1.269976e-02            1.214458e-04            1.269976e-02 
#>             WA12-012604             WA12-040504             WA12-051704 
#>            1.269976e-02            1.269976e-02            2.116626e-03 
#>           WA12-2-032204             WA16-011304             WA27-040504 
#>            1.214458e-04            1.269976e-02            1.269976e-02 
#>             WA27-071904              WA9-020904                    4384 
#>            1.269976e-02            1.269976e-02            1.795071e-06 
#>             WA27-040205                    9488                   11075 
#>            1.269976e-02            6.392045e-03            1.420455e-03 
#>                 10490.1                 10490.2                 10490.3 
#>            1.041667e-02            1.041667e-02            1.041667e-02 
#>                 10490.4                 10491.1                 10491.2 
#>            1.041667e-02            2.083333e-02            2.083333e-02 
#>                 10491.3                 10492.1                 10492.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10492.3                 10492.4                 10492.5 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10492.6                   10493                 10496.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10496.2                 10496.3                 10497.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10497.2                 10497.3                 11745.1 
#>            6.313131e-04            2.083333e-02            2.083333e-02 
#>                 11745.2                 11745.3                 11761.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11761.2                 11761.3                 11761.4 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11761.5                 11762.1                 11762.2 
#>            6.313131e-04            2.083333e-02            2.083333e-02 
#>                 11762.3                 11803.1                 11803.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11803.3                 11805.1                 11805.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11805.3                   11806                 11807.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11807.2                 11807.3                 11808.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11808.2                 11808.3                 11810.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11810.2                 11810.3                 11812.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11812.2                 11812.3                 11819.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11819.2                 11819.3                 11819.4 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11819.5                 11819.6                 11855.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11855.2                 11913.1                 11913.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11913.3                 11914.1                 11914.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11914.3                   11349                   11372 
#>            2.083333e-02            7.520053e-04            1.671123e-04 
#>              11798x7535              11799x7517                10794-V5 
#>            1.041667e-02            2.083333e-02            3.240741e-04 
#>                11466-V2                11466-V5                11540-V3 
#>            8.847122e-05            8.847122e-05            3.240741e-03 
#>                   11160                   11955                   13150 
#>            2.083333e-02            2.083333e-02            1.041667e-02 
#>                 13153.1                 13153.2                   13155 
#>            4.861111e-03            4.861111e-03            2.083333e-02 
#>                   13184                   13185                   13205 
#>            2.083333e-02            1.190476e-03            2.083333e-02 
#>                   13206                   13207                   13228 
#>            2.083333e-02            1.041667e-02            1.041667e-02 
#>                   13154                   11956                   13226 
#>            2.083333e-02            2.083333e-02            1.041667e-02 
#>                   13227                  2043_1                  2138_1 
#>            1.041667e-02            1.962943e-02            1.962943e-02 
#>                  2157_3                   11001                   13592 
#>            1.877131e-04            9.722222e-04            4.861111e-03 
#>            WA12S-091713              13746-9105              13766-9120 
#>            1.673328e-04            4.166667e-03            1.877131e-04 
#>              13767-9121              13773-9138              13774-9174 
#>            1.877131e-04            1.962943e-02            1.041141e-06 
#>              13778-9175              13780-9139              13781-9123 
#>            3.128552e-05            1.962943e-02            1.673328e-04 
#>              13782-9140              13785-9142              13786-9143 
#>            1.962943e-02            4.629630e-04            4.629630e-04 
#>              13787-9144              13788-9145              13789-9146 
#>            4.629630e-04            2.558480e-04            4.861111e-03 
#>              13790-9147                   13835              13844-9176 
#>            2.558480e-04            3.086420e-04            1.543210e-04 
#>              13845-9124              13846-9108              13847-9109 
#>            4.861111e-03            3.240741e-03            2.558480e-04 
#>              13849-9110              13850-9111              13859-9112 
#>            2.083333e-02            3.125000e-02            2.083333e-02 
#>              13860-9148              13861-9113              13862-9114 
#>            2.083333e-02            1.190476e-03            1.190476e-03 
#>              13863-9115              13867-9117              13870-9149 
#>            2.083333e-02            5.208333e-03            1.877131e-04 
#>              13875-9132              13878-9151              13879-9152 
#>            1.877131e-04            4.861111e-03            4.050926e-03 
#>              13881-9153              13883-9133              13885-9177 
#>            4.873294e-06            7.716049e-05            3.240741e-04 
#>              13886-9154              13887-9202                   13888 
#>            1.620370e-03            3.240741e-04            5.692535e-03 
#>              13889-9161              13891-9162              13893-9178 
#>            3.271572e-03            9.722222e-04            2.430556e-03 
#>              13895-9155              13900-9156              13902-9157 
#>            4.861111e-03            4.861111e-03            7.520053e-04 
#>              13903-9179              13904-9180              13905-9181 
#>            1.138507e-02            1.410160e-03            7.520053e-04 
#>              13906-9163              13908-9164              13909-9158 
#>            7.520053e-04            7.520053e-04            1.877131e-04 
#>                   13916              13917-9182              13918-9203 
#>            2.430556e-03            4.861111e-03            4.861111e-03 
#>              13919-9183              13920-9159              13927-9185 
#>            4.861111e-03            4.861111e-03            1.041667e-02 
#>              13928-9186              13929-9187            13930-A-9188 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 13930-B              13932-9189              13933-9190 
#>            2.083333e-02            4.861111e-03            1.620370e-03 
#>                   13934              13942-9194                   13945 
#>            7.812500e-03            1.388889e-04            3.086420e-04 
#>              13951-9195              13952-9196              13954-9197 
#>            1.785714e-03            2.083333e-02            1.190476e-03 
#>              13955-9198              13957-9199              13958-9200 
#>            1.190476e-03            2.083333e-02            1.785714e-03 
#>              13959-9206              13960-9207              14001-9208 
#>            3.125000e-02            3.125000e-02            3.240741e-03 
#>                   14002              14003-9209                   14004 
#>            4.861111e-03            2.916667e-03            9.722222e-04 
#>                   14005              14006-9210              14007-9211 
#>            1.620370e-03            1.620370e-03            1.620370e-03 
#>              14008-9212                   14023                   14024 
#>            1.620370e-03            1.041667e-02            1.785714e-03 
#>                   14028                   14033                   14035 
#>            2.083333e-02            9.259259e-05            3.086420e-04 
#>                   14036                   14056              13872-9150 
#>            9.259259e-05            2.916667e-03            1.962943e-02 
#>                   13893              13931-9204                   13600 
#>            4.861111e-03            2.430556e-03            3.271572e-03 
#>                   13632                   13635                   13655 
#>            1.671123e-04            4.166667e-03            2.558480e-04 
#>                   13661                   13662                   13663 
#>            4.861111e-03            3.240741e-03            1.535088e-04 
#>                   13690                   13692                   13694 
#>            4.873294e-06            4.629630e-05            9.722222e-04 
#>                   13695                   13698                   13699 
#>            5.116959e-05            6.481481e-04            4.861111e-03 
#>                   13711                   13716                   13735 
#>            9.259259e-05            1.535088e-04            4.861111e-03 
#>                   13737                   13738                   13739 
#>            1.620370e-03            3.240741e-03            3.240741e-03 
#>                   13744                   13747                   13748 
#>            3.240741e-03            4.166667e-03            4.166667e-03 
#>                   13749                   13751                   13753 
#>            2.083333e-03            4.166667e-03            4.166667e-03 
#>              H-2-040113                   13801                   13802 
#>            1.671123e-04            5.116959e-05            1.620370e-03 
#>                   13805                   13824                   13825 
#>            5.116959e-05            4.166667e-03            1.877131e-04 
#>                   13826                   13827                   13828 
#>            1.795071e-06            1.877131e-04            4.166667e-03 
#>                   13830                   13831                   13832 
#>            1.962943e-02            8.847122e-05            4.166667e-03 
#>                   13837                   13838                   13839 
#>            4.166667e-03            4.166667e-03            4.166667e-03 
#>                   13840                   13841                   13842 
#>            5.208333e-04            4.166667e-03            7.520053e-04 
#>                  2157-3              11001-8874                  2027-1 
#>            1.877131e-04            9.722222e-04            1.962943e-02 
#>                  2138-1                   13873                   14040 
#>            1.962943e-02            1.877131e-04            4.873294e-06 
#>                   14041                   14042                   14043 
#>            9.259259e-05            1.624431e-06            9.259259e-05 
#>                   14044                   14046                   14047 
#>            1.543210e-04            4.861111e-03            7.520053e-04 
#>                   14049                   14077                   14078 
#>            1.620370e-03            8.847122e-05            8.847122e-05 
#>                   14079                   14080                   14081 
#>            8.847122e-05            8.847122e-05            8.847122e-05 
#>                   14082                   14083                   14085 
#>            8.847122e-05            8.847122e-05            2.916667e-03 
#>                   14092                   14093                   14107 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14108                   14112                   14113 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14114                   14115                   14116 
#>            2.558480e-04            3.240741e-03            2.314815e-04 
#>                   14119                   14120                   14121 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14122                   14123                   14131 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14132                 14045-a                 14045-b 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   13971                   13977                   14129 
#>            7.520053e-04            1.620370e-03            1.420455e-03 
#>                   14135                   14136                 14137.1 
#>            1.420455e-03            8.847122e-05            8.847122e-05 
#>                   14138                   14139                   14141 
#>            2.893519e-03            8.847122e-05            4.861111e-03 
#>                   14142                   14145                   14149 
#>            1.944444e-03            5.208333e-04            4.861111e-03 
#>                   14151                   14152                   14153 
#>            7.520053e-04            7.520053e-04            7.520053e-04 
#>                   14156                   14159                   14160 
#>            1.620370e-03            2.916667e-03            7.520053e-04 
#>                   14161                   14162                   14164 
#>            1.877131e-04            7.520053e-04            6.392045e-03 
#>                   14165                   14167                   14168 
#>            2.916667e-03            1.620370e-03            4.861111e-03 
#>                   14169                   14171                   14172 
#>            2.558480e-04            4.861111e-03            1.279240e-04 
#>                   14174                   14175             WA84-121613 
#>            1.795071e-06            9.259259e-05            4.861111e-03 

# You can also take the product of the non-logged results:
apply(pgen(Pram, log = FALSE), 1, prod, na.rm = TRUE)
#>             1411152-10B                      82                      83 
#>            2.083333e-03            4.861111e-03            4.310345e-05 
#>                      84                      85                 81-NM-1 
#>            2.011494e-04            9.722222e-03            4.861111e-03 
#>               06-1413-1               07-83-7-A         ODA-06-1029-82B 
#>            4.185268e-03            4.715795e-04            4.185268e-03 
#>         ODA-06-1029-82C        ODA-06-1029-109A        ODA-06-1029-109B 
#>            4.185268e-03            4.185268e-03            4.185268e-03 
#>                118-28-A             08-206-44-B             08-206-44-D 
#>            4.185268e-04            1.395089e-03            1.395089e-03 
#>             08-206-44-E                 351-5-A                 351-5-C 
#>            1.395089e-03            1.771191e-05            1.771191e-05 
#>                 351-5-D                 351-5-E                 04-76-C 
#>            1.771191e-05            1.771191e-05            5.580357e-04 
#>               04-335-2A               04-189-B4            03-74-N10A-B 
#>            4.185268e-03            8.370536e-04            8.370536e-04 
#>              05-2033-72              05-2033-73              05-2086-12 
#>            4.715795e-04            4.715795e-04            1.395089e-03 
#>              05-2086-20              05-2086-31              05-2086-34 
#>            4.715795e-04            1.571932e-04            1.395089e-03 
#>               05-2088-3                   06-30                 06-81-2 
#>            4.185268e-03            4.185268e-03            1.395089e-03 
#>             06-1036-71B             06-1036-71C            06-1029-122D 
#>            4.185268e-03            4.185268e-03            4.185268e-03 
#>            06-1029-122C            06-1029-122A             06-1029-98C 
#>            4.185268e-04            4.185268e-04            1.771191e-05 
#>              06-1027-90               1369017-9               1352535-6 
#>            4.185268e-03            4.861111e-03            4.861111e-03 
#>              1343990-17               1344272-8             1411152-10A 
#>            1.005747e-04            4.861111e-03            2.083333e-03 
#>              1341321-16               1418983-2               1402871-B 
#>            4.161712e-06            1.041667e-03            2.011494e-04 
#>               1373915-5              1343990-10              1360295-17 
#>            2.011494e-04            4.861111e-03            2.011494e-04 
#>              1341321-32               1339849-3               1339849-5 
#>            2.011494e-04            4.861111e-03            4.861111e-03 
#>               1339849-6               1339849-7               1339849-8 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>              1339849-10              1339849-12              1339849-13 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>              1339849-15              1339849-16              1339849-17 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                 1429425               07-83-7-B              07-83-37-D 
#>            4.861111e-03            1.395089e-03            4.185268e-03 
#>              07-83-38-B              07-83-38-D               1370431-1 
#>            4.185268e-03            4.185268e-04            9.722222e-03 
#>               1370431-2               1370431-3               1370431-4 
#>            9.722222e-03            2.011494e-04            2.011494e-04 
#>               1370431-5               1428631-1                04-278-3 
#>            9.722222e-03            1.005747e-04            4.185268e-03 
#>               04-335-2B               04-335-2C               1314176-9 
#>            4.185268e-03            3.143863e-05            4.861111e-03 
#>              1314176-13                 1387968                 1418886 
#>            4.861111e-03            1.005747e-04            2.011494e-04 
#>                  04-83D              Phytr-06-4             Phytr-0-217 
#>            5.580357e-04            2.430556e-03            4.861111e-03 
#>                  NOR1.2                  MCK1.1                  MCK1.2 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>    4123.100000000000364              07-1161-1C              07-1161-1E 
#>            1.571932e-04            8.370536e-03            4.185268e-03 
#>              07-1161-4A              07-1161-4B             07-1161-3-1 
#>            4.185268e-03            1.395089e-03            4.185268e-03 
#>             07-1161-3-2             07-1161-3-3              07-1161-5A 
#>            4.185268e-03            4.185268e-03            1.395089e-03 
#>              07-1161-5D              1314070-20               07-1240-1 
#>            1.395089e-03            4.861111e-03            4.185268e-03 
#>                 08-15-1                 08-16-1              1368791-19 
#>            4.185268e-03            4.185268e-03            2.083333e-03 
#>              1368791-21               1429891-1               1429891-2 
#>            1.041667e-03            2.083333e-03            8.620690e-05 
#>               1429891-3               1429891-4               1429891-6 
#>            4.861111e-03            2.083333e-03            2.083333e-03 
#>               1429891-7              1429891-10              1429891-11 
#>            2.083333e-03            2.083333e-03            2.083333e-03 
#>              1437044-28              1454471-29              1454471-31 
#>            8.620690e-05            1.783591e-06            1.783591e-06 
#>               1309326-1                 1480397               1368791-2 
#>            4.861111e-03            2.083333e-03            1.005747e-04 
#>               1281744-1               1281744-3               1281744-5 
#>            2.083333e-03            2.083333e-03            1.041667e-03 
#>               1281744-6               1281744-7               1281744-9 
#>            2.083333e-03            8.620690e-05            4.166667e-03 
#>              1281744-10              1281744-15              1281744-16 
#>            2.083333e-03            2.083333e-03            4.166667e-03 
#>              1281744-21              1454527-12               1480844-4 
#>            2.083333e-03            4.861111e-03            4.861111e-03 
#>               1480844-5               1480844-8              1480844-10 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>               1281744-4               1480841-6               1281789-1 
#>            2.083333e-03            2.083333e-03            2.083333e-03 
#>               1281789-2              1431833-31              1431833-32 
#>            2.083333e-03            4.861111e-03            4.861111e-03 
#>              1431833-39              1309305-21                118-28-B 
#>            4.861111e-03            2.011494e-04            4.185268e-03 
#>                118-28-E                134-19-E                134-20-E 
#>            4.185268e-04            8.370536e-03            4.185268e-03 
#>          Pr 519- LTR1.2          Pr 520- MCK1.1            09-133-4 ODA 
#>            9.722222e-03            4.861111e-03            1.395089e-03 
#>        SOD OR 10-59-3-A        SOD OR 10-59-3-D        SOD OR 10-59-3-E 
#>            4.185268e-03            4.185268e-03            4.185268e-03 
#>        SOD OR 10-59-3-F        SOD OR 10-59-3-H                  Pr 731 
#>            4.185268e-03            4.185268e-03            5.208333e-04 
#>                  Pr 732                  Pr 733                  Pr 734 
#>            5.208333e-04            1.215278e-03            1.215278e-03 
#>                  Pr 735              1441558-37              1441558-39 
#>            1.215278e-03            4.861111e-03            9.722222e-03 
#>              1469925-55               1538371-8              1560692-17 
#>            1.783591e-06            9.722222e-03            1.340996e-04 
#>              1623730-36               1623827-6              1631078-10 
#>            9.722222e-03            9.722222e-03            4.861111e-03 
#>              1631078-12 #4177 Blomquist back up               1631081-1 
#>            9.722222e-03            4.861111e-03            4.861111e-03 
#>               1631081-2               1631081-3              1631081-15 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>              1631081-17              1631081-22               1644850-1 
#>            9.722222e-03            4.861111e-03            9.722222e-03 
#>               1644850-2               1644850-4               1644850-5 
#>            9.722222e-03            9.722222e-03            9.722222e-03 
#>               1644850-6               1644850-7               1644850-8 
#>            9.722222e-03            4.861111e-03            9.722222e-03 
#>              1644856-18              1644856-35               1341878-7 
#>            9.722222e-03            9.722222e-03            8.620690e-05 
#>              1341878-49                 1365048                 1496607 
#>            2.083333e-03            2.011494e-04            2.011494e-04 
#>              1560191-36               1583329-B               1583329-C 
#>            4.161712e-06            2.011494e-04            4.861111e-03 
#>                 1596853                 1596854               1621925-9 
#>            9.722222e-03            8.620690e-05            9.722222e-03 
#>              1621925-11               1621926-8               1626660-3 
#>            9.722222e-03            9.722222e-03            9.722222e-03 
#>                 1625769              1626651-10               1626656-1 
#>            2.011494e-04            9.722222e-03            9.722222e-03 
#>               1644994-2              PC#11-1366                ODA 81-8 
#>            9.722222e-03            4.861111e-03            1.771191e-05 
#>                ODA 81-9               ODA 81-37               ODA 114-6 
#>            1.771191e-05            1.771191e-05            1.771191e-05 
#>                  120187                  120189                  120231 
#>            3.143863e-05            4.861111e-03            2.011494e-04 
#>              1404252-18              1497058-26               1644623-8 
#>            2.011494e-04            8.620690e-05            2.011494e-04 
#>              1644623-26          230P06005897-8          230P06005897-9 
#>            4.161712e-06            2.011494e-04            2.011494e-04 
#>         230P06005898-20         230P06005898-21                10998-V2 
#>            2.011494e-04            2.011494e-04            1.571932e-05 
#>                  1004.1                  1008.1                  1019.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  1021.1                  1030.1                  1031.1 
#>            3.128552e-05            1.962943e-02            1.962943e-02 
#>                  1032.1                  1033.1                    1041 
#>            1.962943e-02            1.877131e-04            1.962943e-02 
#>                    1044                    1055                  2029.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2043.1                  2091.1                    2092 
#>            1.962943e-02            1.962943e-02            1.673328e-04 
#>                    2096                  2099.1                  2108.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2108.2                  2110.4                  4088.1 
#>            1.877131e-04            1.962943e-02            3.271572e-03 
#>                  4089.1                    4120                  4122.4 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4131                  4143.1                  4144.1 
#>            1.962943e-02            3.271572e-03            1.962943e-02 
#>                  4146.1                    4154                  4158.2 
#>            1.962943e-02            3.128552e-05            1.962943e-02 
#>                  4167.1                  4168.2                  4169.1 
#>            1.877131e-04            1.877131e-04            1.962943e-02 
#>                  4172.2                  4173.2                  5013.1 
#>            1.962943e-02            3.271572e-03            1.962943e-02 
#>                    5019                  1020.1                  2018.1 
#>            1.962943e-02            1.138507e-02            1.962943e-02 
#>                  2148.1                  2153.3                  2157.3 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2176                    2178                    2179 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2180                    2181                    2183 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2184                    2190                    2192 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2193                    2194                    2195 
#>            1.962943e-02            1.795071e-06            1.962943e-02 
#>                    2206                    2220                    4215 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4242                  4251.1                  4252.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4280                    4297                  4301.1 
#>            1.877131e-04            1.877131e-04            1.877131e-04 
#>                  4318.1                  4320.1                    5410 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  5448.1                  5449.1                    5450 
#>            1.962943e-02            1.673328e-04            1.962943e-02 
#>                    5451                    5464                    5467 
#>            1.877131e-04            1.962943e-02            1.795071e-06 
#>             WA12-101402              WA9-111302                    2027 
#>            1.269976e-02            2.024096e-05            1.600177e-06 
#>                    1105                    2222                  2234.1 
#>            1.962943e-02            1.962943e-02            3.271572e-03 
#>                  2234.2                  2235.1                  2235.2 
#>            3.128552e-05            3.271572e-03            1.877131e-04 
#>                    2236                 2236.10                  2236.6 
#>            1.877131e-04            1.962943e-02            1.962943e-02 
#>                  2236.7                  2243.1                  2243.3 
#>            1.962943e-02            1.877131e-04            1.962943e-02 
#>                  2243.5                  2243.6                  2243.8 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2271                    2274                    2295 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2336.1                  2336.2                  2336.3 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2336.4                  2336.5                    2340 
#>            1.962943e-02            1.962943e-02            1.795071e-06 
#>                    2344                    2402                  2404.1 
#>            1.962943e-02            3.271572e-03            1.962943e-02 
#>                    2424                    2542                    2552 
#>            1.962943e-02            1.620370e-03            1.962943e-02 
#>                  2554.4                  2554.5                    2572 
#>            1.962943e-02            1.877131e-04            1.308629e-04 
#>                    2598                  2611.1                  2611.2 
#>            1.877131e-04            1.962943e-02            1.962943e-02 
#>                  2611.3                    2615                  2617.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2617.2                  2617.3                  2622.1 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2622.2                  2622.3                    2624 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2628                    2631                    2634 
#>            1.962943e-02            1.795071e-06            1.308629e-04 
#>                  2641.1                  2641.2                    2642 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2643                    2644                  2644.1 
#>            1.877131e-04            1.962943e-02            1.962943e-02 
#>                  2644.2                  2644.3                    2647 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                  2647.1                  2647.2                    2648 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2649                  2649.1                    4239 
#>            3.271572e-03            1.962943e-02            1.962943e-02 
#>                    4240                    4347                    4349 
#>            1.962943e-02            1.795071e-06            1.673328e-04 
#>                    4351                    4352                    4353 
#>            3.271572e-03            3.271572e-03            3.271572e-03 
#>                    4354                    4355                    4358 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4359                    4361                    4362 
#>            1.877131e-04            1.877131e-04            1.962943e-02 
#>                    4364                    4367                    4375 
#>            1.877131e-04            3.128552e-05            3.271572e-03 
#>                    4377                    4378                    4379 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4380                    4382                    4383 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    4396                  4400.1             WA12-030403 
#>            1.877131e-04            3.128552e-05            1.269976e-02 
#>           WA12-1-101403           WA12-1-111003             WA12-112403 
#>            1.269976e-02            1.269976e-02            1.269976e-02 
#>           WA12-2-031803           WA12-2-111003           WA12-3-091603 
#>            1.269976e-02            1.269976e-02            1.269976e-02 
#>           WA12-3-111003           WA12-4-081803           WA15-1-031803 
#>            1.269976e-02            1.269976e-02            1.161367e-06 
#>           WA15-3-080403            WA1-7-031803            WA4-4-031803 
#>            5.474034e-03            2.116626e-03            1.269976e-02 
#>            WA9.1-030403       WA9-081803 = 1712                    2234 
#>            2.024096e-05            1.214458e-04            7.180284e-08 
#>                 2222.12                    2294                    2452 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    2486                    2561                    2562 
#>            1.962943e-02            7.851772e-04            7.851772e-04 
#>                    2595                    2849                    2850 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    2851                  2965.2                    2976 
#>            1.962943e-02            1.877131e-04            1.962943e-02 
#>                    2985                    2987                    2988 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    4542                    9004                    9013 
#>            1.962943e-02            1.962943e-02            1.877131e-04 
#>                    9022                    9023                    9032 
#>            1.962943e-02            1.962943e-02            1.962943e-02 
#>                    9034                    9038        WA1.2BA15-030104 
#>            1.877131e-04            1.962943e-02            1.214458e-04 
#>              WA1-011304              WA1-032204             WA12-011304 
#>            1.269976e-02            1.214458e-04            1.269976e-02 
#>             WA12-012604             WA12-040504             WA12-051704 
#>            1.269976e-02            1.269976e-02            2.116626e-03 
#>           WA12-2-032204             WA16-011304             WA27-040504 
#>            1.214458e-04            1.269976e-02            1.269976e-02 
#>             WA27-071904              WA9-020904                    4384 
#>            1.269976e-02            1.269976e-02            1.795071e-06 
#>             WA27-040205                    9488                   11075 
#>            1.269976e-02            6.392045e-03            1.420455e-03 
#>                 10490.1                 10490.2                 10490.3 
#>            1.041667e-02            1.041667e-02            1.041667e-02 
#>                 10490.4                 10491.1                 10491.2 
#>            1.041667e-02            2.083333e-02            2.083333e-02 
#>                 10491.3                 10492.1                 10492.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10492.3                 10492.4                 10492.5 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10492.6                   10493                 10496.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10496.2                 10496.3                 10497.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 10497.2                 10497.3                 11745.1 
#>            6.313131e-04            2.083333e-02            2.083333e-02 
#>                 11745.2                 11745.3                 11761.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11761.2                 11761.3                 11761.4 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11761.5                 11762.1                 11762.2 
#>            6.313131e-04            2.083333e-02            2.083333e-02 
#>                 11762.3                 11803.1                 11803.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11803.3                 11805.1                 11805.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11805.3                   11806                 11807.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11807.2                 11807.3                 11808.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11808.2                 11808.3                 11810.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11810.2                 11810.3                 11812.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11812.2                 11812.3                 11819.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11819.2                 11819.3                 11819.4 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11819.5                 11819.6                 11855.1 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11855.2                 11913.1                 11913.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11913.3                 11914.1                 11914.2 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 11914.3                   11349                   11372 
#>            2.083333e-02            7.520053e-04            1.671123e-04 
#>              11798x7535              11799x7517                10794-V5 
#>            1.041667e-02            2.083333e-02            3.240741e-04 
#>                11466-V2                11466-V5                11540-V3 
#>            8.847122e-05            8.847122e-05            3.240741e-03 
#>                   11160                   11955                   13150 
#>            2.083333e-02            2.083333e-02            1.041667e-02 
#>                 13153.1                 13153.2                   13155 
#>            4.861111e-03            4.861111e-03            2.083333e-02 
#>                   13184                   13185                   13205 
#>            2.083333e-02            1.190476e-03            2.083333e-02 
#>                   13206                   13207                   13228 
#>            2.083333e-02            1.041667e-02            1.041667e-02 
#>                   13154                   11956                   13226 
#>            2.083333e-02            2.083333e-02            1.041667e-02 
#>                   13227                  2043_1                  2138_1 
#>            1.041667e-02            1.962943e-02            1.962943e-02 
#>                  2157_3                   11001                   13592 
#>            1.877131e-04            9.722222e-04            4.861111e-03 
#>            WA12S-091713              13746-9105              13766-9120 
#>            1.673328e-04            4.166667e-03            1.877131e-04 
#>              13767-9121              13773-9138              13774-9174 
#>            1.877131e-04            1.962943e-02            1.041141e-06 
#>              13778-9175              13780-9139              13781-9123 
#>            3.128552e-05            1.962943e-02            1.673328e-04 
#>              13782-9140              13785-9142              13786-9143 
#>            1.962943e-02            4.629630e-04            4.629630e-04 
#>              13787-9144              13788-9145              13789-9146 
#>            4.629630e-04            2.558480e-04            4.861111e-03 
#>              13790-9147                   13835              13844-9176 
#>            2.558480e-04            3.086420e-04            1.543210e-04 
#>              13845-9124              13846-9108              13847-9109 
#>            4.861111e-03            3.240741e-03            2.558480e-04 
#>              13849-9110              13850-9111              13859-9112 
#>            2.083333e-02            3.125000e-02            2.083333e-02 
#>              13860-9148              13861-9113              13862-9114 
#>            2.083333e-02            1.190476e-03            1.190476e-03 
#>              13863-9115              13867-9117              13870-9149 
#>            2.083333e-02            5.208333e-03            1.877131e-04 
#>              13875-9132              13878-9151              13879-9152 
#>            1.877131e-04            4.861111e-03            4.050926e-03 
#>              13881-9153              13883-9133              13885-9177 
#>            4.873294e-06            7.716049e-05            3.240741e-04 
#>              13886-9154              13887-9202                   13888 
#>            1.620370e-03            3.240741e-04            5.692535e-03 
#>              13889-9161              13891-9162              13893-9178 
#>            3.271572e-03            9.722222e-04            2.430556e-03 
#>              13895-9155              13900-9156              13902-9157 
#>            4.861111e-03            4.861111e-03            7.520053e-04 
#>              13903-9179              13904-9180              13905-9181 
#>            1.138507e-02            1.410160e-03            7.520053e-04 
#>              13906-9163              13908-9164              13909-9158 
#>            7.520053e-04            7.520053e-04            1.877131e-04 
#>                   13916              13917-9182              13918-9203 
#>            2.430556e-03            4.861111e-03            4.861111e-03 
#>              13919-9183              13920-9159              13927-9185 
#>            4.861111e-03            4.861111e-03            1.041667e-02 
#>              13928-9186              13929-9187            13930-A-9188 
#>            2.083333e-02            2.083333e-02            2.083333e-02 
#>                 13930-B              13932-9189              13933-9190 
#>            2.083333e-02            4.861111e-03            1.620370e-03 
#>                   13934              13942-9194                   13945 
#>            7.812500e-03            1.388889e-04            3.086420e-04 
#>              13951-9195              13952-9196              13954-9197 
#>            1.785714e-03            2.083333e-02            1.190476e-03 
#>              13955-9198              13957-9199              13958-9200 
#>            1.190476e-03            2.083333e-02            1.785714e-03 
#>              13959-9206              13960-9207              14001-9208 
#>            3.125000e-02            3.125000e-02            3.240741e-03 
#>                   14002              14003-9209                   14004 
#>            4.861111e-03            2.916667e-03            9.722222e-04 
#>                   14005              14006-9210              14007-9211 
#>            1.620370e-03            1.620370e-03            1.620370e-03 
#>              14008-9212                   14023                   14024 
#>            1.620370e-03            1.041667e-02            1.785714e-03 
#>                   14028                   14033                   14035 
#>            2.083333e-02            9.259259e-05            3.086420e-04 
#>                   14036                   14056              13872-9150 
#>            9.259259e-05            2.916667e-03            1.962943e-02 
#>                   13893              13931-9204                   13600 
#>            4.861111e-03            2.430556e-03            3.271572e-03 
#>                   13632                   13635                   13655 
#>            1.671123e-04            4.166667e-03            2.558480e-04 
#>                   13661                   13662                   13663 
#>            4.861111e-03            3.240741e-03            1.535088e-04 
#>                   13690                   13692                   13694 
#>            4.873294e-06            4.629630e-05            9.722222e-04 
#>                   13695                   13698                   13699 
#>            5.116959e-05            6.481481e-04            4.861111e-03 
#>                   13711                   13716                   13735 
#>            9.259259e-05            1.535088e-04            4.861111e-03 
#>                   13737                   13738                   13739 
#>            1.620370e-03            3.240741e-03            3.240741e-03 
#>                   13744                   13747                   13748 
#>            3.240741e-03            4.166667e-03            4.166667e-03 
#>                   13749                   13751                   13753 
#>            2.083333e-03            4.166667e-03            4.166667e-03 
#>              H-2-040113                   13801                   13802 
#>            1.671123e-04            5.116959e-05            1.620370e-03 
#>                   13805                   13824                   13825 
#>            5.116959e-05            4.166667e-03            1.877131e-04 
#>                   13826                   13827                   13828 
#>            1.795071e-06            1.877131e-04            4.166667e-03 
#>                   13830                   13831                   13832 
#>            1.962943e-02            8.847122e-05            4.166667e-03 
#>                   13837                   13838                   13839 
#>            4.166667e-03            4.166667e-03            4.166667e-03 
#>                   13840                   13841                   13842 
#>            5.208333e-04            4.166667e-03            7.520053e-04 
#>                  2157-3              11001-8874                  2027-1 
#>            1.877131e-04            9.722222e-04            1.962943e-02 
#>                  2138-1                   13873                   14040 
#>            1.962943e-02            1.877131e-04            4.873294e-06 
#>                   14041                   14042                   14043 
#>            9.259259e-05            1.624431e-06            9.259259e-05 
#>                   14044                   14046                   14047 
#>            1.543210e-04            4.861111e-03            7.520053e-04 
#>                   14049                   14077                   14078 
#>            1.620370e-03            8.847122e-05            8.847122e-05 
#>                   14079                   14080                   14081 
#>            8.847122e-05            8.847122e-05            8.847122e-05 
#>                   14082                   14083                   14085 
#>            8.847122e-05            8.847122e-05            2.916667e-03 
#>                   14092                   14093                   14107 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14108                   14112                   14113 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14114                   14115                   14116 
#>            2.558480e-04            3.240741e-03            2.314815e-04 
#>                   14119                   14120                   14121 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14122                   14123                   14131 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   14132                 14045-a                 14045-b 
#>            4.861111e-03            4.861111e-03            4.861111e-03 
#>                   13971                   13977                   14129 
#>            7.520053e-04            1.620370e-03            1.420455e-03 
#>                   14135                   14136                 14137.1 
#>            1.420455e-03            8.847122e-05            8.847122e-05 
#>                   14138                   14139                   14141 
#>            2.893519e-03            8.847122e-05            4.861111e-03 
#>                   14142                   14145                   14149 
#>            1.944444e-03            5.208333e-04            4.861111e-03 
#>                   14151                   14152                   14153 
#>            7.520053e-04            7.520053e-04            7.520053e-04 
#>                   14156                   14159                   14160 
#>            1.620370e-03            2.916667e-03            7.520053e-04 
#>                   14161                   14162                   14164 
#>            1.877131e-04            7.520053e-04            6.392045e-03 
#>                   14165                   14167                   14168 
#>            2.916667e-03            1.620370e-03            4.861111e-03 
#>                   14169                   14171                   14172 
#>            2.558480e-04            4.861111e-03            1.279240e-04 
#>                   14174                   14175             WA84-121613 
#>            1.795071e-06            9.259259e-05            4.861111e-03 

## Rare Allele Correction ---------------------------------------------------
##
# If you don't supply a table of frequencies, they are calculated with rraf 
# with correction = TRUE. This is normally benign when analyzing large 
# populations, but it can have a great effect on small populations. To help 
# control this, you can supply arguments described in 
# help("rare_allele_correction"). 


# Default is to correct by 1/n per population. Since the calculation is 
# performed on a smaller sample size due to round robin clone correction, it
# would be more appropriate to correct by 1/rrmlg at each locus. This is 
# acheived by setting d = "rrmlg". Since this is a diploid, we would want to
# account for the number of chromosomes, and so we set mul = 1/2
head(pgen(Pram, log = FALSE, d = "rrmlg", mul = 1/2)) # compare with the output above
#>             PrMS6A1 Pr9C3A1 PrMS39A1 PrMS45A1   PrMS43A1
#> 1411152-10B     0.5     0.5     0.15      0.5 0.11111111
#> 82              0.5     0.5     0.35      0.5 0.11111111
#> 83              0.5     0.5     0.15      0.5 0.05555556
#> 84              0.5     0.5     0.35      0.5 0.11111111
#> 85              0.5     0.5     0.35      0.5 0.22222222
#> 81-NM-1         0.5     0.5     0.35      0.5 0.11111111

# If you wanted to treat all alleles as equally rare, then you would set a
# specific value (let's say the rare alleles are 1/100):
head(pgen(Pram, log = FALSE, e = 1/100))
#>             PrMS6A1 Pr9C3A1 PrMS39A1 PrMS45A1    PrMS43A1
#> 1411152-10B     0.5     0.5     0.15      0.5 0.111111111
#> 82              0.5     0.5     0.35      0.5 0.111111111
#> 83              0.5     0.5     0.15      0.5 0.003333333
#> 84              0.5     0.5     0.35      0.5 0.006666667
#> 85              0.5     0.5     0.35      0.5 0.222222222
#> 81-NM-1         0.5     0.5     0.35      0.5 0.111111111
# }