remove_gaps_groups          package:bgafun          R Documentation

_r_e_m_o_v_e _g_a_p_s _f_r_o_m _a _b_i_n_a_r_y _a_m_i_n_o _m_a_t_r_i_x

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

     This function is used to deal with gaps in the binary amino acid
     encoding.  It will remove positions from a binary amino matrix
     that contain more a certain fraction of gaps for any group in a
     column, in the alignment The gap fraction should be between 0 and
     1, and can be changed with the gap_fraction variable.

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

      remove_gaps_groups(x,z,gap_fraction=0.6)

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

       x: Matrix representation of alignment generated by
          convert_aln_amino 

       z: Vector or factor that shows the group representation for each
          sequence in the alignment

gap_fraction: Float between 0 and 1 indicating the fraction of gaps in
          a column before it should be removed

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

     library(bgafun)
     data(LDH)
     data(LDH.groups)
     LDH.amino=convert_aln_amino(LDH)
     dim(LDH.amino)
     LDH.amino.gapless=remove_gaps_groups(LDH.amino,LDH.groups,gap_fraction=0.6)
     dim(LDH.amino.gapless)

