gregorius            package:GeneticsBase            R Documentation

_P_r_o_b_a_b_i_l_i_t_y _o_f _O_b_s_e_r_v_i_n_g _A_l_l _A_l_l_e_l_e_s _w_i_t_h _a _G_i_v_e_n _F_r_e_q_u_e_n_c_y _i_n _a
_S_a_m_p_l_e _o_f _a _S_p_e_c_i_f_i_e_d _S_i_z_e.

_D_e_s_c_r_i_p_t_i_o_n:

     Probability of observing all alleles with a given frequency in a
     sample of a specified size.

_U_s_a_g_e:

     gregorius(freq, N, missprob, tol = 1e-10, maxN = 10000, maxiter=100, showiter = FALSE)

_A_r_g_u_m_e_n_t_s:

    freq: (Minimum) Allele frequency (required)

       N: Number of sampled genotypes

missprob: Desired maximum probability of failing to observe an allele.

     tol: Omit computation for terms which contribute less than this
          value.

    maxN: Largest value to consider when searching for N.

 maxiter: Maximum number of iterations to use when searching for N.

showiter: Boolean flag indicating whether to show the iterations
          performed when searching for N.

_D_e_t_a_i_l_s:

     If 'freq' and 'N' are provided, but 'missprob' is omitted, this
     function computes the probability of failing to observe all
     alleles with true underlying frequency 'freq' when 'N' diploid
     genotypes are sampled.  This is accomplished using the sum
     provided in Corollary 2 of Gregorius (1980), omitting terms which
     contribute less than 'tol' to the result.

     When 'freq' and 'missprob' are provide, but 'N' is omitted. A
     binary search on the range of [1,'maxN'] is performed to locate
     the smallest sample size, 'N', for which the probability of
     failing to observe all alleles with true underlying frequency
     'freq' is at most 'missprob'.  In this case, 'maxiter' specifies
     the largest number of iterations to use in the binary search, and
     'showiter' controls whether the iterations of the search are
     displayed.

_V_a_l_u_e:

     A list containing the following values: 

    call: Function call used to generate this object.

  method: One of the strings, "Compute missprob given N and freq", or
          "Determine minimal N given missprob and freq", indicating
          which type of computation was performed.

retval$freq: Specified allele frequency.

retval$N: Specified or computed sample size. 

retval$missprob: Computed probability of failing to observe all of the
          alleles with frequency 'freq'. 

_N_o_t_e:

     This code produces sample sizes that are slightly larger than
     those given in table 1 of Gregorius (1980).  This appears to be
     due to rounding of the computed 'missprob's by the authors of that
     paper.

_A_u_t_h_o_r(_s):

     Code submitted by David Duffy davidD@qumr.edu.au, substantially
     enhanced by Gregory R. Warnes warnes@bst.rochester.edu.

_R_e_f_e_r_e_n_c_e_s:

     Gregorius, H.R. 1980. The probability of losing an allele when
     diploid genotypes are sampled.  Biometrics 36, 643-652.

_E_x_a_m_p_l_e_s:

     # Compute the probability of missing an allele with frequency 0.15 when
     # 20 genotypes are sampled:
     gregorius(freq=0.15, N=20)

     # Determine what sample size is required to observe all alleles with true
     # frequency 0.15 with probability 0.95
     gregorius(freq=0.15, missprob=1-0.95)

