Wrapper to a number of SNP web APIs
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github add .github files Jul 19, 2017
R #62 fix sort order of ncbi_snp_summary, add test for sort order Feb 15, 2019
inst update vignettes Sep 19, 2018
man fix #62 fix to ncbi_snp_summary, add row of NAs with not found snps Feb 14, 2019
revdep update revdep Sep 19, 2018
tests #62 fix sort order of ncbi_snp_summary, add test for sort order Feb 15, 2019
vignettes
.Rbuildignore add codemeta file Nov 6, 2018
.gitignore updated vignette, added infrastructure for it, ignoring its cache now Mar 3, 2015
.travis.yml
CODE_OF_CONDUCT.md change coc file name Apr 11, 2018
DESCRIPTION
LICENSE bump year in license file Apr 11, 2018
Makefile updated vignette, added infrastructure for it, ignoring its cache now Mar 3, 2015
NAMESPACE fix #44 moved from httr to crul, bump patch version Apr 11, 2018
NEWS.md update news, bump to v0.3 Sep 19, 2018
README.Rmd
README.md update readme Sep 19, 2018
appveyor.yml update appveyor slack notification Feb 15, 2016
codemeta.json #62 fix sort order of ncbi_snp_summary, add test for sort order Feb 15, 2019
cran-comments.md update news, bump to v0.3 Sep 19, 2018

README.md

rsnps

cran checks Build Status Build status codecov.io cran version rstudio mirror downloads

NOTE

rsnps used to be ropensnp

Data sources

This set of functions/package accesses data from:

Install

Install from CRAN

install.packages("rsnps")

Or dev version

install.packages("devtools")
devtools::install_github("ropensci/rsnps")
library("rsnps")

Using NCBI dbSNP data

SNPs <- c("rs332", "rs420358", "rs1837253", "rs1209415715", "rs111068718")
ncbi_snp_query(SNPs)
#>          Query Chromosome       Marker  Class Gene Alleles Major Minor
#> 1        rs332          7  rs121909001 in-del CFTR   -/TTT  <NA>  <NA>
#> 2     rs420358          1     rs420358    snp CFTR   A,G,T     A     G
#> 3    rs1837253          5    rs1837253    snp CFTR     C/T     C     T
#> 4 rs1209415715          9 rs1209415715    snp CFTR     C,T     C     T
#>      MAF        BP AncestralAllele
#> 1     NA 117559593            <NA>
#> 2     NA 117559593     T,T,T,T,T,T
#> 3 0.3822 117559593     T,T,T,T,T,T
#> 4     NA 117559593            <NA>

Using openSNP data

genotypes() function

genotypes('rs9939609', userid='1,6,8', df=TRUE)
#>    snp_name snp_chromosome snp_position                 user_name user_id
#> 1 rs9939609             16     53786615 Bastian Greshake Tzovaras       1
#> 2 rs9939609             16     53786615              Nash Parovoz       6
#> 3 rs9939609             16     53786615         Samantha B. Clark       8
#>   genotype_id genotype
#> 1           9       AT
#> 2           5       AT
#> 3           2       TT

phenotypes() function

out <- phenotypes(userid=1)
out$phenotypes$`Hair Type`
#> $phenotype_id
#> [1] 16
#> 
#> $variation
#> [1] "straight"

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for rsnsps in R doing citation(package = 'rsnps')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer