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

Release 1.1.2 #107

Closed
wants to merge 148 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
9c0d7d1
bump version for develop branch
samuel-marsh Jan 13, 2023
e54a164
add aspect ratio param
samuel-marsh Feb 9, 2023
e5361ee
aspect ration to function params
samuel-marsh Feb 9, 2023
2653b87
add aspect ratio to more plots
samuel-marsh Feb 9, 2023
33ea5bf
add to function params
samuel-marsh Feb 9, 2023
ee76333
add param description
samuel-marsh Feb 9, 2023
621b07e
aspect ratio to nebulosa plotting
samuel-marsh Feb 9, 2023
971c35d
aspect ratio liger dimplot
samuel-marsh Feb 9, 2023
3046084
update changelog
samuel-marsh Feb 9, 2023
c9179d1
update docs
samuel-marsh Feb 9, 2023
7abb4be
bump version and date
samuel-marsh Feb 9, 2023
ba30188
fix qc plot feature
samuel-marsh Feb 14, 2023
74a10ea
update changelog
samuel-marsh Feb 14, 2023
3c01d71
bump version and date
samuel-marsh Feb 14, 2023
62f3438
fix
samuel-marsh Feb 14, 2023
2baa4b6
bump version and date
samuel-marsh Feb 14, 2023
2809d39
add median plotting
samuel-marsh Feb 24, 2023
5323d1c
update docs
samuel-marsh Feb 24, 2023
236c18a
update changelog
samuel-marsh Feb 24, 2023
dcf87c2
bump version and date
samuel-marsh Feb 24, 2023
83bd471
add split collect guides
samuel-marsh Mar 20, 2023
85aade2
update docs
samuel-marsh Mar 20, 2023
a0bde49
bump version and date
samuel-marsh Mar 20, 2023
9bde6a9
add split_collect checks for feature length
samuel-marsh Mar 20, 2023
0e63f95
update docs
samuel-marsh Mar 20, 2023
a5823ba
update changelog
samuel-marsh Mar 20, 2023
bd10db0
bump version
samuel-marsh Mar 20, 2023
f68764c
update changelog
samuel-marsh Mar 20, 2023
5004459
add legend and column size modifications
samuel-marsh Mar 24, 2023
5894869
update docs
samuel-marsh Mar 24, 2023
8159c5d
update parameters
samuel-marsh Mar 24, 2023
9843145
update docs
samuel-marsh Mar 24, 2023
8b73287
update changelog
samuel-marsh Mar 24, 2023
267c54d
bump version and date
samuel-marsh Mar 24, 2023
b7f8e0f
extract modality function
samuel-marsh May 10, 2023
bbcfac4
add multimodal merge
samuel-marsh May 10, 2023
5e0e6eb
remove testing code
samuel-marsh May 10, 2023
4c13f8a
Update Docs
samuel-marsh May 10, 2023
6fe78f3
update changelog
samuel-marsh May 10, 2023
413f88c
bump version and date
samuel-marsh May 10, 2023
18b8614
update cellbender read compatibility
samuel-marsh May 16, 2023
c7b57c8
fix the feature_slot_name check
samuel-marsh May 16, 2023
8b98f4e
remove test code
samuel-marsh May 16, 2023
f99e75c
Update docs
samuel-marsh May 16, 2023
605ca1d
specify optional params
samuel-marsh May 16, 2023
1fa154a
update changelog
samuel-marsh May 16, 2023
ddcb800
update changelog
samuel-marsh May 16, 2023
dab869c
bump version and date
samuel-marsh May 16, 2023
5f4cf40
Update CellBender Vignette
samuel-marsh May 16, 2023
74ec71e
bump version
samuel-marsh May 16, 2023
4cc8ce2
change feature fontface
samuel-marsh May 18, 2023
e496f96
update docs
samuel-marsh May 18, 2023
c90152f
update docs
samuel-marsh May 18, 2023
4b2365e
update changelog
samuel-marsh May 18, 2023
8bdbf6d
bump version and date
samuel-marsh May 18, 2023
4a82c99
add link
samuel-marsh May 18, 2023
c087696
add reduction loading check
samuel-marsh Jun 1, 2023
610f06b
Update docs
samuel-marsh Jun 1, 2023
bf7e1ef
rename parameter to harmonize across other utilities
samuel-marsh Jun 1, 2023
78033a7
fix return
samuel-marsh Jun 1, 2023
6f6640a
fix parameter rename
samuel-marsh Jun 1, 2023
40e5d1e
change defaults to keep current behavior
samuel-marsh Jun 1, 2023
badf1ab
update changelog
samuel-marsh Jun 1, 2023
cc44a4c
bump version and date
samuel-marsh Jun 1, 2023
3812f64
fix for featureplot DR loadings
samuel-marsh Jun 1, 2023
511b9bc
update changelog
samuel-marsh Jun 1, 2023
de1a5b9
bump version
samuel-marsh Jun 1, 2023
0f7baf8
update docs
samuel-marsh Jun 1, 2023
7905931
update manual doc
samuel-marsh Jun 1, 2023
de7fcca
bump version
samuel-marsh Jun 1, 2023
95ec39e
fix error reduction loading
samuel-marsh Jun 1, 2023
bcedbe1
bump version
samuel-marsh Jun 1, 2023
784bafe
fix .data[[var]] deprecation ClusteredDotPlot
samuel-marsh Jun 1, 2023
ed97fb1
bump version
samuel-marsh Jun 1, 2023
feea232
add ability to turn clustering on or off ClusteredDotPlot
samuel-marsh Jun 1, 2023
8265612
update docs
samuel-marsh Jun 1, 2023
f3ea1a5
bump version
samuel-marsh Jun 1, 2023
b1431b2
update changelog
samuel-marsh Jun 1, 2023
702df56
typo
samuel-marsh Jun 1, 2023
b1c8b61
bump version
samuel-marsh Jun 1, 2023
ca7c097
fix missing manual entries
samuel-marsh Jun 1, 2023
e8adf95
fix parameter name change
samuel-marsh Jun 1, 2023
fc9c03f
bump version
samuel-marsh Jun 1, 2023
5396583
update cran comments
samuel-marsh Jun 1, 2023
5b3cbb7
update docs
samuel-marsh Jun 1, 2023
71179db
bump version for release compatibility
samuel-marsh Jun 1, 2023
5f5c0c3
fix version
samuel-marsh Jun 1, 2023
9989544
change hasArg to string
samuel-marsh Jun 2, 2023
a974716
style fixes
samuel-marsh Jun 2, 2023
fe5a92c
style updates
samuel-marsh Jun 3, 2023
e8f952e
any_of replacement
samuel-marsh Jun 5, 2023
0bdd791
import fix
samuel-marsh Jun 5, 2023
97a0aaf
style fixes
samuel-marsh Jun 5, 2023
7f62ad6
remove select_at
samuel-marsh Jun 6, 2023
575bee5
remove summarise_at
samuel-marsh Jun 6, 2023
067bfc7
update docs
samuel-marsh Jun 6, 2023
c990c34
style fix
samuel-marsh Jun 6, 2023
9e96a33
style fix
samuel-marsh Jun 6, 2023
937cb4c
fix imports and style fixes
samuel-marsh Jun 6, 2023
ca1f8d2
style fixes
samuel-marsh Jun 6, 2023
a5bb6e7
style fixes
samuel-marsh Jun 6, 2023
bb3805f
style fixes
samuel-marsh Jun 6, 2023
4c7b27a
update changelog
samuel-marsh Jun 6, 2023
b9482be
bump date
samuel-marsh Jun 6, 2023
6f8c341
multi compatibility
samuel-marsh Jun 12, 2023
0dfc3b4
update docs
samuel-marsh Jun 12, 2023
f65800b
update changelog
samuel-marsh Jun 12, 2023
f75c0aa
bump date
samuel-marsh Jun 12, 2023
6a67287
update h5 multidirectory
samuel-marsh Jun 12, 2023
0dcd3fe
update docs
samuel-marsh Jun 12, 2023
28626be
style fixes
samuel-marsh Jun 15, 2023
3dacf75
wrap no legend inside iterative dimplot by sample
samuel-marsh Jun 15, 2023
afd6001
update param
samuel-marsh Jun 15, 2023
72157fd
update docs
samuel-marsh Jun 15, 2023
bbc9984
.data fix
samuel-marsh Jun 15, 2023
328f7c2
add dot_size parameter
samuel-marsh Jun 16, 2023
f9d2f5d
Update docs
samuel-marsh Jun 16, 2023
836aaaa
iterate cluster highlight rewrite
samuel-marsh Jun 16, 2023
41c36b3
remove test code
samuel-marsh Jun 16, 2023
fb5664b
update docs
samuel-marsh Jun 16, 2023
83cb0c8
fix rename .data superceded
samuel-marsh Jun 16, 2023
1531c73
style fix and remove test code
samuel-marsh Jun 16, 2023
fbbec3d
update changelog
samuel-marsh Jun 16, 2023
0e6dbf0
bump date
samuel-marsh Jun 16, 2023
07e8240
switch import
samuel-marsh Jun 23, 2023
5bf3fe7
meta highlight plot to use under the hood rewrite
samuel-marsh Jun 23, 2023
3ceeebd
update docs remove pbmapply. no longer needed
samuel-marsh Jun 23, 2023
73e715a
add no_legend option
samuel-marsh Jun 23, 2023
ed28edf
update docs
samuel-marsh Jun 23, 2023
49ca1fb
update manual entry
samuel-marsh Jun 23, 2023
1b9dbb1
Update docs
samuel-marsh Jun 23, 2023
d4f48a0
bump date
samuel-marsh Jun 23, 2023
c2827af
update changelog
samuel-marsh Jun 23, 2023
73876c8
style
samuel-marsh Jun 23, 2023
e6bc3f9
Update changelog
samuel-marsh Jun 23, 2023
e2ee5b8
fix typo
samuel-marsh Jul 10, 2023
97d94a8
add check if no reduction present
samuel-marsh Jul 10, 2023
7b75bd3
add multimodal merge to vignette
samuel-marsh Jul 10, 2023
823b972
Update median plotting QC
samuel-marsh Jul 10, 2023
b24995b
add median example qc plots
samuel-marsh Jul 10, 2023
ab03352
typo fix
samuel-marsh Jul 10, 2023
2c69d73
update changelog
samuel-marsh Jul 10, 2023
d25e669
add dates and release version to changelog
samuel-marsh Jul 10, 2023
d9d6a39
bump date
samuel-marsh Jul 10, 2023
ac9ed5c
fix error
samuel-marsh Jul 10, 2023
c2c391e
new fix read order
samuel-marsh Jul 10, 2023
87964cb
remove old cellbender error check
samuel-marsh Jul 10, 2023
1543ac5
fix typo
samuel-marsh Jul 12, 2023
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
Expand Up @@ -2,8 +2,8 @@ Package: scCustomize
Type: Package
Title: Custom Visualizations & Functions for Streamlined Analyses of Single Cell Sequencing
Description: Collection of functions created and/or curated to aid in the visualization and analysis of single-cell data using 'R'. 'scCustomize' aims to provide 1) Customized visualizations for aid in ease of use and to create more aesthetic and functional visuals. 2) Improve speed/reproducibility of common tasks/pieces of code in scRNA-seq analysis with a single or group of functions. For citation please use: Marsh SE (2021) "Custom Visualizations & Functions for Streamlined Analyses of Single Cell Sequencing" <doi:10.5281/zenodo.5706430>.
Version: 1.1.1
Date: 2023-01-13
Version: 1.1.2
Date: 2023-07-11
Authors@R: c(
person(given = "Samuel", family = "Marsh", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-3012-6945")),
person(given = "Ming", family = "Tang", role = c("ctb"), email = "[email protected]"),
Expand Down
10 changes: 6 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export(DimPlot_LIGER)
export(DimPlot_scCustom)
export(DiscretePalette_scCustomize)
export(DotPlot_scCustom)
export(Extract_Modality)
export(Extract_Sample_Meta)
export(Extract_Top_Markers)
export(FeaturePlot_DualAssay)
Expand All @@ -53,6 +54,7 @@ export(Liger_to_Seurat)
export(Median_Stats)
export(Merge_Seurat_List)
export(Merge_Sparse_Data_All)
export(Merge_Sparse_Multimodal_All)
export(Meta_Highlight_Plot)
export(Meta_Numeric)
export(Meta_Present)
Expand Down Expand Up @@ -90,6 +92,7 @@ export(Read_CellBender_h5_Multi_Directory)
export(Read_CellBender_h5_Multi_File)
export(Read_GEO_Delim)
export(Read_Metrics_10X)
export(Reduction_Loading_Present)
export(Rename_Clusters)
export(Replace_Suffix)
export(Seq_QC_Plot_Alignment_Combined)
Expand Down Expand Up @@ -157,6 +160,7 @@ importFrom(SeuratObject,PackageCheck)
importFrom(circlize,colorRamp2)
importFrom(cowplot,theme_cowplot)
importFrom(data.table,fread)
importFrom(dplyr,across)
importFrom(dplyr,all_of)
importFrom(dplyr,any_of)
importFrom(dplyr,arrange)
Expand All @@ -169,14 +173,12 @@ importFrom(dplyr,intersect)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,n)
importFrom(dplyr,one_of)
importFrom(dplyr,pull)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,select_at)
importFrom(dplyr,slice)
importFrom(dplyr,slice_max)
importFrom(dplyr,summarise_at)
importFrom(dplyr,summarise)
importFrom(dplyr,summarize)
importFrom(forcats,fct_relevel)
importFrom(ggbeeswarm,geom_quasirandom)
Expand All @@ -195,6 +197,7 @@ importFrom(janitor,adorn_totals)
importFrom(lifecycle,deprecated)
importFrom(magrittr,"%>%")
importFrom(methods,as)
importFrom(methods,hasArg)
importFrom(methods,new)
importFrom(methods,slot)
importFrom(paletteer,paletteer_c)
Expand All @@ -203,7 +206,6 @@ importFrom(patchwork,plot_annotation)
importFrom(patchwork,plot_layout)
importFrom(patchwork,wrap_plots)
importFrom(pbapply,pblapply)
importFrom(pbapply,pbmapply)
importFrom(pbapply,pboptions)
importFrom(purrr,discard)
importFrom(purrr,keep)
Expand Down
30 changes: 30 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# scCustomize 1.1.2 (2023-07-11)
## Added
- Added `aspect_ratio` parameter to all dimensionality reduction plots to control axes ratio of output plot.
- Added `plot_median` and `median_size` parameters to `QC_Plots_*` functions.
- Added `split_collect` parameter to `FeaturePlot_scCustom` to collect all guides when using `split.by` for a single feature ([#94](https://github.com/samuel-marsh/scCustomize/issues/94)).
- Added new parameters to `Clustered_DotPlot` to allow modification of sizes of column text labels, legend text labels, and legend title labels ([#96](https://github.com/samuel-marsh/scCustomize/issues/96)).
- Added new function `Merge_Sparse_Multimodal_All` for merging multi-modal data (1 matrix per modality) ([#104](https://github.com/samuel-marsh/scCustomize/issues/104)).
- Added new parameter to `Clustered_DotPlot` named `row_label_fontface` to allow control of fontface used for row labels ([#103](https://github.com/samuel-marsh/scCustomize/issues/103)).
- Added helper utility `Reduction_Loading_Present`, in part to fix issue with `FeaturePlot_scCustom` and internal feature checking.
- Added ability to turn off feature/ident clustering in `Clustered_DotPlot` using new parameters: `cluster_feature`, `cluster_ident` ([#106](https://github.com/samuel-marsh/scCustomize/issues/106)).
- Added `dot_size` parameter to statistics plotting functions `Plot_Cells_per_Sample` and `Plot_Median_*` family.
- Added new parameter `no_legend` to `Iterate_Meta_Highlight_Plot` to allow for plotting with a plot title instead of plot legend ([#108](https://github.com/samuel-marsh/scCustomize/issues/108)).


## Changed
- Moved `QC_Plots_Feature` to use `VlnPlot_scCustom` under the hood like rest of `QC_Plots_*` functions.
- Renamed parameter `abort` in `Meta_Present` to `return_none` to align with `Gene_Present` and `Reduction_Loading_Present`.
- Replace superseded dplyr syntax/functionality `summarise_at`, `select(.data[[var]])`, and `rename(.data[[var]])` with current dplyr syntax.
- Internal rewrite of plotting sections within `Iterate_Cluster_Highlight_Plot` and `Iterate_Meta_Highlight_Plot` to align with recent updates to base `Cluster_Highlight_Plot` and `Meta_Highlight_Plot` functions.


## Fixes
- Fixed `QC_Plots_Feature` to respect parameters when passing to `VlnPlot` ([#91](https://github.com/samuel-marsh/scCustomize/issues/91)).
- Fixed `Read_CellBender_h5_*` functions to support CellBender outputs from STARsolo- or Cell Ranger (pre-V3)-processed data ([#99](https://github.com/samuel-marsh/scCustomize/issues/99)).
- Fixed `FeaturePlot_scCustom` to allow for plotting of dimensionality reduction loadings ([#97](https://github.com/samuel-marsh/scCustomize/issues/97)).
- Fixed `Read10X_Multi_Directory` and `Read10X_h5_Multi_Directory` to support files processed with Cell Ranger `multi` pipeline.



# scCustomize 1.1.1 (2023-01-13)
## Added
- Added `label_color_num` parameter to `PalettePlot` allow control of color labeling.
Expand All @@ -21,6 +50,7 @@
- Updated out-dated documentation for number of package functions.
- Typo/styling fixes.


# scCustomize 1.1.0 (2022-12-22)
## Added
- Added `merge` parameter to `Read10X_GEO`, `Read10X_h5_GEO`, `Read_GEO_Delim` and `Read_CellBender_h5_Multi_File`.
Expand Down
12 changes: 6 additions & 6 deletions R/Color_Palettes.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ Single_Color_Palette <- function(pal_color,
"#000000"
)
)
if (!pal_color %in% names(brewer_single_modified)) {
if (!pal_color %in% names(x = brewer_single_modified)) {
cli_abort(message = c("Paleete name not found.",
"i" = "Palette name not found. Please select one of following palette options: {.field 'reds', 'blues', 'greens', 'purples', or 'grays'}")
)
}
set.seed(seed = seed_use)
pal_use <- brewer_single_modified[[pal_color]]
output_pal <- sample(pal_use, size = num_colors)
output_pal <- sample(x = pal_use, size = num_colors)
return(output_pal)
}

Expand All @@ -216,7 +216,7 @@ NavyAndOrange <- function(
) {
navy_orange <- c("navy", "orange")
if (flip_order) {
navy_orange <- rev(navy_orange)
navy_orange <- rev(x = navy_orange)
}
return(navy_orange)
}
Expand Down Expand Up @@ -356,8 +356,8 @@ ColorBlind_Pal <- function(
varibow_scCustom <- function(
n_colors
) {
sats <- rep_len(c(0.55,0.7,0.85,1),length.out = n_colors)
vals <- rep_len(c(1,0.8,0.6),length.out = n_colors)
sats <- rep_len(x = c(0.55,0.7,0.85,1), length.out = n_colors)
vals <- rep_len(x = c(1,0.8,0.6), length.out = n_colors)
rainbow(n_colors, s = sats, v = vals)
}

Expand Down Expand Up @@ -469,7 +469,7 @@ DiscretePalette_scCustomize <- function(
}
if (shuffle_pal) {
set.seed(seed = seed)
palette_out <- sample(palette_out[1:num_colors])
palette_out <- sample(x = palette_out[1:num_colors])
} else {
palette_out <- palette_out[1:num_colors]
}
Expand Down
12 changes: 7 additions & 5 deletions R/Internal_Utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ glue_collapse_scCustom <- function(

#' Perform Feature and Meta Checks before plotting
#'
#' Wraps the `Gene_Present`, `Meta_Present`, and `Case_Check` into single function to perform feature
#' checks before plotting.
#' Wraps the `Gene_Present`, `Meta_Present`, `Reduction_Loading_Present`, and `Case_Check` into
#' single function to perform feature checks before plotting.
#'
#' @param object Seurat object
#' @param features vector of features and/or meta data variables to plot.
Expand All @@ -245,11 +245,13 @@ Feature_PreCheck <- function(
# Check features and meta to determine which features present
features_list <- Gene_Present(data = object, gene_list = features, omit_warn = FALSE, print_msg = FALSE, case_check_msg = FALSE, return_none = TRUE)

meta_list <- Meta_Present(seurat_object = object, meta_col_names = features_list[[2]], omit_warn = FALSE, print_msg = FALSE, abort = FALSE)
meta_list <- Meta_Present(seurat_object = object, meta_col_names = features_list[[2]], omit_warn = FALSE, print_msg = FALSE, return_none = TRUE)

all_not_found_features <- meta_list[[2]]
reduction_list <- Reduction_Loading_Present(seurat_object = object, reduction_names = meta_list[[2]], omit_warn = FALSE, print_msg = FALSE, return_none = TRUE)

all_found_features <- c(features_list[[1]], meta_list[[1]])
all_not_found_features <- reduction_list[[2]]

all_found_features <- c(features_list[[1]], meta_list[[1]], reduction_list[[1]])

# Stop if no features found
if (length(x = all_found_features) < 1) {
Expand Down
40 changes: 34 additions & 6 deletions R/LIGER_Plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#' @param shuffle_seed Sets the seed if randomly shuffling the order of points.
#' @param reduction_label What to label the x and y axes of resulting plots. LIGER does not store name of
#' technique and therefore needs to be set manually. Default is "UMAP".
#' @param aspect_ratio Control the aspect ratio (y:x axes ratio length). Must be numeric value;
#' Default is NULL.
#' @param label logical. Whether or not to label the clusters. ONLY applies to plotting by cluster. Default is TRUE.
#' @param label_size size of cluster labels.
#' @param label_repel logical. Whether to repel cluster labels from each other if plotting by
Expand Down Expand Up @@ -61,6 +63,7 @@ DimPlot_LIGER <- function(
shuffle = TRUE,
shuffle_seed = 1,
reduction_label = "UMAP",
aspect_ratio = NULL,
label = TRUE,
label_size = NA,
label_repel = FALSE,
Expand Down Expand Up @@ -170,6 +173,15 @@ DimPlot_LIGER <- function(
shuffle_seed = shuffle_seed)

p3 <- wrap_plots(p1 + p2)

# Aspect ratio changes
if (!is.null(x = aspect_ratio)) {
if (!is.numeric(x = aspect_ratio)) {
cli_abort(message = "{.code aspect_ratio} must be a {.field numeric} value.")
}
p3 <- p3 & theme(aspect.ratio = aspect_ratio)
}

return(p3)
}

Expand All @@ -192,6 +204,14 @@ DimPlot_LIGER <- function(
label_color = label_color,
label = label,
color_seed = color_seed)
# Aspect ratio changes
if (!is.null(x = aspect_ratio)) {
if (!is.numeric(x = aspect_ratio)) {
cli_abort(message = "{.code aspect_ratio} must be a {.field numeric} value.")
}
p1 <- p1 & theme(aspect.ratio = aspect_ratio)
}

return(p1)
}

Expand All @@ -210,6 +230,14 @@ DimPlot_LIGER <- function(
split_by = split_by,
shuffle_seed = shuffle_seed,
color_seed = color_seed)
# Aspect ratio changes
if (!is.null(x = aspect_ratio)) {
if (!is.numeric(x = aspect_ratio)) {
cli_abort(message = "{.code aspect_ratio} must be a {.field numeric} value.")
}
p2 <- p2 & theme(aspect.ratio = aspect_ratio)
}

return(p2)
}
}
Expand Down Expand Up @@ -330,7 +358,7 @@ plotFactors_scCustom <- function(
"i" = "The number of datasets provided to {.code reorder_datasets} ({.field {length(x = reorder_datasets)}}) does not match number of datasets in LIGER object ({.field {length(x = levels(x = levels([email protected]$dataset)))}}).")
)
} else {
if (!all(levels([email protected]$dataset) %in% reorder_datasets)) {
if (!all(levels(x = [email protected]$dataset) %in% reorder_datasets)) {
cli_abort(message = c("Error reordering datasets (name mismatch).",
"*" = "Dataset names provided to {.code reorder_datasets} do not match names of datasets in LIGER object.",
"i" = "Please check spelling.")
Expand Down Expand Up @@ -379,16 +407,16 @@ plotFactors_scCustom <- function(

# Get Data and Plot Factors
cli_inform(message = "{.field Generating plots}")
k <- ncol([email protected])
k <- ncol(x = [email protected])
pb <- txtProgressBar(min = 0, max = k, style = 3)
W <- t(liger_object@W)
rownames(W) <- colnames([email protected][[1]])
W <- t(x = liger_object@W)
rownames(x = W) <- colnames(x = [email protected][[1]])
Hs_norm <- [email protected]
H_raw = do.call(rbind, liger_object@H)
plot_list = list()
tsne_list = list()
for (i in 1:k) {
top_genes.W <- rownames(W)[order(W[, i], decreasing = T)[1:num_genes]]
top_genes.W <- rownames(x = W)[order(W[, i], decreasing = T)[1:num_genes]]
top_genes.W.string <- paste0(top_genes.W, collapse = ", ")
factor_textstring <- paste0("Factor", i)
plot_title1 <- paste(factor_textstring, "\n", top_genes.W.string, "\n")
Expand Down Expand Up @@ -461,7 +489,7 @@ plotFactors_scCustom <- function(
if (plot_dimreduc) {
tsne_df <- data.frame(Hs_norm[, i], [email protected])
factorlab <- paste0("Factor", i)
colnames(tsne_df) <- c(factorlab, x_axis_label, y_axis_label)
colnames(x = tsne_df) <- c(factorlab, x_axis_label, y_axis_label)

if (order) {
tsne_df <- tsne_df[order(tsne_df[,1], decreasing = FALSE),]
Expand Down
Loading