Skip to content

Commit

Permalink
Merge pull request satijalab#590 from satijalab/fix/SingleCellExperim…
Browse files Browse the repository at this point in the history
…ent_assay

Fix/single cell experiment assay
  • Loading branch information
mojaveazure authored Aug 6, 2021
2 parents 434d918 + 1ab3106 commit 60b977c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Seurat
Version: 4.0.3.9013
Date: 2021-07-30
Version: 4.0.3.9014
Date: 2021-08-06
Title: Tools for Single Cell Genomics
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, Stuart T, Butler A, et al (2019) <doi:10.1016/j.cell.2019.05.031>, and Hao, Hao, et al (2020) <doi:10.1101/2020.10.12.335331> for more details.
Authors@R: c(
Expand Down Expand Up @@ -57,7 +57,7 @@ Imports:
png,
RANN,
RColorBrewer,
Rcpp,
Rcpp (>= 1.0.7),
RcppAnnoy (>= 0.0.18),
reticulate,
rlang,
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Bug fix in `FindVariableFeatures()` when using `selection.method = "mvp"` and `binning.method = "equal_frequency"` ([#4712](https://github.com/satijalab/seurat/issues/4712))
- Bug fix in `DoHeatmap()` to remove random characters from plot legend([#4660](https://github.com/satijalab/seurat/issues/4660))
- Fix cell renaming in `RunCCA()`
- Fix issue in SingleCellExperiment conversion where the mainExp would not be set properly

## Seurat 4.0.3 (2020-06-10)`
## Added
Expand Down
8 changes: 6 additions & 2 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,9 @@ as.SingleCellExperiment.Seurat <- function(x, assay = NULL, ...) {
if (!all(assay %in% Assays(object = x))) {
stop("One or more of the assays you are trying to convert is not in the Seurat object")
}
if (DefaultAssay(object = x) %in% assay) {
assay <- union(DefaultAssay(object = x), assay)
}
experiments <- list()
for (assayn in assay) {
assays <- list(
Expand Down Expand Up @@ -1230,15 +1233,16 @@ as.SingleCellExperiment.Seurat <- function(x, assay = NULL, ...) {
}
for (dr in FilterObjects(object = x, classes.keep = "DimReduc")) {
assay.used <- DefaultAssay(object = x[[dr]])
if (assay.used %in% SingleCellExperiment::altExpNames(x = sce) & assay.used != orig.exp.name) {
swap.exp <- assay.used %in% SingleCellExperiment::altExpNames(x = sce) & assay.used != orig.exp.name
if (swap.exp) {
sce <- SingleCellExperiment::swapAltExp(
x = sce,
name = assay.used,
saved = orig.exp.name
)
}
SingleCellExperiment::reducedDim(x = sce, type = toupper(x = dr)) <- Embeddings(object = x[[dr]])
if (assay.used %in% SingleCellExperiment::altExpNames(x = sce) & assay.used != orig.exp.name) {
if (swap.exp) {
sce <- SingleCellExperiment::swapAltExp(
x = sce,
name = orig.exp.name,
Expand Down
5 changes: 5 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// RunModularityClusteringCpp
IntegerVector RunModularityClusteringCpp(Eigen::SparseMatrix<double> SNN, int modularityFunction, double resolution, int algorithm, int nRandomStarts, int nIterations, int randomSeed, bool printOutput, std::string edgefilename);
RcppExport SEXP _Seurat_RunModularityClusteringCpp(SEXP SNNSEXP, SEXP modularityFunctionSEXP, SEXP resolutionSEXP, SEXP algorithmSEXP, SEXP nRandomStartsSEXP, SEXP nIterationsSEXP, SEXP randomSeedSEXP, SEXP printOutputSEXP, SEXP edgefilenameSEXP) {
Expand Down

0 comments on commit 60b977c

Please sign in to comment.