Skip to content

Commit

Permalink
fix dr swap exp
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhanH committed Aug 5, 2021
1 parent 434d918 commit 01b9599
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -1230,15 +1230,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 01b9599

Please sign in to comment.