From c680283419a818497c793783abde38d1f6db14f5 Mon Sep 17 00:00:00 2001 From: Jitao David Zhang Date: Sun, 15 Feb 2026 14:17:40 +0100 Subject: [PATCH] updates to prepare for Bioc submission --- .Rbuildignore | 1 + .github/workflows/standard-ci-workflow.yml | 64 ++++++------------- DESCRIPTION | 25 +++++--- R/annotateAnyIDs.R | 24 +++---- R/annotateGeneIDs.R | 2 +- R/annotateGeneSymbols.R | 1 - R/annotateProteinGroups.R | 5 -- R/appendHumanOrthologsWithNCBI.R | 12 ++-- R/featureID.R | 4 +- R/gti2bioc.R | 14 +++- R/humanOrthologsByTaxID.R | 2 +- R/ribiosAnnotation-package.R | 5 ++ R/uniprotByTaxID.R | 3 +- R/utils.R | 6 +- man/annotateAnyIDs.Rd | 12 +--- man/annotateGeneIDsWithoutHumanOrtholog.Rd | 2 +- man/annotateProteinGroups.Rd | 2 - man/appendHumanOrthologsWithNCBI.Rd | 5 ++ man/connectMongoDB.Rd | 2 + man/gti2bioc.Rd | 1 - man/gtibioc.Rd | 23 +++++++ man/guessAndAnnotate.Rd | 2 - man/humanOrthologsByTaxID.Rd | 2 +- man/loadMongodbSecrets.Rd | 2 +- man/ribiosAnnotation-package.Rd | 15 +++++ man/uniprotByTaxID.Rd | 3 + .../test-appendHumanOrthologsWithNCBI.R | 27 ++++---- 27 files changed, 148 insertions(+), 118 deletions(-) create mode 100644 R/ribiosAnnotation-package.R create mode 100644 man/gtibioc.Rd create mode 100644 man/ribiosAnnotation-package.Rd diff --git a/.Rbuildignore b/.Rbuildignore index d603688..6cbc390 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -5,6 +5,7 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$ +^\.github$ ^Makefile$ ^coverage\.txt$ ^coverage\.r$ diff --git a/.github/workflows/standard-ci-workflow.yml b/.github/workflows/standard-ci-workflow.yml index a7c9ce3..b58897d 100644 --- a/.github/workflows/standard-ci-workflow.yml +++ b/.github/workflows/standard-ci-workflow.yml @@ -23,65 +23,37 @@ jobs: - {os: windows-latest, r: 'release'} - {os: macOS-latest, r: 'release'} - {os: macOS-latest, r: 'devel'} - - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} + use-public-rspm: true - - uses: r-lib/actions/setup-pandoc@master - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" + extra-packages: any::rcmdcheck + needs: check - - name: Install Bioconductor - run: | - install.packages("BiocManager") - BiocManager::install() - shell: Rscript {0} - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories()) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} + - uses: r-lib/actions/check-r-package@v2 + with: + args: 'c("--no-manual", "--as-cran")' + error-on: '"warning"' + upload-snapshots: true - name: Upload check results if: failure() - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check diff --git a/DESCRIPTION b/DESCRIPTION index b7c1733..f03fd31 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,19 @@ Package: ribiosAnnotation Type: Package -Title: Annotation of genes, RNAs and proteins in the BIOS system +Title: Annotation of Genes, RNAs, and Proteins in 'ribios' Version: 3.8.0 -Date: 2025-07-28 -Author: Jitao David Zhang -Maintainer: Jitao David Zhang -Description: Retrieves annotation information of genomic features, genes, RNAs and proteins from the Oracle database of the Roche Bioinformatics environment. +Date: 2026-02-15 +Authors@R: person("Jitao David", "Zhang", + email = "jitao_david.zhang@roche.com", + role = c("aut", "cre"), + comment = c(ORCID = "0000-0002-3085-0909")) +Description: Retrieves annotation information of genomic features including + genes, RNAs, and proteins from databases. It supports querying by gene + identifiers, gene symbols, UniProt accessions, Ensembl identifiers, and + RefSeq identifiers, as well as mapping orthologs across species using + NCBI data. +Depends: + R (>= 4.1.0) Imports: ribiosUtils, dplyr, @@ -14,13 +22,13 @@ Imports: magrittr, mongolite Suggests: - roxygen2, testthat LazyData: true License: GPL-3 Encoding: UTF-8 -RoxygenNote: 7.3.2 -Collate: +RoxygenNote: 7.3.3 +Additional_repositories: https://bedapub.r-universe.dev +Collate: 'sortAnnotationByQuery.R' 'removeEnsemblVersion.R' 'utils.R' @@ -38,6 +46,7 @@ Collate: 'formatIn.R' 'gti2bioc.R' 'humanOrthologsByTaxID.R' + 'ribiosAnnotation-package.R' 'taxID.R' 'uniprotByTaxID.R' Remotes: diff --git a/R/annotateAnyIDs.R b/R/annotateAnyIDs.R index 09afc9d..1b60c1f 100644 --- a/R/annotateAnyIDs.R +++ b/R/annotateAnyIDs.R @@ -27,34 +27,28 @@ NULL #' @seealso \code{\link{annotateGeneIDs}}, \code{\link{annotateGeneSymbols}} #' @importFrom ribiosUtils putColsFirst matchColumn #' @examples -#' -#' options(error=utils::recover) -#' +#' \dontrun{ #' # GeneID #' annotateAnyIDs(ids=c(780, 5982, 3310, NA)) -#' +#' #' # GeneSymbol #' annotateAnyIDs(ids=c("DDR1", "RFC2", "HSPA6", "HSAP6")) -#' +#' #' # Probesets #' myprobes <- c("1000_at", "1004_at", "1002_f_at", "nonsense_at") #' annotateAnyIDs(myprobes) -#' +#' #' # UniProt #' annotateAnyIDs(ids=c("P38398", "Q8NDF8")) -#' -#' # EnsEMBL +#' +#' # EnsEMBL #' ensemblIDs <- c("ENSG00000197535", "ENST00000399231.7", "ENSP00000418960.2") #' annotateAnyIDs(ensemblIDs) -#' -#' # TODO: ENST and ENSP do not work yet -#' annotateAnyIDs("ENST00000399231") -#' +#' #' # RefSeq #' annotateAnyIDs(c("NM_000235", "NM_000498")) -#' -#' options(error=NULL) -#' +#' } +#' #' @export annotateAnyIDs annotateAnyIDs <- function(ids, orthologue = FALSE, multiOrth = FALSE) { validIDs <- removeEnsemblVersion(ids) diff --git a/R/annotateGeneIDs.R b/R/annotateGeneIDs.R index 260c96b..1ee9da2 100644 --- a/R/annotateGeneIDs.R +++ b/R/annotateGeneIDs.R @@ -58,7 +58,7 @@ annotateGeneIDs <- function(ids, orthologue=FALSE, multiOrth=FALSE) { #' @note \code{annotatemRNAs} is an alias of \code{annotateRefSeqs} #' @author Jitao David Zhang #' -#' @details The collection {ncbi_gene_info} is used. +#' @details The collection \code{ncbi_gene_info} is used. #' #' @examples #' diff --git a/R/annotateGeneSymbols.R b/R/annotateGeneSymbols.R index 74bbaf7..bb05a4b 100644 --- a/R/annotateGeneSymbols.R +++ b/R/annotateGeneSymbols.R @@ -130,5 +130,4 @@ annotateGeneSymbols <- function(ids, taxId=9606, orthologue=FALSE, multiOrth=FAL res <- annotateGeneSymbolsWithHumanOrtholog(ids, taxId=taxId, multiOrth=TRUE) } return(res) - return(NULL) } diff --git a/R/annotateProteinGroups.R b/R/annotateProteinGroups.R index 7d002bb..103d3e9 100644 --- a/R/annotateProteinGroups.R +++ b/R/annotateProteinGroups.R @@ -31,12 +31,10 @@ getGenesPerIndex <- function(x) { #' In case \code{orthologue} is \code{TRUE}, human orthologue information is #' returned as well. #' @examples -#' options(error=utils::recover) #' \dontrun{ #' annotateProteinGroups(c("A0A024RBG1;Q9NZJ9", "A0A0B4J2D5;P0DPI2", #' "A0A0B4J2F0;A0A0U1RRL7")) #' } -#' options(error=NULL) #' @importFrom dplyr group_by arrange group_modify ungroup #' @export annotateProteinGroups <- function(ids, delimiter=";", @@ -62,6 +60,3 @@ annotateProteinGroups <- function(ids, delimiter=";", unique return(res) } - -## assignInNamespace("getGenesPerIndex", getGenesPerIndex, "ribiosAnnotation") -## assignInNamespace("annotateProteinGroups", annotateProteinGroups, "ribiosAnnotation") diff --git a/R/appendHumanOrthologsWithNCBI.R b/R/appendHumanOrthologsWithNCBI.R index c71c1cf..e43a515 100644 --- a/R/appendHumanOrthologsWithNCBI.R +++ b/R/appendHumanOrthologsWithNCBI.R @@ -18,14 +18,17 @@ NULL #' @note The function does not sort the rows by GeneID. It is the responsibility #' of the calling function to do so. #' -#' @examples +#' @return A \code{data.frame} with annotation and human orthologs appended. +#' @examples +#' \dontrun{ #' anno <- data.frame(GeneID=c(780, 1506, 114483548, 102129055, NA), #' TaxID=c(9606, 9606, 10116, 9541, NA)) #' appendHumanOrthologsWithNCBI(anno) -#' +#' #' tol_anno <- data.frame(GeneID=c(780, 1506, 114483548, 102129055, NA, "NotV"), #' TaxID=c(9606, 9606, 10116, 9541, NA, NA)) #' appendHumanOrthologsWithNCBI(tol_anno) +#' } #' @importFrom ribiosUtils haltifnot #' @export appendHumanOrthologsWithNCBI <- function(anno, @@ -66,7 +69,4 @@ appendHumanOrthologsWithNCBI <- function(anno, res <- unique(res) %>% dplyr::select(-chrGeneID) return(res) -} - -## assignInNamespace("appendHumanOrthologsWithNCBI", appendHumanOrthologsWithNCBI, "ribiosAnnotation") -## rm(appendHumanOrthologsWithNCBI) \ No newline at end of file +} \ No newline at end of file diff --git a/R/featureID.R b/R/featureID.R index d8fa23a..9a32294 100644 --- a/R/featureID.R +++ b/R/featureID.R @@ -220,8 +220,7 @@ guessFeatureType <- function(featureIDs, majority=0.5) { #' #' @seealso \code{\link{annotateAnyIDs}} #' -#' @examples -#' options(error=utils::recover) +#' @examples #' \dontrun{ #' guessAndAnnotate(c("AKT1", "AKT2", "MAPK14")) #' guessAndAnnotate(c(1,2,14,149)) @@ -231,7 +230,6 @@ guessFeatureType <- function(featureIDs, majority=0.5) { #' guessAndAnnotate(c("O60583", "P05997", "Q7Z624")) #' guessAndAnnotate(c("CM000677.2", "AB003434.2")) #' } -#' options(error=NULL) #' @export guessAndAnnotate <- function(featureIDs, majority=0.5, orthologue=FALSE, multiOrth=FALSE, diff --git a/R/gti2bioc.R b/R/gti2bioc.R index 45a9e18..3055e81 100644 --- a/R/gti2bioc.R +++ b/R/gti2bioc.R @@ -1,3 +1,15 @@ +#' Translation table between GTI and Bioconductor chip type names +#' +#' A data frame mapping GTI array names to Bioconductor array names. +#' +#' @format A data frame with columns: +#' \describe{ +#' \item{GTI}{GTI chip type name} +#' \item{Bioconductor}{Bioconductor chip type name} +#' } +#' @source Compiled manually in December 2011. +"gtibioc" + #' @importFrom utils globalVariables utils::globalVariables("gtibioc") @@ -33,7 +45,7 @@ bioc2gti <- function (chipname) { #' a vector of the GTI names. Both vectors have the chip types in the other #' system as names. See examples. #' -#' @aliases gtibioc gti2bioc bioc2gti +#' @aliases gti2bioc bioc2gti #' @param chipname Character vector, chip names (types). If missing, chip types #' supported by both GTI and Bioconductor will be printed, see details. #' @return Chracter vector of the same length as the input diff --git a/R/humanOrthologsByTaxID.R b/R/humanOrthologsByTaxID.R index a738baf..5800d6f 100644 --- a/R/humanOrthologsByTaxID.R +++ b/R/humanOrthologsByTaxID.R @@ -6,7 +6,7 @@ NULL #' for instance \code{10116} for rat, \code{10090} for mouse, and \code{9541} #' for cyno (crab-eating macaque). #' @return A \code{data.frame} contains following columns: -#' \itemize{ +#' \describe{ #' \item{\code{GeneID}}{NCBI Gene ID of the query species} #' \item{\code{GeneSymbol}}{NCBI Gene symbol of the query species} #' \item{\code{Description}}{Gene description of the query species} diff --git a/R/ribiosAnnotation-package.R b/R/ribiosAnnotation-package.R new file mode 100644 index 0000000..4cde821 --- /dev/null +++ b/R/ribiosAnnotation-package.R @@ -0,0 +1,5 @@ +#' @keywords internal +"_PACKAGE" + +#' @importFrom ribiosUtils matchColumn +NULL diff --git a/R/uniprotByTaxID.R b/R/uniprotByTaxID.R index 8aa07f0..0d984cb 100644 --- a/R/uniprotByTaxID.R +++ b/R/uniprotByTaxID.R @@ -9,7 +9,8 @@ NULL #' selected top one if multiple exist. Only valid when \code{orthologue} is set #' as \code{TRUE}. #' -#' @seealso +#' @return A \code{data.frame} with UniProt accessions and gene annotations. +#' @seealso #' * \code{\link{annotateUniprotAccession}}, which annotates Uniprot accessions #' * \code{\link{annotateTaxID}}, which annotates genes given TaxID. #' @examples diff --git a/R/utils.R b/R/utils.R index 7627f94..b077845 100644 --- a/R/utils.R +++ b/R/utils.R @@ -55,7 +55,7 @@ locateSecretsFile <- function(path) { #' @param instance String, which must be found under the \code{mongodb} section #' of the JSON file #' @return A list of the following items: -#' \itemize{ +#' \describe{ #' \item{\code{hostname}}{Hostname of the MongoDB} #' \item{\code{port}}{Port of the MongoDB} #' \item{\code{dbname}}{Database of the MongoDB} @@ -89,9 +89,11 @@ loadMongodbSecrets <- function(file=locateSecretsFile(), #' @param verbose Logical #' @return A pointer to a collection on the server, as returned by #' \code{\link[mongolite]{mongo}}. -#' @examples +#' @examples +#' \dontrun{ #' giCon <- connectMongoDB(instance="bioinfo_read", #' collection="ncbi_gene_info") +#' } #' @seealso \code{\link{loadMongodbSecrets}} #' @export connectMongoDB <- function(instance="bioinfo_read", diff --git a/man/annotateAnyIDs.Rd b/man/annotateAnyIDs.Rd index 29cf8db..1a514ce 100644 --- a/man/annotateAnyIDs.Rd +++ b/man/annotateAnyIDs.Rd @@ -32,9 +32,7 @@ A \code{data.frame} containing annotation information. Following This annotates any identifies that can be recognized by GTI. } \examples{ - -options(error=utils::recover) - +\dontrun{ # GeneID annotateAnyIDs(ids=c(780, 5982, 3310, NA)) @@ -48,17 +46,13 @@ annotateAnyIDs(myprobes) # UniProt annotateAnyIDs(ids=c("P38398", "Q8NDF8")) -# EnsEMBL +# EnsEMBL ensemblIDs <- c("ENSG00000197535", "ENST00000399231.7", "ENSP00000418960.2") annotateAnyIDs(ensemblIDs) -# TODO: ENST and ENSP do not work yet -annotateAnyIDs("ENST00000399231") - # RefSeq annotateAnyIDs(c("NM_000235", "NM_000498")) - -options(error=NULL) +} } \seealso{ diff --git a/man/annotateGeneIDsWithoutHumanOrtholog.Rd b/man/annotateGeneIDsWithoutHumanOrtholog.Rd index 5c9c57e..642b370 100644 --- a/man/annotateGeneIDsWithoutHumanOrtholog.Rd +++ b/man/annotateGeneIDsWithoutHumanOrtholog.Rd @@ -22,7 +22,7 @@ A \code{data.frame} object containing the annotations: Annotate Entrez GeneIDs without querying human orthologs } \details{ -The collection {ncbi_gene_info} is used. +The collection \code{ncbi_gene_info} is used. } \note{ \code{annotatemRNAs} is an alias of \code{annotateRefSeqs} diff --git a/man/annotateProteinGroups.Rd b/man/annotateProteinGroups.Rd index 2915744..46debe7 100644 --- a/man/annotateProteinGroups.Rd +++ b/man/annotateProteinGroups.Rd @@ -41,10 +41,8 @@ returned as well. Annotate protein groups for proteomics studies } \examples{ -options(error=utils::recover) \dontrun{ annotateProteinGroups(c("A0A024RBG1;Q9NZJ9", "A0A0B4J2D5;P0DPI2", "A0A0B4J2F0;A0A0U1RRL7")) } -options(error=NULL) } diff --git a/man/appendHumanOrthologsWithNCBI.Rd b/man/appendHumanOrthologsWithNCBI.Rd index 60dd592..738e422 100644 --- a/man/appendHumanOrthologsWithNCBI.Rd +++ b/man/appendHumanOrthologsWithNCBI.Rd @@ -20,6 +20,9 @@ The function appends human orthologs to an existing annotation data.frame. It is usually called by another function. Please make sure of what you are doing if you call it directly.} } +\value{ +A \code{data.frame} with annotation and human orthologs appended. +} \description{ Append human orthologs to an existing annotation dataframe } @@ -28,6 +31,7 @@ The function does not sort the rows by GeneID. It is the responsibility of the calling function to do so. } \examples{ +\dontrun{ anno <- data.frame(GeneID=c(780, 1506, 114483548, 102129055, NA), TaxID=c(9606, 9606, 10116, 9541, NA)) appendHumanOrthologsWithNCBI(anno) @@ -36,3 +40,4 @@ tol_anno <- data.frame(GeneID=c(780, 1506, 114483548, 102129055, NA, "NotV"), TaxID=c(9606, 9606, 10116, 9541, NA, NA)) appendHumanOrthologsWithNCBI(tol_anno) } +} diff --git a/man/connectMongoDB.Rd b/man/connectMongoDB.Rd index 85a59ea..8eaf90a 100644 --- a/man/connectMongoDB.Rd +++ b/man/connectMongoDB.Rd @@ -25,9 +25,11 @@ A pointer to a collection on the server, as returned by Connect to a MongoDB instance } \examples{ +\dontrun{ giCon <- connectMongoDB(instance="bioinfo_read", collection="ncbi_gene_info") } +} \seealso{ \code{\link{loadMongodbSecrets}} } diff --git a/man/gti2bioc.Rd b/man/gti2bioc.Rd index 927ed53..d49de2f 100644 --- a/man/gti2bioc.Rd +++ b/man/gti2bioc.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/gti2bioc.R \name{gti2bioc} \alias{gti2bioc} -\alias{gtibioc} \alias{bioc2gti} \title{Translate chiptypes between GTI Bioconductor naming conventions} \usage{ diff --git a/man/gtibioc.Rd b/man/gtibioc.Rd new file mode 100644 index 0000000..f68bff3 --- /dev/null +++ b/man/gtibioc.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gti2bioc.R +\docType{data} +\name{gtibioc} +\alias{gtibioc} +\title{Translation table between GTI and Bioconductor chip type names} +\format{ +A data frame with columns: +\describe{ + \item{GTI}{GTI chip type name} + \item{Bioconductor}{Bioconductor chip type name} +} +} +\source{ +Compiled manually in December 2011. +} +\usage{ +gtibioc +} +\description{ +A data frame mapping GTI array names to Bioconductor array names. +} +\keyword{datasets} diff --git a/man/guessAndAnnotate.Rd b/man/guessAndAnnotate.Rd index 4cc3821..7c67650 100644 --- a/man/guessAndAnnotate.Rd +++ b/man/guessAndAnnotate.Rd @@ -52,7 +52,6 @@ The difference between \code{guessAndAnnotate} and \code{annotateAnyIDs} is that Guess feature ID type by majority voting and annotate them } \examples{ -options(error=utils::recover) \dontrun{ guessAndAnnotate(c("AKT1", "AKT2", "MAPK14")) guessAndAnnotate(c(1,2,14,149)) @@ -62,7 +61,6 @@ options(error=utils::recover) guessAndAnnotate(c("O60583", "P05997", "Q7Z624")) guessAndAnnotate(c("CM000677.2", "AB003434.2")) } -options(error=NULL) } \seealso{ \code{\link{annotateAnyIDs}} diff --git a/man/humanOrthologsByTaxID.Rd b/man/humanOrthologsByTaxID.Rd index 9076dea..064b3a5 100644 --- a/man/humanOrthologsByTaxID.Rd +++ b/man/humanOrthologsByTaxID.Rd @@ -13,7 +13,7 @@ for cyno (crab-eating macaque).} } \value{ A \code{data.frame} contains following columns: - \itemize{ + \describe{ \item{\code{GeneID}}{NCBI Gene ID of the query species} \item{\code{GeneSymbol}}{NCBI Gene symbol of the query species} \item{\code{Description}}{Gene description of the query species} diff --git a/man/loadMongodbSecrets.Rd b/man/loadMongodbSecrets.Rd index afa53af..b8315bc 100644 --- a/man/loadMongodbSecrets.Rd +++ b/man/loadMongodbSecrets.Rd @@ -14,7 +14,7 @@ of the JSON file} } \value{ A list of the following items: -\itemize{ +\describe{ \item{\code{hostname}}{Hostname of the MongoDB} \item{\code{port}}{Port of the MongoDB} \item{\code{dbname}}{Database of the MongoDB} diff --git a/man/ribiosAnnotation-package.Rd b/man/ribiosAnnotation-package.Rd new file mode 100644 index 0000000..bac1a82 --- /dev/null +++ b/man/ribiosAnnotation-package.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ribiosAnnotation-package.R +\docType{package} +\name{ribiosAnnotation-package} +\alias{ribiosAnnotation} +\alias{ribiosAnnotation-package} +\title{ribiosAnnotation: Annotation of Genes, RNAs, and Proteins in 'ribios'} +\description{ +Retrieves annotation information of genomic features including genes, RNAs, and proteins from databases. It supports querying by gene identifiers, gene symbols, UniProt accessions, Ensembl identifiers, and RefSeq identifiers, as well as mapping orthologs across species using NCBI data. +} +\author{ +\strong{Maintainer}: Jitao David Zhang \email{jitao_david.zhang@roche.com} (\href{https://orcid.org/0000-0002-3085-0909}{ORCID}) + +} +\keyword{internal} diff --git a/man/uniprotByTaxID.Rd b/man/uniprotByTaxID.Rd index 52251b0..beea8d1 100644 --- a/man/uniprotByTaxID.Rd +++ b/man/uniprotByTaxID.Rd @@ -16,6 +16,9 @@ the annotation} selected top one if multiple exist. Only valid when \code{orthologue} is set as \code{TRUE}.} } +\value{ +A \code{data.frame} with UniProt accessions and gene annotations. +} \description{ Get Uniprot annotation with NCBI Taxonomy ID } diff --git a/tests/testthat/test-appendHumanOrthologsWithNCBI.R b/tests/testthat/test-appendHumanOrthologsWithNCBI.R index 07b840d..c185574 100644 --- a/tests/testthat/test-appendHumanOrthologsWithNCBI.R +++ b/tests/testthat/test-appendHumanOrthologsWithNCBI.R @@ -1,15 +1,20 @@ library(ribiosAnnotation) library(testthat) -anno <- data.frame(GeneID=c(780, 1506, 114483548, 102129055, NA), - TaxID=c(9606, 9606, 10116, 9541, NA)) -annoHoApp <- appendHumanOrthologsWithNCBI(anno) +test_that("appendHumanOrthologsWithNCBI works", { + skip_if_not(file.exists(ribiosAnnotationSecretFile), + "MongoDB secrets file not found") -testthat::expect_equal(annoHoApp$GeneID, anno$GeneID) -testthat::expect_equal(annoHoApp$TaxID, anno$TaxID) -testthat::expect_equal(annoHoApp$HumanGeneID, - c(780, 1506, NA, 1, NA)) -testthat::expect_equal(annoHoApp$HumanGeneSymbol, - c("DDR1", "CTRL", NA, "A1BG", NA)) -testthat::expect_equal(annoHoApp$HumanType, - c("protein-coding", "protein-coding", NA, "protein-coding", NA)) \ No newline at end of file + anno <- data.frame(GeneID=c(780, 1506, 114483548, 102129055, NA), + TaxID=c(9606, 9606, 10116, 9541, NA)) + annoHoApp <- appendHumanOrthologsWithNCBI(anno) + + testthat::expect_equal(annoHoApp$GeneID, anno$GeneID) + testthat::expect_equal(annoHoApp$TaxID, anno$TaxID) + testthat::expect_equal(annoHoApp$HumanGeneID, + c(780, 1506, NA, 1, NA)) + testthat::expect_equal(annoHoApp$HumanGeneSymbol, + c("DDR1", "CTRL", NA, "A1BG", NA)) + testthat::expect_equal(annoHoApp$HumanType, + c("protein-coding", "protein-coding", NA, "protein-coding", NA)) +})