mismatches            package:MasterBayes            R Documentation

_P_a_r_e_n_t-_O_f_f_s_p_r_i_n_g _G_e_n_o_t_y_p_e _M_i_s_m_a_t_c_h_e_s

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

     Calculates the number of mismatches between  parental and
     offspring genotypes, assuming the genotypes of spouses are
     unknown. Primarily intended to be used inside the function
     'getXlist' where potential parents can be excluded based on the
     number of mismatches. Dominant markers do not produce mismatches.

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

     mismatches(X.list, G, mm.tol=999, ...)

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

  X.list: list of design matrices for each offspring derived using
          'getXlist'

       G: list of genotype objects, the rows of which must refer to the
          id vector 'X.list$id'

  mm.tol: maximum number of mismatches that are tolerated before
          exclusion

     ...: further arguments to be passed

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

     list of design matrices of the form 'X.list', but containing the
     number of mismatches between parents and offspring.  Potential
     parents that exceed the number of mismatches specified by 'mm.tol'
     are removed from the vectors of potential parents: 'restdam.id'
     and 'restsire.id'.

_N_o_t_e:

     If a  'GdataPed' object is passed to 'getXlist' then the number of
     mismatches will be calculated by default.

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

     Jarrod Hadfield j.hadfield@sheffield.ac.uk

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

     'MCMCped'

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

     data(WarblerG)
     A<-extractA(WarblerG)

     ped<-matrix(NA, 5,3)
     ped[,1]<-1:5
     ped[,2]<-c(rep(NA, 4), 1)
     ped[,3]<-c(rep(NA, 4), 2)

     genotypes<-simgenotypes(A, ped=ped)

     sex<-c("Female", "Male", "Female", "Male","Female")
     offspring<-c(0,0,0,0,1)

     data<-data.frame(id=ped[,1], sex, offspring)

     res1<-expression(varPed(x="offspring", restrict=0))
     PdP<-PdataPed(formula=list(res1), data=data)

     X.list<-getXlist(PdP)
     # creates design matrices for offspring (in this case indivdiual "5")

     X.list.MM<-mismatches(X.list, G=genotypes$Gobs, mm.tol=0)
     # genetic likelihoods are arranged sires within dams 

     X.list.MM$X$"5"$mmD
     # number of mismatches between offspring "5" and dams "1" and "3"

     X.list.MM$X$"5"$mmS
     # number of mismatches between offspring "5" and sires "4" and "5"

     X.list.MM$X$"5"$restdam.id
     X.list.MM$X$"5"$dam.id
     # dams with mismatches are excluded  mismatch (mm.tol=0)

     X.list.MM$X$"5"$restsire.id
     X.list.MM$X$"5"$sire.id
     # sires with mismatches are excluded  mismatch (mm.tol=0)

