Title: | Obtain and Visualize Regulome-Gene Expression Correlations in Cancer |
---|---|
Description: | Builds a 'SQLite' database file of pre-calculated transcription factor/microRNA-gene correlations (co-expression) in cancer from the Cistrome Cancer Liu et al. (2011) <doi:10.1186/gb-2011-12-8-r83> and 'miRCancerdb' databases (in press). Provides custom classes and functions to query, tidy and plot the correlation data. |
Authors: | Mahmoud Ahmed [aut, cre] |
Maintainer: | Mahmoud Ahmed <[email protected]> |
License: | GPL-3 |
Version: | 0.3.2 |
Built: | 2024-12-04 18:02:51 UTC |
Source: | https://github.com/ropensci/cRegulome |
Constructs an S3 object called cmicroRNA contains data returned by calling get_mir. Used to define methods for printing and visualizing microRNA-gene expression correlations.
cmicroRNA(dat_mir)
cmicroRNA(dat_mir)
dat_mir |
A |
An S3 object of class cmicroRNA
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cmicroRNA object cmir <- cmicroRNA(dat)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cmicroRNA object cmir <- cmicroRNA(dat)
Plot a hist
of sets of microRNAs or transcription
factors-gene correlations in a TCGA study.
cor_hist(ob, study, ...)
cor_hist(ob, study, ...)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
study |
A |
... |
Other options |
An hist
plot of the correlations values
between genes a microRNA or a transcription factor in a TCGA study
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_hist(cmir)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_hist(cmir)
An igraph
object of from cmicroRNA or cTF
objects.
cor_igraph(ob, directed = FALSE)
cor_igraph(ob, directed = FALSE)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
directed |
A |
An igraph
object
# load required libraries library(RSQLite) library(cRegulome) # locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- dbConnect(SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_igraph(cmir)
# load required libraries library(RSQLite) library(cRegulome) # locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- dbConnect(SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_igraph(cmir)
A ggridges
joy plot of sets of microRNAs or transcription
factors-gene correlations in a TCGA study.
cor_joy(ob, study, ...)
cor_joy(ob, study, ...)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
study |
A |
... |
Other options |
An ggridges
plot object
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_joy(cmir)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_joy(cmir)
A dot plot of microRNA/TF correlation in a single study of TCGA. When the
object cmicroRNA/cTF contains more than one TCGA studies, the
argument study
is a requirement.
cor_plot(ob, study, ...)
cor_plot(ob, study, ...)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
study |
A |
... |
Other options |
A ggplot
object of a dot plot of the correlation values
between genes and microRNAs or transcription factors in a TCGA study.
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_plot(cmir)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_plot(cmir)
Not meant to be called directly by the user.
cor_prep(ob, study, add_dir = TRUE, add_corr = TRUE)
cor_prep(ob, study, add_dir = TRUE, add_corr = TRUE)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
study |
A |
add_dir |
A |
add_corr |
A |
A data.frame
Tidy cmicroRNA and cTF objects
cor_tidy(ob)
cor_tidy(ob)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
A tidy data.frame
of four columns. mirna_base
or
tf
is the microRNA miRBase IDs, feature
is the features/genes,
cor
is the corresponding expression correlations and study
is TCGA study ID.
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cmicroRNA object cmir <- cmicroRNA(dat) # convert cmicroRNA object to a tidy data.frame tidy_cmir <- cor_tidy(cmir)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cmicroRNA object cmir <- cmicroRNA(dat) # convert cmicroRNA object to a tidy data.frame tidy_cmir <- cor_tidy(cmir)
upset
plot of microRNA or tf setsupset
of sets of microRNAs or transcription
factors and their correlated features in a TCGA study.
cor_upset(ob, study, ...)
cor_upset(ob, study, ...)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
study |
A |
... |
Other options |
An upset
plot
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_upset(cmir)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # print object cor_upset(cmir)
Count and plot the numbers of microRNA correlated features in
cmicroRNA
object.
cor_venn_diagram(ob, study, ...)
cor_venn_diagram(ob, study, ...)
ob |
A cmicroRNA or cTF object such as this returned by calling cmicroRNA or cTF. |
study |
A |
... |
Other options |
A venn diagram with a circle or an ellipses for each microRNA and the number of correlated features.
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # make graph cor_venn_diagram(cmir)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_mir(conn, mir = c('hsa-let-7g', 'hsa-let-7i'), study = 'STES') # make a cmicroRNA object cmir <- cmicroRNA(dat) # make graph cor_venn_diagram(cmir)
cRegulome
packageDownload, access and visualize Regulome (microRNA and transcription factors) data from miRCancer and Cistrome cancer
cRegulome
functions to download and query the database filecRegulome
functions to create S3 objectscRegulome
functions to reshape S3 objectscRegulome
functions to visualize data in S3 objectscor_hist
cor_joy
cor_plot
cor_upset
cor_venn_diagram
Constructs an S3 object called cTF contains data returned by calling get_tf. Used to define methods for printing and visualizing transcription factors-gene expression correlations.
cTF(dat_tf)
cTF(dat_tf)
dat_tf |
A |
An S3 object of class cTF
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_tf(conn, tf = 'LEF1', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cTF object ctf <- cTF(dat)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # enter a custom query with different arguments dat <- get_tf(conn, tf = 'LEF1', study = 'STES', min_abs_cor = .3, max_num = 5) # make a cTF object ctf <- cTF(dat)
This function calls download.file
to download the
pre-build database file of cRegulome. Additionally, the function checks
the validity of the pre-defined URL and whether the database file exists
in the current working directory to avoid redownloading it. Typically,
users would run this function once at the first time the use the package
or to update the database to the latest version.
get_db(test = FALSE, destfile, ...)
get_db(test = FALSE, destfile, ...)
test |
A |
destfile |
A character vector for the desired path for the database
file. By default, when not specified, is constructed by using
|
... |
Optional arguments passed to |
Downloads a compressed sqlite
file to the current working
directory. The file is named cRegulome.db.gz
by default and it's
not advised to change the name to avoid breaking the other functions
that calls the database.
## Not run: # download a test set of the database get_db(test = TRUE) # download the full database file get_db(test = FALSE) ## End(Not run) # load the test db file from shipped with the pacakge db_file <- system.file("extdata", "cRegulome.db", package = "cRegulome") file.info(db_file)
## Not run: # download a test set of the database get_db(test = TRUE) # download the full database file get_db(test = FALSE) ## End(Not run) # load the test db file from shipped with the pacakge db_file <- system.file("extdata", "cRegulome.db", package = "cRegulome") file.info(db_file)
This function access the sqlite
database file which is obtained by
running get_db. Basically, the function provides ways to query the
database to the correlation data of the microRNAs of interest. The function
returns an error if the database file cRegulome.db
is not in the
working directory.
get_mir(conn, mir, study, min_abs_cor, max_num, targets_only = FALSE, targets)
get_mir(conn, mir, study, min_abs_cor, max_num, targets_only = FALSE, targets)
conn |
A connection such as this returned by
|
mir |
A required |
study |
A |
min_abs_cor |
A |
max_num |
An |
targets_only |
A |
targets |
A |
A tidy data.frame
of four columns. mirna_base
is the
microRNA miRBase IDs, feature
is the features/genes, cor
is the corresponding expression correlations and study
is TCGA
study ID.
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # get microRNA correlations in all studies get_mir(conn, mir = 'hsa-let-7g') # get correlations in a particular study get_mir(conn, mir = 'hsa-let-7g', study = 'STES') # enter a custom query with different arguments get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) # get microRNA correlations in all studies get_mir(conn, mir = 'hsa-let-7g') # get correlations in a particular study get_mir(conn, mir = 'hsa-let-7g', study = 'STES') # enter a custom query with different arguments get_mir(conn, mir = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5)
This function access the sqlite
database file which is obtained by
running get_db. Basically, the function provides ways to query the
database to the correlation data of the transcription factors of interest.
The function returns an error if the database file cRegulome.db
is
not in the working directory.
get_tf(conn, tf, study, min_abs_cor, max_num, targets_only = FALSE, targets)
get_tf(conn, tf, study, min_abs_cor, max_num, targets_only = FALSE, targets)
conn |
A connection such as this returned by
|
tf |
A required |
study |
A |
min_abs_cor |
A |
max_num |
An |
targets_only |
A |
targets |
A |
A tidy data.frame
of four columns. tf
is the official
gene symbols of the genes contains the transcription factor, feature
is the features/genes, cor is the corresponding expression correlations
and study
is TCGA study ID.
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) ## Not run: # get transcription factors correlations in all studies get_tf(conn, tf = 'LEF1') ## End(Not run) # get correlations in a particular study get_tf(conn, tf = 'LEF1', study = 'STES') # enter a custom query with different arguments get_tf(conn, tf = 'LEF1', study = 'STES', min_abs_cor = .3, max_num = 5)
# locate the testset file and connect fl <- system.file('extdata', 'cRegulome.db', package = 'cRegulome') conn <- RSQLite::dbConnect(RSQLite::SQLite(), fl) ## Not run: # get transcription factors correlations in all studies get_tf(conn, tf = 'LEF1') ## End(Not run) # get correlations in a particular study get_tf(conn, tf = 'LEF1', study = 'STES') # enter a custom query with different arguments get_tf(conn, tf = 'LEF1', study = 'STES', min_abs_cor = .3, max_num = 5)
Not meant to be called directly by the user.
stat_collect(conn, study, stat, type = "mir")
stat_collect(conn, study, stat, type = "mir")
conn |
A connection such as this returned by
|
study |
A |
stat |
A string such as this returned by |
type |
A |
A data.frame
Not meant to be called directly by the user.
stat_collect_targets(conn, stat)
stat_collect_targets(conn, stat)
conn |
A connection such as this returned by
|
stat |
A string such as this returned by |
A character
vector
Not meant to be called directly by the user.
stat_make(reg, study, min_abs_cor, max_num, targets, type = "mir")
stat_make(reg, study, min_abs_cor, max_num, targets, type = "mir")
reg |
A |
study |
A |
min_abs_cor |
A |
max_num |
An |
targets |
A |
type |
A |
A character string
stat_make(reg = 'hsa-let-7g', study = 'STES') stat_make(reg = 'hsa-let-7g', study = 'STES', min_abs_cor = .3) stat_make(reg = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5)
stat_make(reg = 'hsa-let-7g', study = 'STES') stat_make(reg = 'hsa-let-7g', study = 'STES', min_abs_cor = .3) stat_make(reg = 'hsa-let-7g', study = 'STES', min_abs_cor = .3, max_num = 5)
Not meant to be called directly by the user.
stat_make_targets(reg, study, type = "mir")
stat_make_targets(reg, study, type = "mir")
reg |
A |
study |
A |
type |
A |
A character string