Skip to content

Commit

Permalink
Merge pull request #157 from samuel-marsh/develop
Browse files Browse the repository at this point in the history
Release v2.1.0
  • Loading branch information
samuel-marsh authored Feb 23, 2024
2 parents 0aefbe9 + 09575da commit cee1dc1
Show file tree
Hide file tree
Showing 320 changed files with 12,218 additions and 2,445 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.0.1
Date: 2023-11-17 15:28:31 UTC
SHA: 2bf5f1166ee097878adef4e10d1a3923db44557b
Version: 2.1.0
Date: 2024-02-23 19:16:02 UTC
SHA: 0d1bf8181d07c1754128b7edd9ae698c2d6cb22e
10 changes: 6 additions & 4 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> RRID:SCR_024675.
Version: 2.0.1
Date: 2023-11-17
Version: 2.1.0
Date: 2024-02-21
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 Expand Up @@ -38,7 +38,7 @@ Imports:
patchwork,
pbapply,
purrr,
rlang (>= 1.0.1),
rlang (>= 1.1.3),
scales,
scattermore (>= 1.2),
SeuratObject (>= 5.0.0),
Expand All @@ -48,6 +48,7 @@ Imports:
tibble,
tidyr
Suggests:
BiocFileCache,
ComplexHeatmap,
dittoSeq,
DropletUtils,
Expand All @@ -56,6 +57,7 @@ Suggests:
knitr,
Nebulosa,
remotes,
reticulate,
rliger,
rmarkdown,
scuttle,
Expand All @@ -66,4 +68,4 @@ License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
38 changes: 37 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# Generated by roxygen2: do not edit by hand

