GithubHelp home page GithubHelp logo

ropensci / rsnps Goto Github PK

View Code? Open in Web Editor NEW
52.0 8.0 22.0 3.68 MB

Wrapper to a number of SNP web APIs

Home Page: https://docs.ropensci.org/rsnps

License: Other

R 100.00%
web-api snps data rstats r r-package

rsnps's Introduction

rsnps

R build status Build status Codecov test coverage cran version rstudio mirror downloads

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:

Install

Install from CRAN

install.packages("rsnps")

Or dev version

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

Usage

NCBI dbSNP data

snps <- c("rs332", "rs420358", "rs1837253", "rs1209415715", "rs111068718")
ncbi_snp_query(snps)
#> # A tibble: 4 × 16
#>   query        chromosome        bp class rsid    gene  alleles ancestral_allele
#>   <chr>        <chr>          <dbl> <chr> <chr>   <chr> <chr>   <chr>           
#> 1 rs332        7          117559593 del   rs1219… "CFT… TTT, d… TTT             
#> 2 rs420358     1           40341239 snv   rs4203… ""    A,C,G,T A               
#> 3 rs1837253    5          111066174 snv   rs1837… ""    T,C     T               
#> 4 rs1209415715 9           41782316 snv   rs1209… ""    T,A,C   T               
#> # ℹ 8 more variables: variation_allele <chr>, seqname <chr>, hgvs <chr>,
#> #   assembly <chr>, ref_seq <chr>, minor <chr>, maf <dbl>,
#> #   maf_population <list>

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

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"

For more detail, see the vignette: rsnps tutorial.

Meta

  • Please report any issues or bugs.
  • 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. By contributing to this project, you agree to abide by its terms.

ropensci_footer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.