Skip to contents

Add signature collections to database

Usage

addCollection(
  conn_handler = NULL,
  omic_collection,
  visibility = FALSE,
  metabolomics_nomenclature = NULL,
  return_collection_id = FALSE,
  verbose = TRUE
)

Arguments

conn_handler

An R object obtained from SigRepo::newConnhandler() (required)

omic_collection

A collection of OmicSignature R6 objects from the OmicSignature package (required)

visibility

Logical; whether the uploaded collection should be visible and accessible to others, Defaults to 'FALSE'

metabolomics_nomenclature

Optional metabolite dictionary for metabolomics signatures in the collection. One of refmet, hmdb, smiles, or inchikey. A single value applies to all metabolomics signatures; a named vector or named list can be used to specify values per signature name.

return_collection_id

Logical; whether to return the ID of the uploaded collection Defaults to 'FALSE'

verbose

Logical; whether to print diagnostic messages. Defaults to 'TRUE'.

Examples


if (FALSE) { # \dontrun{

library(OmicSignature)

# Create a connection handler
conn_handler <- SigRepo::newConnHandler(
  dbname = "sigrepo", 
  host = "sigrepo.org", 
  port = 3306, 
  user = "your_username", 
  password = "your_password"
)

# Load signature objects
utils::data("omic_signature_1", package = "SigRepo")
utils::data("omic_signature_2", package = "SigRepo")

# Create a metadata object for the collection
metadata <- base::list(
  "collection_name" = "my_collection",
  "description" = "An example of signature collection"
)

# Create an omic collection using OmicSignatureCollection() from OmicSignature package
omic_collection <- OmicSignature::OmicSignatureCollection$new(
  OmicSigList = base::list(omic_signature_1, omic_signature_2),
  metadata = metadata
)

# Add collection to database
SigRepo::addCollection(
  conn_handler = conn_handler,
  omic_collection  = omic_collection,
  visibility = FALSE,
  return_collection_id = TRUE,
  verbose = TRUE
)

} # }