reordXlist            package:MasterBayes            R Documentation

_R_e_o_r_d_e_r_s _D_e_s_i_g_n _M_a_t_r_i_c_e_s

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

     Reorders design matrices so excluded parents appear last, and high
     probability parents appear first, thus increasing computational
     efficiency.

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

       reordXlist(X.list, marker.type="MS", ...)

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

  X.list: list of design matrices for each offspring derived using
          'getXlist'. Mismatch information must be present (see
          'mismatches')

marker.type: "MS" or "AFLP" for codominant or dominant markers
          respectively

     ...: Further arguments to be passed

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

     The design matrices are reordered by the number of mismatches
     between a parent and offspring for codominant markers, and by the
     probability of the offspring genotype conditional on parent
     genotype for dominant markers.

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

     'X.list' for which parents are reordered

_N_o_t_e:

     If a  'GdataPed' object is passed to 'getXlist' then the design
     matrices will be reordered 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), 3)
     ped[,3]<-c(rep(NA, 4), 4)

     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)

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

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

     X.list<-mismatches(X.list, G=genotypes$Gobs)
     X.list<-fillX.G(X.list, A=A, G=genotypes$Gobs)

     X.list.reord<-reordXlist(X.list)

     # The design matrices for the genetic likelihoods are reordered
     # by the number of mismatches.  The true parental combination
     # now appears first rather than last.

     X.list$X$"5"$G
     X.list.reord$X$"5"$G

