-
Couldn't load subscription status.
- Fork 14
Uploaded script for Uniprot to ncbi function addresses issue #109 #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added functions to map NCBI RefSeq Protein IDs to UniProt Accessions and NCBI Protein Accessions to IPG IDs.
| #' @param uniprot_ids A character vector of UniProt accession IDs. | ||
| #' @return A tibble with UniProt IDs and mapped NCBI accessions. | ||
| #' @examples | ||
| #' up2ncbi_fast(c("P12345", "Q9Y263")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update example to match exported function name
| library(httr2) | ||
| library(dplyr) | ||
| library(purrr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove library calls function. instead, import necessary functions with roxygen @importFrom comments
| if (!requireNamespace("rentrez", quietly = TRUE)) { | ||
| stop("Please install 'rentrez' with install.packages('rentrez') or BiocManager::install('rentrez')") | ||
| } | ||
| if (!requireNamespace("httr", quietly = TRUE) || | ||
| !requireNamespace("xml2", quietly = TRUE)) { | ||
| stop("Please install 'httr' and 'xml2' packages.") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly, if this is going to be an exported function we should source the required packages properly with @importFrom. Once the tags are added, running devtools::document() will populate the package NAMESPACE with the required package functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start! Everything works as described!
A couple of suggestions before approving/merging:
- Let's avoid using
library()andrequireNamespace()in user facing functions. Instead, we should rely on roxygen import tags to handle package dependencies. - MolEvolvR already has quite a few dependencies, it might be worth refactoring
acc2ipg()to usehttr2. That would let us drophttrand simplify the dependencies for the package
Thanks for putting this together and apologies for the delay in getting the review back to you!
Description
What kind of change(s) are included?
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.