aa2index                package:bio3d                R Documentation

_C_o_n_v_e_r_t _a_n _A_m_i_n_o_a_c_i_d _S_e_q_u_e_n_c_e _t_o _A_A_I_n_d_e_x _V_a_l_u_e_s

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

     Converts sequences to aminoacid indeces from the 'AAindex'
     database.

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

     aa2index(aa, index = "KYTJ820101", window = 1)

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

      aa: a protein sequence character vector. 

   index: an index name or number (default: "KYTJ820101", hydropathy
          index by Kyte-Doolittle, 1982). 

  window: a positive numeric value, indicating the window size for
          smoothing with a sliding window average (default: 1, i.e. no
          smoothing). 

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

     By default, this function simply returns the index values for each
     amino acid in the sequence. It can also be set to perform a crude
     sliding window average through the 'window' argument.

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

     Returns a numeric vector.

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

     Ana Rodrigues

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

     Grant, B.J. et al. (2006) _Bioinformatics_ *22*, 2695-2696.

     'AAIndex' is the work of Kanehisa and co-workers: Kawashima and
     Kanehisa (2000) _Nucleic Acids Res._ *28*, 374; Tomii and Kanehisa
     (1996) _Protein Eng._ *9*, 27-36; Nakai, Kidera and Kanehisa
     (1988) _Protein Eng._ *2*, 93-100.

     For a description of the 'AAindex' database see:
       <URL: http://www.genome.jp/aaindex/> or the 'aa.index'
     documentation.

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

     'aa.index', 'read.fasta'

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

     ## Residue hydropathy values
     seq <- c("R","S","D","X","-","X","R","H","Q","V","L")
     aa2index(seq)

     ## Not run: 
     ## Use a sliding window average
     aa2index(aa=seq, index=22, window=3)

     ## Use an alignment

     aln  <- read.fasta(system.file("examples/hivp_xray.fa",package="bio3d"))
     prop <- t(apply(aln$ali, 1, aa2index, window=1))

     ## find and use indices for volume calculations
     i <- which(sapply(aa.index,
            function(x) length(grep("volume", x$D, ignore.case=TRUE)) != 0))
     sapply(i, function(x) aa2index(aa=seq, index=x, window=5)) 
     ## End(Not run)

