GithubHelp home page GithubHelp logo

csdaw / uniprotrest Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 1.16 MB

UniProt REST API R wrapper

Home Page: https://csdaw.github.io/uniprotREST/

License: MIT License

R 99.68% Shell 0.32%
r r-package rest-api uniprot

uniprotrest's Introduction

uniprotREST

Project Status: Active โ€“ The project has reached a stable, usable state and is being actively developed.

This package provides an R wrapper for the UniProt website REST API.

Installation

Install the latest version from R-universe:

install.packages("uniprotREST", repos = "https://csdaw.r-universe.dev")

Or install the latest development version from GitHub:

remotes::install_github("csdaw/uniprotREST")

Documentation

Read the full documentation here.

Quick start

library(uniprotREST)

ID mapping with uniprot_map()

Map to/from UniProt IDs. This function wraps the ID mapping API endpoint.

# Proteins of interest (from 3 different taxa)
ids <- c("P99999", "P12345", "P23456")

# Get accessions, gene names and sequence lengths
result <- uniprot_map(
  ids = ids, 
  from = "UniProtKB_AC-ID",
  to = "UniProtKB",
  format = "tsv",
  fields = c("accession", "gene_primary", "length")
)
## Running job: 90889074746482f892eea3ec45ebac4779dbc1c6 
## Checking job status...
## Job complete!
##  Downloading: page 1 of 1
result
##     From  Entry Gene.Names..primary. Length
## 1 P99999 P99999                 CYCS    105
## 2 P12345 P12345                 GOT2    430
## 3 P23456 P23456                    L   2151

Querying UniProt with uniprot_search()

Perform text searches against UniProt databases. This function wraps the Query API endpoint.

# Get human glycoproteins less than 100 amino acids long

result <- uniprot_search(
  query = "(proteome:UP000005640) AND (keyword:KW-0325) AND (length<100)",
  database = "uniprotkb",
  format = "tsv",
  fields = c("accession", "gene_primary")
)
##  Downloading: page 1 of 1
head(result)
##    Entry Gene.Names..primary.
## 1 P06028                 GYPB
## 2 P80098                 CCL7
## 3 Q16627                CCL14
## 4 P0DMC3                APELA
## 5 P25063                 CD24
## 6 P31358                 CD52

Retrieving an entry with uniprot_single()

Download the full entry for a single protein. This function wraps the Retrieve API endpoint.

# Human cytochrome C
result <- uniprot_single(
  id = "P99999",
  database = "uniprotkb",
  format = "json",
  verbosity = 0
)

str(result, max.level = 1)
## List of 17
##  $ entryType               : chr "UniProtKB reviewed (Swiss-Prot)"
##  $ primaryAccession        : chr "P99999"
##  $ secondaryAccessions     :List of 6
##  $ uniProtkbId             : chr "CYC_HUMAN"
##  $ entryAudit              :List of 5
##  $ annotationScore         : num 5
##  $ organism                :List of 4
##  $ proteinExistence        : chr "1: Evidence at protein level"
##  $ proteinDescription      :List of 1
##  $ genes                   :List of 1
##  $ comments                :List of 10
##  $ features                :List of 36
##  $ keywords                :List of 14
##  $ references              :List of 19
##  $ uniProtKBCrossReferences:List of 179
##  $ sequence                :List of 5
##  $ extraAttributes         :List of 3

Metadata

uniprotrest's People

Contributors

csdaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

uniprotrest's Issues

Release v1.0.0

Prepare for upload to R-Universe:

  • Update NEWS.md
  • url_checker::url_check()
  • devtools::check()
  • Push final changes to trigger GitHub Actions
  • Review GitHub Actions results

Optionally fix things that need fixing, then repeat the above.

  • usethis::use_version("major")
  • Update README install instructions
  • Commit
  • devtools::check()`
  • Push again
  • Review GitHub Actions results

Add check for input accession structure

If input is supposed to be a UniProt accession, check the first/first few? all? accessions with regex to see if they 'look' like UniProt accessions otherwise produce a warning.

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.