Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
^\.github$
^Makefile$
^coverage\.txt$
^coverage\.r$
64 changes: 18 additions & 46 deletions .github/workflows/standard-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 17 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <jitao_david.zhang@roche.com>
Maintainer: Jitao David Zhang <jitao_david.zhang@roche.com>
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,
Expand All @@ -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'
Expand All @@ -38,6 +46,7 @@ Collate:
'formatIn.R'
'gti2bioc.R'
'humanOrthologsByTaxID.R'
'ribiosAnnotation-package.R'
'taxID.R'
'uniprotByTaxID.R'
Remotes:
Expand Down
24 changes: 9 additions & 15 deletions R/annotateAnyIDs.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/annotateGeneIDs.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ annotateGeneIDs <- function(ids, orthologue=FALSE, multiOrth=FALSE) {
#' @note \code{annotatemRNAs} is an alias of \code{annotateRefSeqs}
#' @author Jitao David Zhang <jitao_david.zhang@@roche.com>
#'
#' @details The collection {ncbi_gene_info} is used.
#' @details The collection \code{ncbi_gene_info} is used.
#'
#' @examples
#'
Expand Down
1 change: 0 additions & 1 deletion R/annotateGeneSymbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,4 @@ annotateGeneSymbols <- function(ids, taxId=9606, orthologue=FALSE, multiOrth=FAL
res <- annotateGeneSymbolsWithHumanOrtholog(ids, taxId=taxId, multiOrth=TRUE)
}
return(res)
return(NULL)
}
5 changes: 0 additions & 5 deletions R/annotateProteinGroups.R
Original file line number Diff line number Diff line change
Expand Up @@ -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=";",
Expand All @@ -62,6 +60,3 @@ annotateProteinGroups <- function(ids, delimiter=";",
unique
return(res)
}

## assignInNamespace("getGenesPerIndex", getGenesPerIndex, "ribiosAnnotation")
## assignInNamespace("annotateProteinGroups", annotateProteinGroups, "ribiosAnnotation")
12 changes: 6 additions & 6 deletions R/appendHumanOrthologsWithNCBI.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -66,7 +69,4 @@ appendHumanOrthologsWithNCBI <- function(anno,

res <- unique(res) %>% dplyr::select(-chrGeneID)
return(res)
}

## assignInNamespace("appendHumanOrthologsWithNCBI", appendHumanOrthologsWithNCBI, "ribiosAnnotation")
## rm(appendHumanOrthologsWithNCBI)
}
4 changes: 1 addition & 3 deletions R/featureID.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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,
Expand Down
14 changes: 13 additions & 1 deletion R/gti2bioc.R
Original file line number Diff line number Diff line change
@@ -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")

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/humanOrthologsByTaxID.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 5 additions & 0 deletions R/ribiosAnnotation-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#' @keywords internal
"_PACKAGE"

#' @importFrom ribiosUtils matchColumn
NULL
3 changes: 2 additions & 1 deletion R/uniprotByTaxID.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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",
Expand Down
12 changes: 3 additions & 9 deletions man/annotateAnyIDs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/annotateGeneIDsWithoutHumanOrtholog.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/annotateProteinGroups.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading