Installation
- Using
devtoolspackage
# Load devtools package
library(devtools)
# Install SigRepo
devtools::install_github(repo = 'montilab/SigRepo')
# Install OmicSignature
devtools::install_github(repo = 'montilab/OmicSignature')
Load packages
# Load tidyverse package
library(tidyverse)
# Load SigRepo package
library(SigRepo)
# Load OmicSignature package
library(OmicSignature)
Create a handler to connect to SigRepo Database
# Create a connection handler
conn_handler <- SigRepo::newConnHandler(
dbname = "sigrepo",
host = "sigrepo.org",
port = 3306,
user = <your_username>,
password = <your_password>
)
Load signatures
Here, we provided 4 signature objects that came with the package for demonstrations:
- omic_signature_1 (
Myc_reduce_mice_liver_24m_v1) - omic_signature_2 (
Myc_reduce_mice_liver_24m_v2) - omic_signature_3 (
Myc_reduce_mice_liver_24m_v3) - omic_signature_4 (
Myc_reduce_mice_liver_24m_v4)
# Read in the signature objects
omic_signature_1 <- base::readRDS(base::file.path(base::system.file("inst/extdata", package = "SigRepo"), "omic_signature_1.rds"))
omic_signature_2 <- base::readRDS(base::file.path(base::system.file("inst/extdata", package = "SigRepo"), "omic_signature_2.rds"))
omic_signature_3 <- base::readRDS(base::file.path(base::system.file("inst/extdata", package = "SigRepo"), "omic_signature_3.rds"))
omic_signature_4 <- base::readRDS(base::file.path(base::system.file("inst/extdata", package = "SigRepo"), "omic_signature_4.rds"))Create an omic collection
Here, we will create a collection with two signatures,
omic_signature_1 and omic_signature_1,
provided above. See ?OmicSignatureCollection() from
OmicSignature package for more details on how to create an
omic collection object.
# 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
)
#> [Success] OmicSignature Collection my_collection created.Upload a collection to the database
The SigRepo::addCollection() function allows users to
upload a collection to the database.
IMPORTANT NOTE:
- The user
MUST HAVEaneditororadminaccount to use this function. - A collection
MUST BEan R6 object obtained fromOmicSignature::OmicSignatureCollection()
SigRepo::addCollection(
conn_handler = conn_handler, # A handler contains user credentials to establish connection to a remote database
omic_collection = omic_collection, # An R6 object obtained from OmicSignature::OmicSignatureCollection()
visibility = FALSE, # Whether to make the collection public or private. Default is FALSE.
return_collection_id = FALSE, # Whether to return the uploaded collection id. Default is FALSE.
verbose = TRUE # Whether to print diagnostic messages. Default is TRUE.
)
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v1 created.
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v2 created.
#> [Success] OmicSignature Collection my_collection created.
#> Uploading each signature in the collection to the database...
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v1 created.
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v2 created.
#> Uploading collection metadata to the database...
#> Adding user to collection access table in the database...
#> Adding signature to the collection access table of the database...
#> Finished uploading.
#> ID of the uploaded collection: 168Search for a collection in the database
The SigRepo::searchCollection() function allows users to
retrieve all collections that are available in the database.
Example 1: Search for all collections
# Get all collections
collection_tbl_1 <- SigRepo::searchCollection(conn_handler = conn_handler)
# WARNINGS: THE COLLECTION TABLE CAN BE LARGE, SO ONLY THE FIRST SIX OBSERVATIONS ARE SHOWN.
if(base::nrow(collection_tbl_1) > 0){
knitr::kable(
utils::head(collection_tbl_1),
row.names = FALSE
)
}| collection_id | collection_name | description | user_name | date_created | visibility | collection_hashkey | signature_id | signature_collection_hashkey | signature_name |
|---|---|---|---|---|---|---|---|---|---|
| 61 | Aging_Hs_HNSC_RNASeq_TCGA_MontiLab2024 | agingâ€associated transcriptomic signature from HPV-negative Head and Neck Squamous Cell Carcinoma (HNSC) using TCGA RNA-seq differential expression results | H_Nikoueian | 2025-10-03 15:09:35 | 0 | 47b45086ae30d329d17ad93db68479de | 213 | 4abdc3cd86a6f59eeb33ac7bf55252e2 | Aging_Hs_HNSC_RNASeq_TCGA_ACC_MontiLab2025 |
| 61 | Aging_Hs_HNSC_RNASeq_TCGA_MontiLab2024 | agingâ€associated transcriptomic signature from HPV-negative Head and Neck Squamous Cell Carcinoma (HNSC) using TCGA RNA-seq differential expression results | H_Nikoueian | 2025-10-03 15:09:35 | 0 | 47b45086ae30d329d17ad93db68479de | 214 | 8b4077aa6a4434add27043542cad2e8a | Aging_Hs_HNSC_RNASeq_TCGA_BLCA_MontiLab2025 |
| 61 | Aging_Hs_HNSC_RNASeq_TCGA_MontiLab2024 | agingâ€associated transcriptomic signature from HPV-negative Head and Neck Squamous Cell Carcinoma (HNSC) using TCGA RNA-seq differential expression results | H_Nikoueian | 2025-10-03 15:09:35 | 0 | 47b45086ae30d329d17ad93db68479de | 215 | 43d0193b623ae62359f03ad342298498 | Aging_Hs_HNSC_RNASeq_TCGA_BRCA_MontiLab2025 |
| 61 | Aging_Hs_HNSC_RNASeq_TCGA_MontiLab2024 | agingâ€associated transcriptomic signature from HPV-negative Head and Neck Squamous Cell Carcinoma (HNSC) using TCGA RNA-seq differential expression results | H_Nikoueian | 2025-10-03 15:09:35 | 0 | 47b45086ae30d329d17ad93db68479de | 216 | f984e7003314d15197a30d239df47b01 | Aging_Hs_HNSC_RNASeq_TCGA_CESC_MontiLab2025 |
| 61 | Aging_Hs_HNSC_RNASeq_TCGA_MontiLab2024 | agingâ€associated transcriptomic signature from HPV-negative Head and Neck Squamous Cell Carcinoma (HNSC) using TCGA RNA-seq differential expression results | H_Nikoueian | 2025-10-03 15:09:35 | 0 | 47b45086ae30d329d17ad93db68479de | 217 | 82fae89f903a358b58654d5e2f2d33c8 | Aging_Hs_HNSC_RNASeq_TCGA_COAD_MontiLab2025 |
| 61 | Aging_Hs_HNSC_RNASeq_TCGA_MontiLab2024 | agingâ€associated transcriptomic signature from HPV-negative Head and Neck Squamous Cell Carcinoma (HNSC) using TCGA RNA-seq differential expression results | H_Nikoueian | 2025-10-03 15:09:35 | 0 | 47b45086ae30d329d17ad93db68479de | 218 | 6498fece50ede60a446812e25f080c7d | Aging_Hs_HNSC_RNASeq_TCGA_ESCA_MontiLab2025 |
Example 2: Search for a specific collection by its name, e.g.,
collection_name = "my_collection".
collection_tbl_2 <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
if(base::nrow(collection_tbl_2) > 0){
knitr::kable(
collection_tbl_2,
row.names = FALSE
)
}| collection_id | collection_name | description | user_name | date_created | visibility | collection_hashkey | signature_id | signature_collection_hashkey | signature_name |
|---|---|---|---|---|---|---|---|---|---|
| 168 | my_collection | An example of signature collection | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 413 | c743f5567dcca2a589bd122500a31722 | Myc_reduce_mice_liver_24m_v1 |
| 168 | my_collection | An example of signature collection | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 414 | 68a0652359fc30f530eea8d849f5dd0a | Myc_reduce_mice_liver_24m_v2 |
Retrieve a set of collections in the database
The SigRepo::getCollection() function allows users to
retrieve a set of collections that are PUBLICLY available
in the database.
IMPORTANT NOTE:
- Users can
ONLY RETRIEVEa list of collections that are publicly available in the database including their own uploaded collections. - If a collection is
PRIVATEand belongs to other user in the database, users will need to be given aneditorpermission from its owner to access, retrieve, and edit their collections.
Example 1: Get all collections that are publicly available in the database
# WARNINGS: THE COLLECTION LIST CAN BE LARGE TO DOWNLOAD (NOT RUN)
collection_list_1 <- SigRepo::getCollection(conn_handler = conn_handler)
Example 2: Get a specific collection that is publicly available or
owned by user in the database, e.g.,
collection_name = "my_collection"
collection_list_2 <- SigRepo::getCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
#> now dyn.load("/home/runner/work/_temp/Library/curl/libs/curl.so") ...
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v1 created.
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v2 created.
#> [Success] OmicSignature Collection my_collection created.Update a collection metadata
The SigRepo::updateCollectionMetadata() function allows
users to update the metadata information of a collection in the
database.
IMPORTANT NOTE:
- Users
MUST HAVEaneditororadminaccount to use this function. - Furthermore, users can
ONLY UPDATEtheir own uploaded signatures or were given aneditorpermission from its owner to access, retrieve, and edit their collections.
For example, if you want to change the description of
"my_collection" in the database to
"This is the updated description." You can use the
SigRepo::updateCollectionMetadata() function as
follows:
# Let's search for my_collection in the database
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
# If the collection exists, update it with the new description
if(base::nrow(collection_tbl) > 0){
SigRepo::updateCollectionMetadata(
conn_handler = conn_handler,
collection_id = collection_tbl$collection_id,
description = "This is the updated description."
)
}
#> collection_id = '168' has been updated.Now, let’s search for "my_collection" in the database
and see if its description has been updated.
# Search for my_collection in the database
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
# If the collection exists, display the table
if(base::nrow(collection_tbl) > 0){
knitr::kable(
collection_tbl,
row.names = FALSE
)
}| collection_id | collection_name | description | user_name | date_created | visibility | collection_hashkey | signature_id | signature_collection_hashkey | signature_name |
|---|---|---|---|---|---|---|---|---|---|
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 413 | c743f5567dcca2a589bd122500a31722 | Myc_reduce_mice_liver_24m_v1 |
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 414 | 68a0652359fc30f530eea8d849f5dd0a | Myc_reduce_mice_liver_24m_v2 |
Add signatures to an existing collection in the database
The SigRepo::addSignatureToCollection() function allows
users to add a set of signatures to an existing collection in the
database.
IMPORTANT NOTE:
- Users
MUST HAVEaneditororadminaccount to use this function. - Furthermore, users can
ONLY UPDATEtheir own uploaded signatures or were given aneditorpermission from its owner to access, retrieve, and edit their collections.
For example, if you wish to create two new signatures
("omic_signature_3", "omic_signature_4") and
add them to "my_collection"in the database.
# Add omic_signature_3 to the database
signature_id_3 <- SigRepo::addSignature(
conn_handler = conn_handler,
omic_signature = omic_signature_3,
return_signature_id = TRUE,
verbose = FALSE
)
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v3 created.
# Add omic_signature_4 to the database
signature_id_4 <- SigRepo::addSignature(
conn_handler = conn_handler,
omic_signature = omic_signature_4,
return_signature_id = TRUE,
verbose = FALSE
)
#> [Success] OmicSignature object Myc_reduce_mice_liver_24m_v4 created.
# Search for my_collection in the database
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection",
verbose = FALSE
)
# If both collection and signatures exist, add its signature ids to collection.
if(base::nrow(collection_tbl) > 0 && base::length(signature_id_3) > 0 && base::length(signature_id_4) > 0){
SigRepo::addSignatureToCollection(
conn_handler = conn_handler,
collection_id = collection_tbl$collection_id,
signature_id = c(signature_id_3, signature_id_4)
)
}Now, let’s search for "my_collection" in the database
and see if the signatures are added to the collection.
# Search for my_collection in the database
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
# If collection exists, display the table
if(base::nrow(collection_tbl) > 0){
knitr::kable(
collection_tbl,
row.names = FALSE
)
}| collection_id | collection_name | description | user_name | date_created | visibility | collection_hashkey | signature_id | signature_collection_hashkey | signature_name |
|---|---|---|---|---|---|---|---|---|---|
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 413 | c743f5567dcca2a589bd122500a31722 | Myc_reduce_mice_liver_24m_v1 |
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 414 | 68a0652359fc30f530eea8d849f5dd0a | Myc_reduce_mice_liver_24m_v2 |
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 415 | 77ca7ffeb6e57f62e453193fe4a5ab4a | Myc_reduce_mice_liver_24m_v3 |
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 416 | 1a7dec419305de845854da969131d2d2 | Myc_reduce_mice_liver_24m_v4 |
Remove a list of signatures from a collection in the database
The SigRepo::removeSignatureFromCollection() function
allows users to remove a list of signatures from a collection in the
database.
IMPORTANT NOTE:
- Users
MUST HAVEaneditororadminaccess to use this function. - Furthermore, users can
ONLY UPDATEtheir own uploaded signatures or were given aneditorpermission from its owner to access, retrieve, and edit their collections.
For example, if you wish to remove
"Myc_reduce_mice_liver_24m_v1" from
"my_collection"in the database
# Lets' check if signature = Myc_reduce_mice_liver_24m_v1 is in my_collection
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection",
signature_name = "Myc_reduce_mice_liver_24m_v1"
)
# If signature collection combo exists, remove the signature.
if(base::nrow(collection_tbl) > 0){
SigRepo::removeSignatureFromCollection(
conn_handler = conn_handler,
collection_id = collection_tbl$collection_id,
signature_id = collection_tbl$signature_id
)
}
#> Removing signature_id = '413' from collection_id = '168' completed.Now, let’s search for "my_collection" in the database
and see if signatures have been removed from the collection.
# Search for my_collection in the database
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
# If collection exists, display the table
if(base::nrow(collection_tbl) > 0){
knitr::kable(
collection_tbl,
row.names = FALSE
)
}| collection_id | collection_name | description | user_name | date_created | visibility | collection_hashkey | signature_id | signature_collection_hashkey | signature_name |
|---|---|---|---|---|---|---|---|---|---|
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 414 | 68a0652359fc30f530eea8d849f5dd0a | Myc_reduce_mice_liver_24m_v2 |
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 415 | 77ca7ffeb6e57f62e453193fe4a5ab4a | Myc_reduce_mice_liver_24m_v3 |
| 168 | my_collection | This is the updated description. | montilab | 2025-10-27 16:30:32 | 0 | a7213731b133effec506851ef7cb443f | 416 | 1a7dec419305de845854da969131d2d2 | Myc_reduce_mice_liver_24m_v4 |
Delete the whole collection from the database
The SigRepo::deleteCollection() function allows users to
delete a collection from the database.
IMPORTANT NOTE:
- Users
MUST HAVEaneditororadminaccount to use this function. - Furthermore, users can
ONLY DELETEtheir own uploaded collections or were given aneditorpermission from other users in the database to access and delete their collection. - A collection can
ONLY BE REMOVED OR DELETEDone at a time.
# Search for my_collection in the database
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
# If the collection exists, remove it from the database
if(base::nrow(collection_tbl) > 0){
SigRepo::deleteCollection(
conn_handler = conn_handler,
collection_id = collection_tbl$collection_id
)
}
#> Remove collection_id = '168' from 'collection' table of the database.
#> Remove collection_id = '168' from 'collection_access' table of the database.
#> Remove signatures belongs to collection_id = '168' from 'signature_collection_access' table of the database.
#> collection_id = '168' has been removed.Finally, let’s search for "my_collection" in the
database and see if the collection has been removed.
collection_tbl <- SigRepo::searchCollection(
conn_handler = conn_handler,
collection_name = "my_collection"
)
#> There is no collection returned from the search parameters.