\HeaderA{snpsNear}{obtain list of rs numbers for snps near a gene}{snpsNear}
\keyword{models}{snpsNear}
\begin{Description}\relax
obtain list of rs numbers for snps near a gene
\end{Description}
\begin{Usage}
\begin{verbatim}
snpsNear(sym, radius=1e+05, chrnum, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{sym}] instance of genesym class [e.g., use genesym(string) for gene 'string'],
or of rsid class, or of numeric class.  An instance of
\code{\LinkA{GSEABase-class}{GSEABase.Rdash.class}} can also be supplied if it
has \code{geneIdType} AnnotationIdentifier.
\item[\code{radius}] number of base-pairs in each direction to look
\item[\code{chrnum}] chrnum instance .. optional
\item[\code{...}] options not now in use 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
simple arithmetic based on output of snpLocs.Hs
\end{Details}
\begin{Value}
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
\end{Value}
\begin{Note}\relax
first invocation can take longer than subsequent, if snpLocs.Hs has
not been invoked previously
\end{Note}
\begin{Author}\relax
Vince Carey \textless{}stvjc@channing.harvard.edu\textgreater{}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
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)
\end{ExampleCode}
\end{Examples}

