Last active
March 13, 2018 11:13
-
-
Save pati-ni/bc43941a831c6a04f05f250b5c51d3f1 to your computer and use it in GitHub Desktop.
Revisions
-
pati-ni revised this gist
Mar 13, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,4 @@ options(bigmemory.allow.dimnames = TRUE) sce <- readRDS('lake.rds') normcounts(sce) <- as.big.matrix(normcounts(sce)) process(normcounts(sce)) -
pati-ni created this gist
Mar 13, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ library('bigmemory') options(bigmemory.allow.dimnames = TRUE) # Read SingleCellExperiment object sce <- readRDS('lake.rds') normcounts(sce) <- as.big.matrix(normcounts(sce)) process(as.big.matrix(r)) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ // [[Rcpp::depends(BH, bigmemory)]] #include <Rcpp.h> #include <RcppArmadillo.h> #include <bigmemory/MatrixAccessor.hpp> #include <bigmemory/BigMatrix.h> arma::mat cast_big_matrix(const SEXP& mat) { Rcpp::XPtr<BigMatrix> xpMat(mat); return arma::mat((double*)xpMat->matrix(), xpMat->nrow(), xpMat->ncol(), false); } arma::mat process(const SEXP& mat) { arma::mat matrix(cast_big_matrix(mat)); // Do processing return matrix; }