Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
grlloyd committed Mar 21, 2024
1 parent b334cf0 commit 5169062
Show file tree
Hide file tree
Showing 139 changed files with 9,807 additions and 9,401 deletions.
16 changes: 10 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ Authors@R: c(
email="[email protected]")
)
Description: A package to merge, filter sort, organise and otherwise mash
together metabolite annotations. Metabolite annotations can be imported from
multiple sources (software) and combined using workflow steps based on S4
class templates derived from the `struct` package.
together metabolite annotation tables. Metabolite annotations can be
imported from multiple sources (software) and combined using workflow
steps based on S4
class templates derived from the `struct` package. Other modular workflow
such as filtering, merging, splitting, normalisation and rest-api queries
are also included.
License: GPL-3
Encoding: UTF-8
LazyData: false
RoxygenNote: 7.3.1
Depends:
R (>= 4.3.0),
R (>= 4.4.0),
struct
Imports:
dplyr,
Expand All @@ -37,7 +40,8 @@ Imports:
ggthemes,
cowplot,
ggplot2,
utils
utils,
rlang
Collate:
'generics.R'
'zzz.R'
Expand Down Expand Up @@ -140,5 +144,5 @@ Config/testthat/edition: 3
VignetteBuilder: knitr
URL: https://computational-metabolomics.github.io/MetMashR/
Roxygen: list(markdown = TRUE)
biocViews: WorkflowStep, Metabolomics
biocViews: WorkflowStep, Metabolomics, KEGG
BugReports: https://github.com/computational-metabolomics/MetMashR/issues
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import(dplyr, except = as_data_frame)
import(ggplot2)
import(ggthemes)
import(httr)
import(methods)
import(rlang)
importFrom(scales,manual_pal)
importFrom(utils,capture.output)
72 changes: 35 additions & 37 deletions R/AnnotationDb_database.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,65 @@
#' @include annotation_database_class.R
#' @family {annotation databases}
#' @seealso [AnnotationDbi::AnnotationDb]
AnnotationDb_database = function(
source,
table,
...) {

AnnotationDb_database <- function(source,
table,
...) {
# new object
out = struct::new_struct(
'AnnotationDb_database',
out <- struct::new_struct(
"AnnotationDb_database",
source = source,
table = table,
...
)
return(out)
}

.AnnotationDb_database<-setClass(
.AnnotationDb_database <- setClass(
"AnnotationDb_database",
contains = 'annotation_database',
contains = "annotation_database",
slots = c(
table = 'entity'
table = "entity"
),
prototype = list(
name = 'AnnotationDb database',
name = "AnnotationDb database",
description = paste0(
'Retrieve a table from an AnnotationDb package.'),
type='AnnotationDb_database',
"Retrieve a table from an AnnotationDb package."
),
type = "AnnotationDb_database",
.writable = FALSE,
libraries = 'AnnotationDbi',
libraries = "AnnotationDbi",
table = entity(
name = 'Table name',
name = "Table name",
description = paste0(
'The name of a table to import from the specified source ',
'AnnotationDb package.'),
type = 'character',
"The name of a table to import from the specified source ",
"AnnotationDb package."
),
type = "character",
max_length = 1
),
source = entity(
name = 'AnnotationDb package name',
name = "AnnotationDb package name",
description = paste0(
'The name of an AnnotationDb package to import the specified ',
'table from. Note the package should already be installed.'),
type = 'character',
"The name of an AnnotationDb package to import the specified ",
"table from. Note the package should already be installed."
),
type = "character",
max_length = 1
),
.params = 'table'
.params = "table"
)
)

#' @export
setMethod(f="read_database",
signature=c("AnnotationDb_database"),definition = function(obj) {
# get resource
IN = get(obj$table, envir = loadNamespace(obj$source))
IN = as.list(IN)
IN = stack(IN)
colnames(IN)[1] = obj$source
# return
return(IN[,c(2,1)])
}
setMethod(
f = "read_database",
signature = c("AnnotationDb_database"), definition = function(obj) {
# get resource
IN <- get(obj$table, envir = loadNamespace(obj$source))
IN <- as.list(IN)
IN <- stack(IN)
colnames(IN)[1] <- obj$source
# return
return(IN[, c(2, 1)])
}
)



Loading

0 comments on commit 5169062

Please sign in to comment.