https://github.com/ropensci/rsnps
Wrapper to a number of SNP web APIs
https://github.com/ropensci/rsnps
data r r-package rstats snps web-api
Last synced: about 1 month ago
JSON representation
Wrapper to a number of SNP web APIs
- Host: GitHub
- URL: https://github.com/ropensci/rsnps
- Owner: ropensci
- License: other
- Created: 2012-01-19T00:19:21.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2023-11-24T05:28:39.000Z (over 2 years ago)
- Last Synced: 2026-01-28T05:19:27.656Z (2 months ago)
- Topics: data, r, r-package, rstats, snps, web-api
- Language: R
- Homepage: https://docs.ropensci.org/rsnps
- Size: 3.59 MB
- Stars: 55
- Watchers: 6
- Forks: 22
- Open Issues: 15
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Codemeta: codemeta.json
Awesome Lists containing this project
README
---
output: github_document
---
rsnps
=====
```{r, eval=TRUE, echo=FALSE}
knitr::opts_chunk$set(
warning=FALSE,
message=FALSE,
comment="#>"
)
```
[](https://github.com/ropensci/rsnps/actions)
[](https://ci.appveyor.com/project/sckott/rsnps/branch/master/)
[](https://app.codecov.io/gh/ropensci/rsnps?branch=master)
[](https://cran.r-project.org/package=rsnps)
[](https://github.com/r-hub/cranlogs.app)
This package gives you access to data from OpenSNP and NCBI's dbSNP SNP database.
## NOTE
`rsnps` used to be `ropensnp`
## Data sources
This set of functions/package accesses data from:
+ openSNP.org
+
+ See documentation on the openSNP API
+ See blog post about their API
+ Relevant functions:
+ `allgensnp()`, `allphenotypes()`, `annotations()`, `download_users()`,
`fetch_genotypes()`, `genotypes()`, `phenotypes()`, `phenotypes_byid()`, `users()`
+ NCBI's dbSNP SNP database
+ See for more details
+ Relevant function:
+ `ncbi_snp_query()`
## Install
Install from CRAN
```{r eval=FALSE}
install.packages("rsnps")
```
Or dev version
```{r eval=FALSE}
install.packages("remotes")
remotes::install_github("ropensci/rsnps")
```
```{r}
library("rsnps")
```
## Usage
### NCBI dbSNP data
```{r}
snps <- c("rs332", "rs420358", "rs1837253", "rs1209415715", "rs111068718")
ncbi_snp_query(snps)
```
The `ncbi_snp_query()` function can be used with an NCBI API which gives access
higher numbers of API requests per second. More information about setting this
up can be found in the package help accessed via `?rsnps`.
### openSNP data
`genotypes()` function
```{r}
genotypes('rs9939609', userid='1,6,8', df=TRUE)
```
`phenotypes()` function
```{r}
out <- phenotypes(userid=1)
out$phenotypes$`Hair Type`
```
For more detail, see the [vignette: rsnps tutorial](https://github.com/ropensci/rsnps/tree/master/vignettes).
## Meta
* Please [report any issues or bugs](https://github.com/ropensci/rsnps/issues/).
* License: MIT
* Get citation information for `rsnsps` in R doing `citation(package = 'rsnps')`
* Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.
[](https://ropensci.org)