S3method(Add_Cell_Complexity,Seurat)
S3method(Add_Cell_Complexity,liger)
S3method(Add_Mito_Ribo,Seurat)
S3method(Add_Mito_Ribo,liger)
S3method(Fetch_Meta,Seurat)
S3method(Fetch_Meta,liger)
S3method(as.LIGER,Seurat)
S3method(as.LIGER,list)
S3method(as.Seurat,liger)
S3method(as.anndata,Seurat)
S3method(as.anndata,liger)
export(Add_Alt_Feature_ID)
export(Add_CellBender_Diff)
export(Add_Cell_Complexity)
export(Add_Cell_Complexity_LIGER)
export(Add_Cell_Complexity_Seurat)
export(Add_Cell_QC_Metrics)
export(Add_Mito_Ribo)
export(Add_Mito_Ribo_LIGER)
export(Add_Mito_Ribo_Seurat)
export(Add_Pct_Diff)
Expand All @@ -25,6 +37,7 @@ export(Cluster_Highlight_Plot)
export(Cluster_Stats_All_Samples)
export(Clustered_DotPlot)
export(ColorBlind_Pal)
export(Convert_Assay)
export(Copy_From_GCP)
export(Copy_To_GCP)
export(Create_10X_H5)
Expand All @@ -42,6 +55,7 @@ export(Extract_Top_Markers)
export(FeaturePlot_DualAssay)
export(FeaturePlot_scCustom)
export(FeatureScatter_scCustom)
export(Feature_Present)
export(Fetch_Meta)
export(Gene_Present)
export(Hue_Pal)
Expand All @@ -55,6 +69,7 @@ export(Iterate_Plot_Density_Custom)
export(Iterate_Plot_Density_Joint)
export(Iterate_VlnPlot_scCustom)
export(JCO_Four)
export(LIGER_Features)
export(Liger_to_Seurat)
export(MAD_Stats)
export(Median_Stats)
Expand Down Expand Up @@ -120,14 +135,20 @@ export(Seq_QC_Plot_UMIs)
export(Setup_scRNAseq_Project)
export(Single_Color_Palette)
export(Split_FeatureScatter)
export(Split_Layers)
export(Split_Vector)
export(Stacked_VlnPlot)
export(Store_Misc_Info_Seurat)
export(Store_Palette_Seurat)
export(Top_Genes_Factor)
export(UnRotate_X)
export(Updated_HGNC_Symbols)
export(VariableFeaturePlot_scCustom)
export(Variable_Features_ALL_LIGER)
export(VlnPlot_scCustom)
export(as.LIGER)
export(as.Seurat)
export(as.anndata)
export(plotFactors_scCustom)
export(scCustomize_Palette)
export(theme_ggprism_mod)
Expand All @@ -147,7 +168,6 @@ import(ggrastr)
import(parallel)
import(patchwork)
import(pbapply)
import(rlang)
importFrom(Matrix,readMM)
importFrom(Matrix,rowSums)
importFrom(Seurat,AddMetaData)
Expand All @@ -167,6 +187,7 @@ importFrom(SeuratObject,Features)
importFrom(SeuratObject,JoinLayers)
importFrom(SeuratObject,LayerData)
importFrom(SeuratObject,Layers)
importFrom(SeuratObject,as.Seurat)
importFrom(circlize,colorRamp2)
importFrom(cowplot,theme_cowplot)
importFrom(data.table,fread)
Expand All @@ -175,11 +196,13 @@ importFrom(dplyr,all_of)
importFrom(dplyr,any_of)
importFrom(dplyr,arrange)
importFrom(dplyr,bind_rows)
importFrom(dplyr,contains)
importFrom(dplyr,desc)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,grouped_df)
importFrom(dplyr,intersect)
importFrom(dplyr,join_by)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,n)
Expand All @@ -191,13 +214,15 @@ importFrom(dplyr,slice)
importFrom(dplyr,slice_max)
importFrom(dplyr,summarise)
importFrom(dplyr,summarize)
importFrom(dplyr,union)
importFrom(forcats,fct_relevel)
importFrom(ggbeeswarm,geom_quasirandom)
importFrom(ggplot2,theme)
importFrom(ggprism,theme_prism)
importFrom(ggrepel,geom_label_repel)
importFrom(ggrepel,geom_text_repel)
importFrom(glue,glue_collapse)
importFrom(grDevices,col2rgb)
importFrom(grDevices,dev.off)
importFrom(grDevices,pdf)
importFrom(grDevices,rainbow)
Expand All @@ -224,12 +249,16 @@ importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map_dbl)
importFrom(purrr,reduce)
importFrom(rlang,"!!")
importFrom(rlang,"%||%")
importFrom(rlang,":=")
importFrom(rlang,is_installed)
importFrom(rlang,sym)
importFrom(scales,alpha)
importFrom(scales,hue_pal)
importFrom(scales,label_percent)
importFrom(scattermore,geom_scattermore)
importFrom(stats,complete.cases)
importFrom(stats,cor)
importFrom(stats,kmeans)
importFrom(stats,mad)
Expand All @@ -239,16 +268,23 @@ importFrom(stats,setNames)
importFrom(stats,var)
importFrom(stringi,stri_replace_first_fixed)
importFrom(stringi,stri_replace_last_fixed)
importFrom(stringr,str_c)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_replace)
importFrom(stringr,str_replace_na)
importFrom(stringr,str_to_lower)
importFrom(stringr,str_to_sentence)
importFrom(stringr,str_to_upper)
importFrom(stringr,str_wrap)
importFrom(tibble,column_to_rownames)
importFrom(tibble,rownames_to_column)
importFrom(tibble,tribble)
importFrom(tidyr,drop_na)
importFrom(tidyr,everything)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(tidyr,separate_wider_delim)
importFrom(utils,combn)
importFrom(utils,packageVersion)
importFrom(utils,read.csv)
Expand Down
52 changes: 52 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
# scCustomize 2.1.0 (2024-02-21)
## Added
- Added `title_prefix` parameter to `Iterate_DimPlot_bySample` to unify with `Meta_Highlight_Plot`.
- Added function `Split_Vector` to split vector in chunks of predetermined sizes.
- Added new function `Updated_HGNC_Symbols` to update human gene symbols. After first use does not require internet connection.
- Added command logging to QC metric-related commands using `Seurat::LogSeuratCommand()`.
- Added parameter `plot_legend` to `plotFactors_scCustom` to allow for removal to legend in factor loading plots.
- Added new functionality to `Iterate_FeaturePlot_scCustom` to allow for plotting multiple plots per page when saving to single PDF document (see new parameters: `features_per_page` and `landscape`.
- Added `LIGER_Features` utility function for LIGER objects (analogous to `Seurat::Features()`).
- Added new generic `as.LIGER()` as enhanced method for conversion of Seurat objects or lists of Seurat objects to single LIGER object.
- Added new generic `as.anndata()` to support conversion of Seurat and LIGER objects to anndata format.
- Added function `Convert_Assay()` to perform easy conversions of Seurat assays between V3/4 (Assay) and V5 (Assay5) formats.
- Added parameter `assay_type` to allow manual control of assay type when creating Seurat object from LIGER using `Liger_to_Seurat`. Now `as.Seurat`.
- Added param `grid_color` to `Clustered_DotPlot` to control the color of grid lines (default is no grid lines).
- Added ability to split identities in `Clustered_DotPlot` by additional variable and maintain expression information.
- Added `Split_Layers()` function for V5 objects.
- Added `Add_Alt_Feature_ID` to add alternative feature ids to an Assay5 meta.data slot.



## Changed
- **BREAKING CHANGES** Several methods have been moved to S3 generics to function for both Seurat and LIGER objects using single function name and therefore some function names have changed. Old functions will give deprecation warning and direct users to new functions.
- `Add_Mito_Ribo()` replaces `Add_Mito_Ribo_Seurat` and `Add_Mito_Ribo_LIGER`.
- `Add_Cell_Complexity()` replaces `Add_Cell_Complexity_Seurat` and `Add_Cell_Complexity_LIGER`.
- **BREAKING CHANGES** `Meta_Present_LIGER` has been deprecated and wrapped inside of `Meta_Present`.
- **SOFT-DEPRECATION** The function `Liger_to_Seurat()` has been soft-deprecated. It is replaced by new extension of Seurat generic `as.Seurat` with added support for Liger objects, using all the same parameters as `Liger_to_Seurat`. Full deprecation will occur in v2.2.0.
- **SOFT-DEPRECATION** The function `Gene_Present` has been soft-deprecated. It is replaced by `Feature_Present` which functions identically but better reflects that features present may also be proteins. Full deprecation will occur in v2.2.0.
- Parameter `legend` in `Iterate_DimPlot_bySample` has been inverted to `no_legend` to match `Meta_Highlight_Plot` parameters.
- Updated `Liger_to_Seurat()` for compatibility with Seurat V5 structure ([#153](https://github.com/samuel-marsh/scCustomize/issues/153)). Now part of `as.Seurat`.
- Default color palette change from v2.0.0 when number of groups is between 3-8 has been reverted. Polychrome palette is default when number of groups is between 3-36.
- In preparation of upcoming overhaul of rliger package, added package version checks to current rliger functions in order to prevent breaking errors. Next update v2.2.0 will add cross-functionality between rliger package versions ([#161](https://github.com/samuel-marsh/scCustomize/issues/161)).


## Fixes
- General typo and style fixes.
- Fixed point size check in some QC functions to avoid unnecessary error message.
- Fixed redundant warning messages in `Stacked_VlnPlot` due to rasterization defaults.
- Fixed issue setting `alpha_na_exp` appropriately in `FeaturePlot_scCustom`.
- Fixed issue setting `alpha_exp` between Seurat versions 4 and 5 ([#144](https://github.com/samuel-marsh/scCustomize/issues/144)).
- Fix duplicate legends in `DimPlot_scCustom` when levels are missing from a split plot.
- Fixed bug in `FeaturePlot_scCustom` that could cause plots to be mislabeled when using `split.by` and depending on the order of features provided ([#150](https://github.com/samuel-marsh/scCustomize/issues/150)).
- Fixes issue with automatic point size calculation for Seurat Objects.
- Added check for presence of dimensionality reduction in `DimPlot_LIGER` ([#153](https://github.com/samuel-marsh/scCustomize/issues/153)).
- Fixed bug in `Add_Mito_Ribo_LIGER` that caused it to return value of 0 for all cells (Now part of renamed `Add_Mito_Ribo` S3 generic).
- Fixed legend display is `Clustered_DotPlot` to display percentage instead of proportion to match legend text.
- Fixed `Percent_Expressing` error when `group_by = "ident"`.
- Fixed error that caused features in non-default assays to be returned as not found when attempting to plot.
- Fixed error in `DotPlot_scCustom` that didn't correctly pass `group.by` when plotting ([#158](https://github.com/samuel-marsh/scCustomize/issues/158)).




# scCustomize 2.0.1 (2023-11-17)
## Added
- None.
Expand Down
6 changes: 1 addition & 5 deletions R/Color_Palettes.R
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ DiscretePalette_scCustomize <- function(
#' @param num_groups number of groups to be plotted. If `ggplot_default_colors = FALSE` then by default:
#' \itemize{
#' \item If number of levels plotted equal to 2 then colors will be `NavyAndOrange()`.
#' \item If number of levels plotted greater than 2 but less than or equal to 8 it will use `ColorBlind_Pal()`.
#' \item If number of levels plotted greater than 2 but less than or equal to 36 it will use "polychrome" from `DiscretePalette_scCustomize()`.
#' \item If greater than 36 will use "varibow" with shuffle = TRUE from `DiscretePalette_scCustomize`.
#' }
Expand Down Expand Up @@ -517,10 +516,7 @@ scCustomize_Palette <- function(
if (num_groups == 2) {
colors_use <- NavyAndOrange()
}
if (num_groups > 2 && num_groups <= 8) {
colors_use <- ColorBlind_Pal()
}
if (num_groups > 8 && num_groups <= 36) {
if (num_groups > 2 && num_groups <= 36) {
colors_use <- DiscretePalette_scCustomize(num_colors = num_groups, palette = "polychrome")
}
if (num_groups > 36) {
Expand Down
77 changes: 77 additions & 0 deletions R/Deprecated.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#################### DEPRECATED FUNCTIONS ####################
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

#' Deprecated functions `r lifecycle::badge("deprecated")`
#'
#'
#' @description
#' Use [FeatureScatter_scCustom()] instead of `Split_FeatureScatter()`.
#'
#' @export
#' @keywords internal
#' @rdname deprecated

Split_FeatureScatter <- function(...) {
lifecycle::deprecate_stop(when = "2.0.0", what = "Split_FeatureScatter()", with = "FeatureScatter_scCustom()")
}


#' @description
#' Use [Add_Mito_Ribo()] instead of `Add_Mito_Ribo_Seurat()`.
#'
#' @export
#' @keywords internal
#' @name deprecated

Add_Mito_Ribo_Seurat <- function(...) {
lifecycle::deprecate_stop(when = "2.1.0", what = "Add_Mito_Ribo_Seurat()", with = "Add_Mito_Ribo()")
}


#' @description
#' Use [Add_Mito_Ribo()] instead of `Add_Mito_Ribo_LIGER()`.
#'
#' @export
#' @keywords internal
#' @rdname deprecated

Add_Mito_Ribo_LIGER <- function(...) {
lifecycle::deprecate_stop(when = "2.1.0", what = "Add_Mito_Ribo_LIGER()", with = "Add_Mito_Ribo()")
}


#' @description
#' Use [Add_Cell_Complexity()] instead of `Add_Cell_Complexity_Seurat()`.
#'
#' @export
#' @keywords internal
#' @rdname deprecated

Add_Cell_Complexity_Seurat <- function(...) {
lifecycle::deprecate_stop(when = "2.1.0", what = "Add_Cell_Complexity_Seurat()", with = "Add_Cell_Complexity()")
}


#' @description
#' Use [Add_Cell_Complexity()] instead of `Add_Cell_Complexity_LIGER()`.
#'
#' @export
#' @keywords internal
#' @rdname deprecated

Add_Cell_Complexity_LIGER <- function(...) {
lifecycle::deprecate_stop(when = "2.1.0", what = "Add_Cell_Complexity_LIGER()", with = "Add_Cell_Complexity()")
}


#' @description
#' Use [Meta_Present()] instead of `Meta_Present_LIGER()`.
#'
#' @export
#' @keywords internal
#' @rdname deprecated

Meta_Present_LIGER <- function(...) {
lifecycle::deprecate_stop(when = "2.1.0", what = "Meta_Present_LIGER()", with = "Meta_Present()")
}
Loading

0 comments on commit cee1dc1

Please sign in to comment.