Skip to content

Conversation

@SunSummoner
Copy link
Collaborator

@SunSummoner SunSummoner commented Sep 23, 2025

Description

What kind of change(s) are included?

  • Feature (adds or updates new capabilities)
  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (these changes would cause existing functionality to not work as expected).

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have searched for existing content to ensure this is not a duplicate.
  • I have performed a self-review of these additions (including spelling, grammar, and related).
  • I have added comments to my code to help provide understanding.
  • I have added a test which covers the code changes found within this PR.
  • I have deleted all non-relevant text in this pull request template.
  • Reviewer assignment: Tag a relevant team member to review and approve the changes.

@SunSummoner SunSummoner changed the title Uploaded script for Uniprot to ncbi function addresses #109 Uploaded script for Uniprot to ncbi function addresses issue #109 Sep 23, 2025
@SunSummoner SunSummoner mentioned this pull request Sep 23, 2025
3 tasks
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"))
Copy link
Collaborator

@the-mayer the-mayer Oct 29, 2025

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

Comment on lines +87 to +89
library(httr2)
library(dplyr)
library(purrr)
Copy link
Collaborator

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

Comment on lines +172 to +178
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.")
}
Copy link
Collaborator

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.

Copy link
Collaborator

@the-mayer the-mayer left a 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() and requireNamespace() 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 use httr2. That would let us drop httr and simplify the dependencies for the package

Thanks for putting this together and apologies for the delay in getting the review back to you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants