Skip to content

Commit bfb2db4

Browse files
committed
Fix plot_bar_dendro in #22
1 parent d0224ba commit bfb2db4

25 files changed

Lines changed: 119 additions & 51 deletions

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: MSTExplorer
22
Title: Multi-Scale Target Explorer
3-
Version: 1.0.6
3+
Version: 1.0.7
44
Authors@R:
55
c(
66
person(given = "Brian",

MSTExplorer.Rproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: d3448f8d-1b38-4b27-bcf0-25454d048582
23

34
RestoreWorkspace: No
45
SaveWorkspace: No

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export(ewce_para)
1010
export(gen_overlap)
1111
export(gen_results)
1212
export(get_bg)
13+
export(get_cl)
1314
export(get_unfinished_list_names)
1415
export(ggnetwork_plot_full)
1516
export(load_example_ctd)

NEWS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# MSTExplorer 1.0.7
22

3+
## New features
4+
* `get_cl`: new wrapper for getting the exact version of the
5+
Cell Ontology used in our original study.
6+
37
## Bug fixes
4-
* M
8+
* Use `BiocMananger` to install in README.
9+
* `plot_bar_dendro`: Fix https://github.com/neurogenomics/MSTExplorer/issues/22
10+
* `plot_tissues`: Don't try to facet plot types that aren't requested.
511

612
# MSTExplorer 1.0.6
7-
813
## Bug fixes
914
* `get_color_map`
1015
- Fix `color_vector` assignment.

R/fix_cl_ids.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fix_cl_ids <- function(dat,
2-
ont=KGExplorer::get_ontology("cl"),
2+
ont=get_cl(),
33
replace_map=list(
44
"CSH1_CSH2_positive_cells"="CL:0000351",
55
"SLC26A4_PAEP_positive_cells"="CL:0002097",

R/get_cl.R

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#' Get Cell Ontology
2+
#'
3+
#' A thin wrapper around \link[KGExplorer]{get_ontology} to get the
4+
#' specific version of the Cell Ontology used in the original analyses that
5+
#' produced the results stored in \link{load_example_results}.
6+
#'
7+
#' @inheritParams KGExplorer::get_ontology
8+
#' @inheritDotParams KGExplorer::get_ontology
9+
#' @export
10+
#' @examples
11+
#' cl <- get_cl()
12+
get_cl <- function(name = "cl",
13+
tag = "v2023-09-21",
14+
lvl = 1,
15+
remove_rings=TRUE,
16+
...){
17+
KGExplorer::get_ontology(name = name,
18+
tag = tag,
19+
lvl = lvl,
20+
remove_rings = remove_rings,
21+
...) |>
22+
KGExplorer::filter_ontology(
23+
keep_descendants = "cell"
24+
)
25+
}

R/get_target_celltypes.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
get_target_celltypes <- function(target_branches = get_target_branches(),
2-
cl = KGExplorer::get_ontology("cl",
3-
remove_rings=TRUE)
2+
cl = get_cl()
43
){
54
KGExplorer::get_ontology_descendants(ont = cl,
65
terms = target_branches)

R/ontology_to_ggdendro.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
ontology_to_ggdendro <- function(ont=KGExplorer::get_ontology(name = "cl",
2-
lvl = 1),
1+
ontology_to_ggdendro <- function(ont=get_cl(),
32
terms=NULL #as.character(unique(results$cl_id))
43
){
54
#### Get celltype dendrogram ####

R/order_celltypes.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
order_celltypes <- function(dt,
2-
cl=KGExplorer::get_ontology("cl")|>
3-
KGExplorer::filter_ontology(
4-
keep_descendants = "cell"
5-
),
2+
cl=get_cl(),
63
levels=NULL
74
){
85
cl_id <- cl_name <- NULL;

R/plot_bar_dendro.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ plot_bar_dendro <- function(results = load_example_results(),
3737
target_branches = get_target_branches(),
3838
keep_ancestors=names(target_branches),
3939
hpo = HPOExplorer::get_hpo(),
40-
cl = KGExplorer::get_ontology(name = "cl",
41-
lvl = 1,
42-
remove_rings = TRUE),
40+
cl = get_cl(),
4341
facets = "ancestor_name",
4442
add_test_target_celltypes=TRUE,
4543
add_prop_test=FALSE,
@@ -116,6 +114,7 @@ plot_bar_dendro <- function(results = load_example_results(),
116114
tissue_plots <- plot_tissues(results = results,
117115
facet_var = "dummy",
118116
types = "bar")
117+
119118
ggsummary <- tissue_plots$bar_plot +
120119
ggplot2::labs(x=NULL, y=NULL) +
121120
ggplot2::scale_fill_gradient(low="black",high="grey") +

0 commit comments

Comments
 (0)