Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

123 triple col is bad for examples #128

Merged
merged 40 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
fdcb941
Merge pull request #82 from FertigLab/dev
jmitchell81 Feb 5, 2024
56bba96
removal of pkgdown files
jmitchell81 Feb 5, 2024
9ef93f0
Merge pull request #116 from FertigLab/dev
jmitchell81 May 8, 2024
ffff4c6
listFiles for bioc branch action
jmitchell81 May 9, 2024
04cfaf6
action remove bin/bash
jmitchell81 May 9, 2024
6a3f778
specify master and destination branch
jmitchell81 May 9, 2024
c81d091
update files
actions-user May 9, 2024
b348b09
checkout source branch
jmitchell81 May 9, 2024
c03af21
Revert "checkout source branch"
jmitchell81 May 9, 2024
e95fbba
manual update from master
jmitchell81 May 9, 2024
94ed4f2
Merge branch 'master' into bioconductor
jmitchell81 May 20, 2024
f873189
remove pkgdown documentation from master merge
jmitchell81 May 20, 2024
30e0e6e
Delete test-cache.r
jmitchell81 May 20, 2024
9572eba
Merge branch 'master' into bioconductor
jmitchell81 May 20, 2024
b112ea4
move data from sysdata.rda to data/
dimalvovs Jun 20, 2024
a0928b6
rework examples
dimalvovs Jun 22, 2024
e5ccbce
rm *_alt and dom_ls_tiny as not needed anymore
dimalvovs Jun 22, 2024
ca9400e
rm tiny_differential_linkage_c2 as it was not used
dimalvovs Jun 22, 2024
8af93ff
move differential_linkages from tiny data to examples
dimalvovs Jun 22, 2024
8247f1e
fix convenience_fxns tests
dimalvovs Jun 22, 2024
175890b
move linkage_summary to mock fun
dimalvovs Jun 22, 2024
bf24a0f
fully remove mockdata
dimalvovs Jun 22, 2024
f8e44b0
bugfix mock_linkage_summary
dimalvovs Jun 23, 2024
a561d77
merge pkgdown changes
dimalvovs Jul 1, 2024
4c6f1ad
make mocker fun not internal
dimalvovs Jul 1, 2024
0b1ec6c
adjust test data for test-import_fxns.R
dimalvovs Jul 1, 2024
ecf48bb
add separate regression tests
dimalvovs Jul 1, 2024
36df44a
rm the redundant test
dimalvovs Jul 1, 2024
cf27467
bump version
dimalvovs Jul 1, 2024
190b731
restore github actions
jmitchell81 Jul 1, 2024
389578b
restore nojekyll
jmitchell81 Jul 1, 2024
f0cfd99
restore articles
jmitchell81 Jul 1, 2024
45e81fc
restore docs
jmitchell81 Jul 1, 2024
a4a09dd
restore news
jmitchell81 Jul 1, 2024
c0305b3
restore pkgdown
jmitchell81 Jul 1, 2024
55e7bc3
restore reference
jmitchell81 Jul 1, 2024
8433b22
rerun devtool document
jmitchell81 Jul 1, 2024
80b5cb0
remove extranious Rd files
jmitchell81 Jul 1, 2024
23e4368
add data docs back
dimalvovs Jul 2, 2024
95a9490
add @usage header to try fix check
dimalvovs Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dominoSignal
Title: Cell Communication Analysis for Single Cell RNA Sequencing
Version: 0.99.2
Version: 0.99.3
Authors@R: c(
person("Christopher", "Cherry", role = c("aut"), email = "[email protected]", comment = c(ORCID = "0000-0002-5481-0055")),
person("Jacob T", "Mitchell", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-5370-9692")),
Expand Down Expand Up @@ -31,7 +31,7 @@ Imports:
License: GPL-3 | file LICENSE
Encoding: UTF-8
LazyData: false
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
biocViews:
SystemsBiology,
SingleCell,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export(feat_heatmap)
export(gene_network)
export(incoming_signaling_heatmap)
export(mean_ligand_expression)
export(mock_linkage_summary)
export(plot_differential_linkages)
export(rename_clusters)
export(signaling_heatmap)
Expand Down
10 changes: 5 additions & 5 deletions R/class_definitions.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ linkage_summary <- setClass(
#' @return A printed description of the number of cells and clusters in the domino object
#' @export
#' @examples
#' print(dominoSignal:::pbmc_dom_built_tiny)
#'
#' example(build_domino)
#' print(pbmc_dom_built_tiny)
#'
setMethod("print", "domino", function(x, ...) {
if (x@misc$build) {
message(
Expand All @@ -106,9 +107,8 @@ setMethod("print", "domino", function(x, ...) {
#' @return A printed description of cell numbers and clusters in the object
#' @export
#' @examples
#' dominoSignal:::pbmc_dom_built_tiny
#'
#' show(dominoSignal:::pbmc_dom_built_tiny)
#' example(build_domino)
#' show(pbmc_dom_built_tiny)
#'
setMethod("show", "domino", function(object) {
if (object@misc$build) {
Expand Down
3 changes: 2 additions & 1 deletion R/convenience_fxns.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ NULL
#' @return A domino object with clusters renamed in all applicable slots.
#' @export
#' @examples
#' example(build_domino)
#' new_clust <- c("CD8_T_cell" = "CD8+ T Cells",
#' "CD14_monocyte" = "CD14+ Monocytes", "B_cell" = "B Cells")
#' pbmc_dom_built_tiny <- rename_clusters(dominoSignal:::pbmc_dom_built_tiny, new_clust)
#' pbmc_dom_built_tiny <- rename_clusters(pbmc_dom_built_tiny, new_clust)
#'
rename_clusters <- function(dom, clust_conv, warning = FALSE) {
if (is.null(dom@clusters)) {
Expand Down
47 changes: 47 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#' SCENIC AUC subset
#'
#' A subset of SCENIC AUCs as applied to PBMC data.
#'
#' @format A list of:
#' \describe{
#' \item{auc_tiny}{A subset of SCENIC AUCs}
#' \item{regulons_tiny}{A subset of SCENIC regulons}
#' }
#'
#' @source <https://zenodo.org/records/10951634/files>
#' @usage data("SCENIC")
"SCENIC"


#' PBMC RNAseq data subset
#'
#' A subset of the results of PBMC RNA-seq data.
#'
#' @format A list of::
#' \describe{
#' \item{RNA_count_tiny}{A subset of PBMC RNA-seq data: counts assay}
#' \item{RNA_zscore_tiny}{A subset of PBMC RNA-seq data: zscore assay}
#' \item{clusters_tiny}{A subset of PBMC RNA-seq data: clusters as defined by cell_type}
#' }
#'
#' @source <https://zenodo.org/records/10951634/files/pbmc3k_sce.rds>
#' @usage data("PBMC")
"PBMC"


#' CellPhoneDB subset
#'
#' A list of four subsets of CellPhoneDB data.
#'
#'
#' @format A list of:
#' \describe{
#' \item{genes_tiny}{A subet of CellPhoneDB gene_input.csv}
#' \item{proteins_tiny}{A subset of CellPhoneDB protein_input.csv}
#' \item{complexes_tiny}{A subset of CellPhoneDB complex_input.csv}
#' \item{interactions_tiny}{A subset of CellPhoneDB interaction_input.csv}
#' }
#'
#' @source <https://github.com/ventolab/cellphonedb-data/archive/refs/tags/v4.0.0.tar.gz>
#' @usage data("CellPhoneDB")
"CellPhoneDB"
47 changes: 40 additions & 7 deletions R/differential_fxns.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,47 @@ NULL
#' @param subject_names vector of subject names in domino_results. If NULL, defaults to first column of subject_meta.
#' @return A linkage summary class object consisting of nested lists of the active transcription factors, active receptors, and incoming ligands for each cluster across multiple domino results
#' @export
#' @examples
#' dom_ls <- dominoSignal:::dom_ls_tiny
#' @examples
#' example(build_domino)
#'
#' #create alternative clustering
#' clusters_tiny_alt <- setNames(c(121:240, 1:120, 241:360), names(PBMC$clusters_tiny))
#' clusters_tiny_alt <- as.factor(clusters_tiny_alt)
#'
#' #build an alternative domino object
#' pbmc_dom_tiny_alt <- create_domino(
#' rl_map = rl_map_tiny,
#' features = SCENIC$auc_tiny,
#' counts = PBMC$RNA_count_tiny,
#' z_scores = PBMC$RNA_zscore_tiny,
#' clusters = clusters_tiny_alt,
#' tf_targets = regulon_list_tiny,
#' use_clusters = TRUE,
#' use_complexes = TRUE,
#' remove_rec_dropout = FALSE
#' )
#'
#' pbmc_dom_built_tiny_alt <- build_domino(
#' dom = pbmc_dom_tiny_alt,
#' min_tf_pval = .05,
#' max_tf_per_clust = Inf,
#' max_rec_per_tf = Inf,
#' rec_tf_cor_threshold = .1,
#' min_rec_percentage = 0.01
#' )
#'
#' #create a list of domino objects
#' dom_ls <- list(
#' dom1 = pbmc_dom_built_tiny,
#' dom2 = pbmc_dom_built_tiny_alt
#')
#'
#' #compare the linkages across the two domino objects
#' meta_df <- data.frame("ID" = c("dom1", "dom2"), "group" = c("A", "B"))
#' summarize_linkages(
#' domino_results = dom_ls, subject_meta = meta_df,
#' domino_results = dom_ls, subject_meta = meta_df,
#' subject_names = meta_df$ID
#')
#'
summarize_linkages <- function(domino_results, subject_meta, subject_names = NULL) {
if (!is(domino_results, "list")) {
stop("domino_results must be provided as a named list where names correspond to subject names")
Expand Down Expand Up @@ -108,7 +141,7 @@ summarize_linkages <- function(domino_results, subject_meta, subject_names = NUL
#' @export
#' @examples
#' count_linkage(
#' linkage_summary = dominoSignal:::linkage_sum_tiny, cluster = "C1",
#' linkage_summary = mock_linkage_summary(), cluster = "C1",
#' group.by = "group", linkage = "rec")
#'
count_linkage <- function(linkage_summary, cluster, group.by = NULL, linkage = "rec_lig", subject_names = NULL) {
Expand Down Expand Up @@ -169,8 +202,8 @@ count_linkage <- function(linkage_summary, cluster, group.by = NULL, linkage = "
#' }
#' @export
#' @examples
#' test_differential_linkages(
#' linkage_summary = dominoSignal:::linkage_sum_tiny, cluster = "C1", group.by = "group",
#' tiny_differential_linkage_c1 <- test_differential_linkages(
#' linkage_summary = mock_linkage_summary(), cluster = "C1", group.by = "group",
#' linkage = "rec", test_name = "fishers.exact"
#' )
#'
Expand Down
50 changes: 30 additions & 20 deletions R/import_fxns.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ NULL
#' @return Data frame where each row describes a possible receptor-ligand interaction
#' @export create_rl_map_cellphonedb
#' @examples
#' rl_map_tiny <- create_rl_map_cellphonedb(genes = dominoSignal:::genes_tiny,
#' proteins = dominoSignal:::proteins_tiny, interactions = dominoSignal:::interactions_tiny,
#' complexes = dominoSignal:::complexes_tiny)
#' data(CellPhoneDB)
#' rl_map_tiny <- create_rl_map_cellphonedb(genes = CellPhoneDB$genes_tiny,
#' proteins = CellPhoneDB$proteins_tiny,
#' interactions = CellPhoneDB$interactions_tiny,
#' complexes =CellPhoneDB$complexes_tiny)
#'
create_rl_map_cellphonedb <- function(
genes, proteins, interactions, complexes = NULL, database_name = "CellPhoneDB",
Expand Down Expand Up @@ -242,7 +244,8 @@ create_rl_map_cellphonedb <- function(
#' @return A list where names are transcription factors and the stored values are character vectors of genes in the inferred regulons
#' @export create_regulon_list_scenic
#' @examples
#' regulon_list_tiny <- create_regulon_list_scenic(regulons = dominoSignal:::regulons_tiny)
#' data(SCENIC)
#' regulon_list_tiny <- create_regulon_list_scenic(regulons = SCENIC$regulons_tiny)
#'
create_regulon_list_scenic <- function(regulons) {
if (is(regulons, "character")) {
Expand Down Expand Up @@ -293,21 +296,26 @@ create_regulon_list_scenic <- function(regulons) {
#' @param tf_variance_quantile What proportion of variable features to take if using variance to threshold features. Default is 0.5. Higher numbers will keep more features. Ignored if tf_selection_method is not 'variable'
#' @return A domino object
#' @export create_domino
#' @examples
#' pbmc_dom_tiny_all <- create_domino(
#' rl_map = dominoSignal:::rl_map_tiny, features = dominoSignal:::auc_tiny,
#' counts = dominoSignal:::RNA_count_tiny, z_scores = dominoSignal:::RNA_zscore_tiny,
#' clusters = dominoSignal:::clusters_tiny, tf_targets = dominoSignal:::regulon_list_tiny,
#' use_clusters = FALSE, use_complexes = FALSE,
#' @examples
#' example(create_rl_map_cellphonedb)
#' example(create_regulon_list_scenic)
#' data(SCENIC)
#' data(PBMC)
#'
#' pbmc_dom_tiny <- create_domino(
#' rl_map = rl_map_tiny, features = SCENIC$auc_tiny,
#' counts = PBMC$RNA_count_tiny, z_scores = PBMC$RNA_zscore_tiny,
#' clusters = PBMC$clusters_tiny, tf_targets = regulon_list_tiny,
#' use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE)
#'
#' pbmc_dom_tiny_no_clusters <- create_domino(
#' rl_map = rl_map_tiny, features = SCENIC$auc_tiny,
#' counts = PBMC$RNA_count_tiny, z_scores =PBMC$RNA_zscore_tiny,
#' clusters = PBMC$clusters_tiny, tf_targets = regulon_list_tiny,
#' use_clusters = FALSE, use_complexes = FALSE,
#' rec_min_thresh = 0.1, remove_rec_dropout = TRUE,
#' tf_selection_method = "all")
#'
#' pbmc_dom_tiny_clustered <- create_domino(
#' rl_map = dominoSignal:::rl_map_tiny, features = dominoSignal:::auc_tiny,
#' counts = dominoSignal:::RNA_count_tiny, z_scores = dominoSignal:::RNA_zscore_tiny,
#' clusters = dominoSignal:::clusters_tiny, tf_targets = dominoSignal:::regulon_list_tiny,
#' use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE)
#'
#'
create_domino <- function(
rl_map, features, counts = NULL, z_scores = NULL,
clusters = NULL, use_clusters = TRUE, tf_targets = NULL, verbose = TRUE,
Expand Down Expand Up @@ -633,9 +641,10 @@ convert_genes <- function(
#' @return An updated RL signaling data frame
#' @export
#' @examples
#' example(create_rl_map_cellphonedb)
#' lr_name <- data.frame("abbrev" = c("L", "R"), "full" = c("Ligand", "Receptor"))
#' rl_map_expanded <- add_rl_column(map = dominoSignal:::rl_map_tiny, map_ref = "type_A",
#' conv = lr_name, new_name = "type_A_full")
#' rl_map_expanded <- add_rl_column(map = rl_map_tiny, map_ref = "type_A",
#' conv = lr_name, new_name = "type_A_full")
#'
add_rl_column <- function(map, map_ref, conv, new_name) {
map_in_ref <- match(map[[map_ref]], conv[, 1])
Expand Down Expand Up @@ -676,7 +685,8 @@ add_rl_column <- function(map, map_ref, conv, new_name) {
#' @return A data frame of ligand expression targeting the specified receptor
#' @export
#' @examples
#' counts <- dom_counts(dominoSignal:::pbmc_dom_built_tiny)
#' example(build_domino)
#' counts <- dom_counts(pbmc_dom_built_tiny)
#' mean_exp <- mean_ligand_expression(counts,
#' ligands = c("PTPRC", "FASLG"), cell_ident = "CD14_monocyte",
#' cell_barcodes = colnames(counts), destination = "FAS")
Expand Down
Loading
Loading