-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathREADME.Rmd
105 lines (73 loc) · 2.91 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
rsnps
=====
```{r, eval=TRUE, echo=FALSE}
knitr::opts_chunk$set(
warning=FALSE,
message=FALSE,
comment="#>"
)
```
[![R build status](https://github.com/ropensci/rsnps/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/rsnps/actions)
[![Build status](https://ci.appveyor.com/api/projects/status/d2lv98726u6t9ut5/branch/master)](https://ci.appveyor.com/project/sckott/rsnps/branch/master/)
[![Codecov test coverage](https://codecov.io/gh/ropensci/rsnps/branch/master/graph/badge.svg)](https://app.codecov.io/gh/ropensci/rsnps?branch=master)
[![cran version](https://www.r-pkg.org/badges/version/rsnps)](https://cran.r-project.org/package=rsnps)
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/rsnps?color=E664A4)](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
+ <https://opensnp.org>
+ See documentation on the openSNP API <https://opensnp.org/faq#api>
+ See blog post about their API <https://opensnp.wordpress.com/2012/01/18/some-progress-on-the-api-json-endpoints/>
+ Relevant functions:
+ `allgensnp()`, `allphenotypes()`, `annotations()`, `download_users()`,
`fetch_genotypes()`, `genotypes()`, `phenotypes()`, `phenotypes_byid()`, `users()`
+ NCBI's dbSNP SNP database
+ See <https://www.ncbi.nlm.nih.gov/snp/> 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.
[![ropensci_footer](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)