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)

