Code Monkey home page Code Monkey logo

gtexr's Introduction

gtexr

pkgdown Codecov test coverage R-CMD-check Deploy to shinyapps.io

The goal of gtexr is to provide a convenient R interface to the GTEx Portal API V2.

New to R? Try out the ⭐shiny app⭐.

Installation

You can install the development version of gtexr from GitHub with:

# install.packages("devtools")
devtools::install_github("rmgpanw/gtexr")

Examples

Get general information about the GTEx service:

library(gtexr)
get_service_info()
#> # A tibble: 1 × 9
#>   id     name  version organization_name organization_url description contactUrl
#>   <chr>  <chr> <chr>   <chr>             <chr>            <chr>       <chr>     
#> 1 org.g… GTEx… 2.0.0   GTEx Project      https://gtexpor… This servi… https://g…
#> # ℹ 2 more variables: documentationUrl <chr>, environment <chr>

Retrieve eQTL genes for whole blood tissue:

get_eqtl_genes("Whole_Blood")
#> Warning: ! Total number of items (12360) exceeds maximum page size (250).
#> ℹ Try increasing `itemsPerPage`.
#> 
#> ── Paging info ─────────────────────────────────────────────────────────────────
#> • numberOfPages = 50
#> • page = 0
#> • maxItemsPerPage = 250
#> • totalNumberOfItems = 12360
#> # A tibble: 250 × 10
#>    tissueSiteDetailId ontologyId  datasetId empiricalPValue gencodeId geneSymbol
#>    <chr>              <chr>       <chr>               <dbl> <chr>     <chr>     
#>  1 Whole_Blood        UBERON:001… gtex_v8          1.05e- 9 ENSG0000… WASH7P    
#>  2 Whole_Blood        UBERON:001… gtex_v8          1.06e-25 ENSG0000… RP11-34P1…
#>  3 Whole_Blood        UBERON:001… gtex_v8          6.31e- 2 ENSG0000… CICP27    
#>  4 Whole_Blood        UBERON:001… gtex_v8          8.71e- 9 ENSG0000… RP11-34P1…
#>  5 Whole_Blood        UBERON:001… gtex_v8          6.01e-20 ENSG0000… RP11-34P1…
#>  6 Whole_Blood        UBERON:001… gtex_v8          6.96e- 9 ENSG0000… RP11-34P1…
#>  7 Whole_Blood        UBERON:001… gtex_v8          3.10e- 4 ENSG0000… RP11-34P1…
#>  8 Whole_Blood        UBERON:001… gtex_v8          1.92e- 3 ENSG0000… ABC7-4304…
#>  9 Whole_Blood        UBERON:001… gtex_v8          1.58e- 3 ENSG0000… RP11-34P1…
#> 10 Whole_Blood        UBERON:001… gtex_v8          7.82e- 2 ENSG0000… AP006222.2
#> # ℹ 240 more rows
#> # ℹ 4 more variables: log2AllelicFoldChange <dbl>, pValue <dbl>,
#> #   pValueThreshold <dbl>, qValue <dbl>

Retrieve significant eQTLs for one or more genes:

get_significant_single_tissue_eqtls(gencodeId = c("ENSG00000132693.12",
                                                  "ENSG00000203782.5"))
#> 
#> ── Paging info ─────────────────────────────────────────────────────────────────
#> • numberOfPages = 1
#> • page = 0
#> • maxItemsPerPage = 250
#> • totalNumberOfItems = 249
#> # A tibble: 249 × 13
#>    snpId            pos snpIdUpper variantId  geneSymbol  pValue geneSymbolUpper
#>    <chr>          <int> <chr>      <chr>      <chr>        <dbl> <chr>          
#>  1 rs12128960 159343657 RS12128960 chr1_1593… CRP        8.52e-5 CRP            
#>  2 rs12132451 159344052 RS12132451 chr1_1593… CRP        7.92e-5 CRP            
#>  3 rs12136402 159347493 RS12136402 chr1_1593… CRP        7.92e-5 CRP            
#>  4 rs10908709 159350390 RS10908709 chr1_1593… CRP        7.92e-5 CRP            
#>  5 rs10908710 159351189 RS10908710 chr1_1593… CRP        7.92e-5 CRP            
#>  6 rs11265178 159359256 RS11265178 chr1_1593… CRP        9.62e-5 CRP            
#>  7 rs35532309 159360755 RS35532309 chr1_1593… CRP        6.11e-5 CRP            
#>  8 rs6692378  159369451 RS6692378  chr1_1593… CRP        1.17e-6 CRP            
#>  9 rs10908714 159370563 RS10908714 chr1_1593… CRP        1.80e-5 CRP            
#> 10 rs6656924  159372915 RS6656924  chr1_1593… CRP        1.00e-6 CRP            
#> # ℹ 239 more rows
#> # ℹ 6 more variables: datasetId <chr>, tissueSiteDetailId <chr>,
#> #   ontologyId <chr>, chromosome <chr>, gencodeId <chr>, nes <dbl>

gtexr's People

Contributors

abolvera avatar bzuckerman97 avatar cyu12 avatar rmgpanw avatar

Stargazers

 avatar

Watchers

 avatar

gtexr's Issues

Datasets Endpoints - create R functions

Create R functions for each endpoint listed under Dataset Endpoints.

  • Get Annotation
  • Get Collapsed Gene Model Exon
  • Get File List
  • Get Downloads Page Data
  • Get Full Get Collapsed Gene Model Exon
  • Get Functional Annotation
  • Get Sample
  • Get Tissue Site Detail
  • Get Subject
  • Get Variant
  • Get Variant By Location
  • Get Linkage Disequilibrium Data
  • Get Linkage Disequilibrium By Variant Data

Improve default arguments for `get_exons()`; add example for

GTEx Portal API documentation states

'A dataset ID or both GENCODE version and genome build must be provided.'

I am uncertain how to provide gencodeVersion and genomeBuild, but not datasetId (which has a default value). The following raises an error for example:

library(gtexr)
get_exons(gencodeId = "ENSG00000203782.5", gencodeVersion = "v26", genomeBuild = "GRCh38/hg38", datasetId = NULL)
#> Error in `get_exons()`:
#> ! HTTP 400 Illegal Query Input
#> ✖ Only datasetId or both gencodeVersion and genomeBuild required.

Created on 2024-04-10 with reprex v2.1.0

Is providing datasetId alone sufficient however?

Static association endpoints - create R functions

Create R functions for each endpoint listed under Static association endpoints.

  • Get Eqtl Genes
  • Get Fine Mapping
  • Get Independent Eqtl
  • Get Multi Tissue Eqtls
  • Get Sqtl Genes
  • Get Significant Single Tissue Eqtls
  • Get Significant Single Tissue Eqtls By Location
  • Get Significant Single Tissue Sqtls
  • Get Significant Single Tissue leqtls
  • Get Significant Single Tissue lsqtls

Expression Data Endpoints - create R functions

Create R functions for each endpoint listed under Expression Data Endpoints.

  • Get Expression Pca
  • Get Gene Expression
  • Get Median Exon Expression
  • Get Clustered Median Exon Expression
  • Get Median Gene Expression
  • Get Clustered Median Gene Expression
  • Get Median Junction Expression
  • Get Clustered Median Junction Expression
  • Get Median Transcript Expression
  • Get Clustered Median Transcript Expression
  • Get Single Nucleus Gex
  • Get Single Nucleus Gex Summary
  • Get Top Expressed Genes

Use `get_tissue_site_detail()` instead of `available_tissueSiteDetailIds()`

available_tissueSiteDetailIds() is a not required as the same information (and more) is provided by get_tissue_site_detail()

  • Remove available_tissueSiteDetailIds.R and test-available_tissueSiteDetailIds.R
  • Update gtexr_arguments() tibble - remove calls to available_tissueSiteDetailIds()
  • Update gtexr_arguments() roxygen documentation - remove references to available_tissueSiteDetailIds() and replace with get_tissue_site_detail(), then re-document with devtools::document()
  • Remove the following lines from _pkgdown.yml:
- title: Utilities
- contents:
  - has_concept("Utilities")

Relay informative errors to app users

For example, supplying ". to .featureId in get_genomic_features() produces the following error message:

Error: An error has occurred. Check your logs or contact the app author for clarification.
  • Update app.R to relay the actual error message

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.