homozygote             package:genetics             R Documentation

_E_x_t_r_a_c_t _F_e_a_t_u_r_e_s _o_f _G_e_n_o_t_y_p_e _o_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     'homozygote' creates an vector of logicals that are true when the
     alleles of the corresponding observation are the identical.

     'heterozygote ' creates an vector of logicals that are true when
     the alleles of the corresponding observation differ.

     'carrier' create a logical vector or matrix of logicals indicating
     whether the specified alleles are present.

     'allele.count' returns the number of copies of the specified
     alleles carried by each observation.

     'allele' extract the specified allele(s) as a character vector or
     a 2 column matrix.

     'allele.names' extract the set of allele names.

_U_s_a_g_e:

     homozygote(x,  allele.name, ...)
     heterozygote(x, allele.name, ...)
     carrier(x, allele.name, ...)
     ## S3 method for class 'genotype':
     carrier(x, allele.name=allele.names(x),
             any=!missing(allele.name), na.rm=FALSE, ...)
     allele.count(x, allele.name=allele.names(x),any=!missing(allele.name),
                  na.rm=FALSE)
     allele(x, which=c(1,2) )
     allele.names(x)

_A_r_g_u_m_e_n_t_s:

       x: 'genotype' object 

     ...: optional parameters (ignored) 

allele.name: character value or vector of allele names

     any: logical value.  When 'TRUE', a single count or indicator is
          returned by combining the results for all of the elements of
          'allele'. If 'FALSE' separate counts or indicators should be
          returned for each element of 'allele'.  Defaults to 'FALSE'
          if 'allele' is missing. Otherwise defaults to 'TRUE'.

   na.rm: logical value indicating whether to remove missing values. 
          When true, any 'NA' values will be replaced by '0' or 'FALSE'
          as appropriate.  Defaults to 'FALSE'.

   which: selects which allele to return. For first allele use '1'. 
          For second allele use '2'.  For both (the default) use
          'c(1,2)'.

_D_e_t_a_i_l_s:

     When the 'allele.name' argument is given, heterozygote and
     homozygote return 'TRUE' if _exactly_ one or both alleles,
     respectively, match the specified allele.name.

_V_a_l_u_e:

     'homozygote' and 'heterozygote ' return a vector of logicals.

     'carrier' returns a logical vector if only one allele is
     specified, or if 'any' is 'TRUE'.  Otherwise, it returns matrix of
     logicals with one row for each element of 'allele'.

     'allele.count' returns a  vector of counts if only one allele is
     specified, or if 'any' is 'TRUE'.  Otherwise, it returns matrix of
     counts with one row for each element of 'allele'.

     'allele' returns a character vector when one allele is specified. 
     When 2 alleles are specified, it returns a 2 column character
     matrix.

     'allele.names' returns a character vector containing the set of
     allele names.

_A_u_t_h_o_r(_s):

     Gregory R. Warnes Gregory_R_Warnes@groton.pfizer.com

_S_e_e _A_l_s_o:

     'genotype', 'HWE.test', 'summary.genotype', 'locus' 'gene'
     'marker'

_E_x_a_m_p_l_e_s:

     example.data   <- c("D/D","D/I","D/D","I/I","D/D","D/D","D/D","D/D","I/I","")
     g1  <- genotype(example.data)
     g1

     heterozygote(g1)
     homozygote(g1)

     carrier(g1,"D")
     carrier(g1,"D",na.rm=TRUE)

     # get count of one allele 
     allele.count(g1,"D")

     # get count of each allele
     allele.count(g1)  # equivalent to
     allele.count(g1, c("D","I"), any=FALSE)

     # get combined count for both alleles
     allele.count(g1,c("I","D"))

     # get second allele
     allele(g1,2)

     # get both alleles
     allele(g1)

