Skip to content

Commit 2095e82

Browse files
replace std::random_shuffle() with std::shuffle()
1 parent ea42bc4 commit 2095e82

File tree

4 files changed

+26
-30
lines changed

4 files changed

+26
-30
lines changed

DESCRIPTION

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Package: scde
22
Type: Package
33
Title: Single Cell Differential Expression
4-
Version: 2.26.2
5-
Date: 2016-01-20
4+
Version: 2.27.1
65
Description: The scde package implements a set of statistical methods for
76
analyzing single-cell RNA-seq data. scde fits individual error models for
87
single-cell RNA-seq measurements. These models can then be used for assessment
@@ -18,16 +17,17 @@ Description: The scde package implements a set of statistical methods for
1817
transcriptional heterogeneity through pathway and gene set overdispersion
1918
analysis" (Fan J, Salathia N, Liu R, Kaeser G, Yung Y, Herman J, Kaper F,
2019
Fan JB, Zhang K, Chun J, and Kharchenko PV, Nature Methods, doi:10.1038/nmeth.3734).
21-
Author: Peter Kharchenko [aut, cre],
22-
Jean Fan [aut]
20+
Author: Peter Kharchenko [aut, cre], Jean Fan [aut], Evan Biederstedt [aut]
2321
Authors@R: c(
2422
person("Peter", "Kharchenko", role = c("aut", "cre"),
25-
email = "Peter_Kharchenko@hms.harvard.edu"),
23+
email = "Peter_Kharchenko@hms.harvard.edu"),
2624
person("Jean", "Fan", role = "aut",
27-
email = "jeanfan@jhu.edu",
28-
comment = c(ORCID = "0000-0002-0212-5451"))
29-
)
30-
Maintainer: Jean Fan <jeanfan@jhu.edu>
25+
email = "jeanfan@jhu.edu",
26+
comment = c(ORCID = "0000-0002-0212-5451")),
27+
person("Evan", "Biederstedt", role = "aut",
28+
email = "evan.biederstedt@gmail.com")
29+
)
30+
Maintainer: Evan Biederstedt <evan.biederstedt@gmail.com>
3131
URL: http://pklab.med.harvard.edu/scde
3232
BugReports: https://github.com/hms-dbmi/scde/issues
3333
License: GPL-2
@@ -36,17 +36,11 @@ Depends: R (>= 3.0.0), flexmix
3636
Imports: Rcpp (>= 0.10.4), RcppArmadillo (>= 0.5.400.2.0), mgcv, Rook,
3737
rjson, MASS, Cairo, RColorBrewer, edgeR, quantreg, methods,
3838
nnet, RMTstat, extRemes, pcaMethods, BiocParallel, parallel
39-
Suggests: knitr, cba, fastcluster, WGCNA, GO.db, org.Hs.eg.db,
40-
rmarkdown
41-
biocViews: ImmunoOncology, RNASeq, StatisticalMethod,
42-
DifferentialExpression, Bayesian, Transcription, Software
39+
Suggests: knitr, cba, fastcluster, WGCNA, GO.db, org.Hs.eg.db, rmarkdown
40+
biocViews: ImmunoOncology, RNASeq, StatisticalMethod, DifferentialExpression, Bayesian,
41+
Transcription, Software
4342
LinkingTo: Rcpp, RcppArmadillo
4443
VignetteBuilder: knitr
45-
Packaged: 2023-01-19 22:55:25 UTC; biocbuild
44+
Packaged: 2015-11-02 14:30:04 UTC; reyes
4645
RoxygenNote: 5.0.0
4746
NeedsCompilation: yes
48-
git_url: https://git.bioconductor.org/packages/scde
49-
git_branch: RELEASE_3_16
50-
git_last_commit: 42cdc08
51-
git_last_commit_date: 2023-01-19
52-
Date/Publication: 2023-01-19

src/Makevars

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
## Use the R_HOME indirection to support installations of multiple R version
2-
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
3-
4-
1+
PKG_CXXFLAGS=$(SHLIB_OPENMP_CXXFLAGS)
2+
PKG_LIBS=-L/usr/lib/ -L"." -lpthread -lm `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(SHLIB_OPENMP_CXXFLAGS)

src/Makevars.win

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
2-
## This assume that we can call Rscript to ask Rcpp about its locations
3-
## Use the R_HOME indirection to support installations of multiple R version
4-
PKG_LIBS = $(shell $(R_HOME)/bin/Rscript.exe -e "Rcpp:::LdFlags()") $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
5-
1+
PKG_CXXFLAGS=$(SHLIB_OPENMP_CXXFLAGS)
2+
PKG_LIBS=-L/usr/lib/ -L"." -lpthread -lm $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()") $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(SHLIB_OPENMP_CXXFLAGS)

src/bwpca.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "bwpca.h"
2+
#include <random>
23
#include <vector>
34
#include <algorithm>
45
#include <iostream>
@@ -24,8 +25,11 @@ void set_random_matrix(arma::mat& target,arma::mat& source) {
2425
ind[j]=j;
2526
} // set up initial index (1,2,3)
2627

28+
// The random number generator that we want to use (Mersenne Twister)
29+
std::mt19937 rng(std::time(nullptr));
30+
2731
for(int i=0;i<target.n_cols;i++) {
28-
std::random_shuffle(ind.begin(), ind.end());
32+
std::shuffle(ind.begin(), ind.end(), rng); // NOTE: std::random_shuffler() was deprecated in C++14 and completely removed in C++17
2933
//std::sort(ind.start(), ind.end(), std::bind(compare_on_other, _1, _2, rv));
3034
for(int j=0;j<target.n_rows;j++) {
3135
target(j,i)=source(ind[j],i);
@@ -41,8 +45,11 @@ void set_random_matrices(arma::mat& target1,arma::mat& source1,arma::mat& target
4145
ind[j]=j;
4246
} // set up initial index (1,2,3)
4347

48+
// The random number generator that we want to use (Mersenne Twister)
49+
std::mt19937 rng(std::time(nullptr));
50+
4451
for(int i=0;i<target1.n_cols;i++) {
45-
std::random_shuffle(ind.begin(), ind.end());
52+
std::shuffle(ind.begin(), ind.end(), rng); // NOTE: std::random_shuffler() was deprecated in C++14 and completely removed in C++17
4653
//std::sort(ind.start(), ind.end(), std::bind(compare_on_other, _1, _2, rv));
4754
for(int j=0;j<target1.n_rows;j++) {
4855
target1(j,i)=source1(ind[j],i);

0 commit comments

Comments
 (0)