diff --git a/.github/workflows/check-bioc.yml b/.github/workflows/check-bioc.yml index 31efa2b..9fee5c1 100644 --- a/.github/workflows/check-bioc.yml +++ b/.github/workflows/check-bioc.yml @@ -216,6 +216,7 @@ jobs: shell: Rscript {0} - name: Run CMD check + if: env.cmd_check == 'true' env: _R_CHECK_CRAN_INCOMING_: false DISPLAY: 99.0 @@ -241,6 +242,7 @@ jobs: shell: Rscript {0} - name: Run BiocCheck + if: env.has_bioc_check == 'true' env: DISPLAY: 99.0 run: | diff --git a/DESCRIPTION b/DESCRIPTION index b29aba4..e416aa7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -53,9 +53,6 @@ Collate: 'BiocFileCache_database_class.R' 'CompoundDb_source_class.R' 'MTox700plus_database_class.R' - 'annotation_table_class.R' - 'lcms_table_class.R' - 'MetFrag_source_class.R' 'MetMashR-package.R' 'PathBank_metabolite_database_class.R' 'add_columns_class.R' @@ -64,9 +61,11 @@ Collate: 'annotation_histogram_class.R' 'annotation_histogram2d_class.R' 'annotation_pie_chart.R' + 'annotation_table_class.R' 'annotation_venn_chart.R' 'calc_ppm_diff_class.R' 'calc_rt_diff_class.R' + 'lcms_table_class.R' 'cd_source_class.R' 'rest_api_parsers.R' 'rest_api_class.R' diff --git a/NAMESPACE b/NAMESPACE index 52e86c8..e9b2dd9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -24,7 +24,6 @@ export(BiocFileCache_database) export(CompoundDb_source) export(GO_database) export(MTox700plus_database) -export(MetFrag_source) export(PathBank_metabolite_database) export(add_columns) export(add_labels) diff --git a/R/MTox700plus_database_class.R b/R/MTox700plus_database_class.R index 9231c6d..cef1c19 100644 --- a/R/MTox700plus_database_class.R +++ b/R/MTox700plus_database_class.R @@ -58,7 +58,7 @@ MTox700plus_database <- function(version = "latest", "The version number of the MTox700+ database to import. ", "Available versions are listed here: ", "[https://github.com/michabohealthscience/MTox700plus/releases].", - ' `version` should match the tag of thr release e.g. `"v1.0"`.', + ' `version` should match the tag of the release e.g. `"v1.0"`.', ' For convenience `version = "latest"` will always retrieve ', "the most recent release. To prevent unecessary downloads ", "`BiocFileCache` is used to store a local copy." diff --git a/R/MetFrag_source_class.R b/R/MetFrag_source_class.R deleted file mode 100644 index 7058ab7..0000000 --- a/R/MetFrag_source_class.R +++ /dev/null @@ -1,56 +0,0 @@ -#' @eval get_description('MetFrag_source') -#' @include lcms_table_class.R -#' @family {annotation tables} -#' @export MetFrag_source -MetFrag_source <- function(source, - tag = "MetFrag", - ...) { - # new object - out <- new_struct( - "MetFrag_source", - source = source, - tag = tag, - ... - ) - return(out) -} - - -.MetFrag_source <- setClass( - "MetFrag_source", - contains = c("lcms_table") -) - -#' @export -setMethod( - f = "model_apply", - signature = c("MetFrag_source", "annotation_source"), - definition = function(M, D) { - # read in the file - MF <- read.table( - file = M$source, sep = "\t", - header = TRUE - ) - - # add ids - MF$id <- as.character(seq_len(nrow(MF))) - - # add extra columns if requested - if (length(M$add_cols) > 0) { - for (g in seq_len(length(M$add_cols))) { - MF[[names(M$add_cols)[g]]] <- M$add_cols[[g]] - } - } - - D$data <- MF - - D$mz_column <- "parentMZ" - D$tag <- M$tag - D$rt_column <- "parentRT" - D$id_column <- "id" - - M$imported <- D - - return(M) - } -) diff --git a/R/cd_source_class.R b/R/cd_source_class.R index 9775d73..0ff74ad 100644 --- a/R/cd_source_class.R +++ b/R/cd_source_class.R @@ -1,5 +1,5 @@ #' @eval get_description('cd_source') -#' @include annotation_source_class.R +#' @include annotation_source_class.R lcms_table_class.R #' @family {annotation sources} #' @family {annotation tables} #' @rawNamespace import(dplyr, except = as_data_frame) diff --git a/man/MTox700plus_database.Rd b/man/MTox700plus_database.Rd index 391ef59..fd949ed 100644 --- a/man/MTox700plus_database.Rd +++ b/man/MTox700plus_database.Rd @@ -12,7 +12,7 @@ MTox700plus_database( ) } \arguments{ -\item{version}{(character) The version number of the MTox700+ database to import. Available versions are listed here: \link{https://github.com/michabohealthscience/MTox700plus/releases}. \code{version} should match the tag of thr release e.g. \code{"v1.0"}. For convenience \code{version = "latest"} will always retrieve the most recent release. To prevent unecessary downloads \code{BiocFileCache} is used to store a local copy. The default is \code{"latest"}.} +\item{version}{(character) The version number of the MTox700+ database to import. Available versions are listed here: \link{https://github.com/michabohealthscience/MTox700plus/releases}. \code{version} should match the tag of the release e.g. \code{"v1.0"}. For convenience \code{version = "latest"} will always retrieve the most recent release. To prevent unecessary downloads \code{BiocFileCache} is used to store a local copy. The default is \code{"latest"}.} \item{bfc_path}{(character, NULL) \code{BiocFileCache} is used to cache the database locally and prevent unnecessary downloads. If a path is provided then \code{BiocFileCache} will use this location. If NULL it will use the default location (see \code{\link[BiocFileCache:BiocFileCache-class]{BiocFileCache::BiocFileCache()}} for details). The default is \code{NULL}.} diff --git a/man/MetFrag_source.Rd b/man/MetFrag_source.Rd deleted file mode 100644 index 0d21025..0000000 --- a/man/MetFrag_source.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/MetFrag_source_class.R -\name{MetFrag_source} -\alias{MetFrag_source} -\title{LCMS table} -\usage{ -MetFrag_source(source, tag = "MetFrag", ...) -} -\arguments{ -\item{source}{(ANY) The source of annotation data.} - -\item{tag}{(character) A (short) character string that is used to represent this source e.g. in column names or source columns when used in a workflow. The default is \code{"MetFrag"}.} - -\item{...}{Additional slots and values passed to \code{struct_class}.} -} -\value{ -A \code{ -MetFrag_source -} object. This object has no \code{output} slots. -} -\description{ -An LCMS table extends \code{\link[=annotation_table]{annotation_table()}} to represent annotation data for an LCMS experiment. Columns representing m/z and retention time are required for an \code{lcms_table}. -} -\section{Inheritance}{ - -A \code{MetFrag_source} object inherits the following \code{struct} classes: \cr\cr -\verb{[MetFrag_source]} >> \verb{[lcms_table]} >> \verb{[annotation_table]} >> \verb{[annotation_source]} >> \verb{[struct_class]} -} - -\examples{ -M = MetFrag_source( - mz_column = "mz", - rt_column = "rt", - id_column = "id", - tag = character(0), - data = data.frame(id=NA), - source = "ANY") - -} -\seealso{ -Other {annotation tables}: -\code{\link{annotation_table}}, -\code{\link{cd_source}}, -\code{\link{ls_source}} -} -\concept{{annotation tables}} diff --git a/man/annotation_table.Rd b/man/annotation_table.Rd index 28807a5..0bd56a6 100644 --- a/man/annotation_table.Rd +++ b/man/annotation_table.Rd @@ -40,7 +40,6 @@ M = annotation_table( } \seealso{ Other {annotation tables}: -\code{\link{MetFrag_source}}, \code{\link{cd_source}}, \code{\link{ls_source}} diff --git a/man/cd_source.Rd b/man/cd_source.Rd index 785f6c3..1b4a230 100644 --- a/man/cd_source.Rd +++ b/man/cd_source.Rd @@ -62,7 +62,6 @@ Other {annotation sources}: \code{\link{mspurity_source}} Other {annotation tables}: -\code{\link{MetFrag_source}}, \code{\link{annotation_table}}, \code{\link{ls_source}} } diff --git a/man/ls_source.Rd b/man/ls_source.Rd index b5aa279..3b5ff75 100644 --- a/man/ls_source.Rd +++ b/man/ls_source.Rd @@ -58,7 +58,6 @@ Other {annotation sources}: \code{\link{mspurity_source}} Other {annotation tables}: -\code{\link{MetFrag_source}}, \code{\link{annotation_table}}, \code{\link{cd_source}} }