snpsNear               package:GGBase               R Documentation

_o_b_t_a_i_n _l_i_s_t _o_f _r_s _n_u_m_b_e_r_s _f_o_r _s_n_p_s _n_e_a_r _a _g_e_n_e

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

     obtain list of rs numbers for snps near a gene

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

     snpsNear(sym, radius=1e+05, chrnum, ...)

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

     sym: instance of genesym class [e.g., use genesym(string) for gene
          'string'], or of rsid class, or of numeric class.  An
          instance of 'GSEABase-class' can also be supplied if it has
          'geneIdType' AnnotationIdentifier.

  radius: number of base-pairs in each direction to look

  chrnum: chrnum instance .. optional

     ...: options not now in use 

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

     simple arithmetic based on output of snpLocs.Hs

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

     character vector of rsxxxxxx, dbSNP id, according to locations
     from SNPlocs.Hsapiens.dbSNP.20071016 package, as transferred to
     snpLocs.Hs resource in GGBase

     note that an attribute 'target' is returned, a named vector with
     components chr and loc describing chromosome and location of the
     target for which nearby SNPs are sought

_N_o_t_e:

     first invocation can take longer than subsequent, if snpLocs.Hs
     has not been invoked previously

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

     Vince Carey <stvjc@channing.harvard.edu>

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

     nearc = snpsNear(genesym("CPNE1"), 10000, chrnum(20))
     library(GGtools)
     data(hmceuB36.2021)
     ss = smList(hmceuB36.2021)[[1]]
     # following calculation requires new "[" for j an instance of rsid
     clo = ss[ , rsid(snpsNear(rsid("rs6060535"), rad=1500, chrnum(20))) ]
     clo
     # try a gene set
     library(GSEABase)
     s1 = GeneSet(c("CPNE1", "ADA"), geneIdType=SymbolIdentifier())
     s2 = s1
     geneIdType(s2) = AnnotationIdentifier("illuminaHumanv1.db")
     s2
     sapply(snpsNear(s2), length)

