permutation              package:seqinr              R Documentation

_S_e_q_u_e_n_c_e _p_e_r_m_u_t_a_t_i_o_n _a_c_c_o_r_d_i_n_g _t_o _s_e_v_e_r_a_l _d_i_f_f_e_r_e_n_t _m_o_d_e_l_s

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

     Generates a random permutation of a given sequence, according to a
     given model. Available models are : 'base', 'position', 'codon',
     'syncodon'.

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

     permutation(sequence,modele='base',frame=0,replace=FALSE,prot=FALSE,numcode=1,ucoweight = NULL)

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

sequence: A nucleic acids sequence 

  modele: A string of characters describing the model chosen for the
          random generation 

   frame: Only active for the 'position', 'codon', 'syncodon' models:
          starting position of CDS as in 'splitseq' 

 replace: This option is not active for the 'syncodon' model: if
          'TRUE', sampling is done with replacement 

    prot: Only available for the 'codon' model: if 'TRUE', the first
          and last codons are preserved, and only intern codons are
          shuffled 

 numcode: Only available for the 'syncodon' model: the genetic code
          number as in 'translate'. 

ucoweight: A list of weights containing the desired codon usage bias as
          generated by 'ucoweight'. If none is specified, the codon
          usage of the given sequence is used. 

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

     The 'base' model allows for random sequence generation by
     shuffling (with/without replacement) of all bases in the sequence.

     The 'position' model allows for random sequence generation by
     shuffling (with/without replacement) of bases within their
     position in the codon (bases in position I, II or III stay in
     position I, II or III in the new sequence.

     The 'codon' model allows for random sequence generation by
     shuffling (with/without replacement) of codons.

     The 'syncodon' model allows for random sequence generation by
     shuffling (with/without replacement) of synonymous codons.

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

     a sequence generated from the original one by a given model

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

     Leonor Palmeira

_R_e_f_e_r_e_n_c_e_s:

     'citation("seqinr")'

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

     'synsequence'

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

       data(ec999)
       sequence=ec999[1][[1]]

       new=permutation(sequence,modele='base')
       identical(all.equal(count(new,1),count(sequence,1)),TRUE)

       new=permutation(sequence,modele='position')
       identical(all.equal(GC(new),GC(sequence)),TRUE)
       identical(all.equal(GC2(new),GC2(sequence)),TRUE)
       identical(all.equal(GC3(new),GC3(sequence)),TRUE)

       new=permutation(sequence,modele='codon')
       identical(all.equal(uco(new),uco(sequence)),TRUE)

       new=permutation(sequence,modele='syncodon',numcode=1)
       identical(all.equal(translate(new),translate(sequence)),TRUE)

