Skip to content

Commit

Permalink
Switch to the new formatObjectMetadata function for takane metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Apr 26, 2024
1 parent 151be9d commit 350e3a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: celldex
Title: Index of Reference Cell Type Datasets
Version: 1.13.2
Date: 2024-02-29
Version: 1.13.3
Date: 2024-04-25
Authors@R: c(person("Dvir", "Aran", email="dvir.aran@ucsf.edu", role=c("aut")),
person("Aaron", "Lun", email="infinite.monkeys.with.keyboards@gmail.com", role=c("aut", "cre", "cph")),
person("Daniel", "Bunis", role="aut"),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ importFrom(gypsum,defineTextQuery)
importFrom(gypsum,fetchLatest)
importFrom(gypsum,fetchMetadataDatabase)
importFrom(gypsum,fetchMetadataSchema)
importFrom(gypsum,formatObjectMetadata)
importFrom(gypsum,listAssets)
importFrom(gypsum,saveFile)
importFrom(gypsum,saveVersion)
Expand Down
16 changes: 7 additions & 9 deletions R/saveReference.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#' @importMethodsFrom alabaster.se saveObject
#' @importFrom DelayedArray type
#' @importFrom SummarizedExperiment SummarizedExperiment assay<- assayNames colData
#' @importFrom gypsum fetchMetadataSchema validateMetadata
#' @importFrom gypsum fetchMetadataSchema validateMetadata formatObjectMetadata
#' @importFrom jsonlite toJSON
saveReference <- function(x, labels, path, metadata) {
schema <- fetchMetadataSchema()
Expand Down Expand Up @@ -105,14 +105,12 @@ saveReference <- function(x, labels, path, metadata) {
saveObject(se, path, ReloadedArray.reuse.files="symlink")

# Attach some takane metadata to it.
takane <- list(type = "summarized_experiment")
takane$summarized_experiment = list(
rows = nrow(se),
columns = ncol(se),
assays = I(assayNames(se)),
column_annotations = I(colnames(colData(se)))
)
metadata$applications <- c(metadata$applications, list(takane=takane))
takane <- formatObjectMetadata(se)
takane$type <- readObjectFile(path)$type
if (is.null(metadata$applications)) {
metadata$applications <- list()
}
metadata$applications$takane <- takane

# Second validation with the takane metadata.
contents <- toJSON(metadata, pretty=4, auto_unbox=TRUE)
Expand Down

0 comments on commit 350e3a2

Please sign in to comment.