Bimap-keymethods        package:AnnotationDbi        R Documentation

_M_e_t_h_o_d_s _f_o_r _m_a_n_i_p_u_l_a_t_i_n_g _t_h_e _k_e_y_s _o_f _a _B_i_m_a_p _o_b_j_e_c_t

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

     These methods are part of the Bimap interface.

     They are devided in 3 groups: directed Bimap methods, undirected
     Bimap methods and subsetting Bimap methods. Unlike for undirected
     methods, the result of a directed method depends on the direction
     of the Bimap object (left-to-right or right-to-left, see
     'direction' for more details). The subsetting methods allow to
     extract a submap from a Bimap object by restricting the mapping to
     a subset of keys.

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

       ## Directed Bimap methods
       keys(x)
       #length(x)
       isNA(x)
       mappedkeys(x)
       count.mappedkeys(x)

       ## Undirected Bimap methods
       Lkeys(x)
       Rkeys(x)
       Llength(x)
       Rlength(x)
       mappedLkeys(x)
       mappedRkeys(x)
       count.mappedLkeys(x)
       count.mappedRkeys(x)

       ## Subsetting Bimap methods
       keys(x) <- value
       #x[i]
       Lkeys(x) <- value
       Rkeys(x) <- value
       subset(x, ...)

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

       x: A Bimap object. 

   value: A character vector containing the new keys (must be a subset
          of the current keys). 

       i: Index specifying map elements to extract. 

     ...: Extra arguments can be:

          '_L_k_e_y_s' The new Lkeys (must be a subset of the current
               Lkeys).

          '_R_k_e_y_s' The new Rkeys (must be a subset of the current
               Rkeys).

          '_o_b_j_N_a_m_e' The name to give to the submap (only supported if
               'x' is an AnnDbBimap object).

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

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

     H. Pages

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

     Bimap, BimapFormatting, AnnDbBimap-envirAPI

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

       library(hgu95av2.db)
       x <- hgu95av2GO
       x
       length(x)
       count.mappedkeys(x)
       x[1:3]
       links(x[1:3])

       ## Keep only mapped keys
       keys(x) <- mappedkeys(x)
       length(x)
       count.mappedkeys(x)
       x # now it is a submap

       ## The above can be achieved with
       x <- hgu95av2GO[mappedkeys(hgu95av2GO)]

       ## mappedkeys() and count.mappedkeys() also work with an environment
       ## or a list
       z <- list(k1=NA, k2=letters[1:4], k3="x")
       mappedkeys(z)
       count.mappedkeys(z)

