Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 73 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webgestalt_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository = "https://github.com/bzhanglab/webgestalt_rust"
[dependencies]
csv = "1.3.0"
serde = { version = "1.0.190", features = ["std", "derive"] }
rand = { version = "0.8.5", features = ["small_rng"] }
rand = { version = "0.9.3", features = ["small_rng"] }
rayon = "1.8.0"
statrs = "0.16.0"
ahash = "0.8.6"
Expand Down
10 changes: 9 additions & 1 deletion webgestalt_lib/src/methods/gsea.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,17 @@ pub fn gsea(
/// ```
pub fn make_permutations(permutations: i32, max: usize, seed: Option<u64>) -> Vec<Vec<usize>> {
let mut temp_permutations: Vec<Vec<usize>> = Vec::new();
// `from_os_rng` is rand 0.9's name for what was `from_entropy`.
//
// Note that 0.9 changed what a seed *means*: it reimplemented
// `SmallRng::seed_from_u64` and replaced the `shuffle` algorithm, both listed under
// "Reproducibility-breaking changes". A given seed therefore produces different
// permutations here than it did under 0.8, and so different p-values. Verified rather
// than assumed — seed 42 gives [16, 2, 5, 14, …] under 0.8 and [16, 17, 19, 6, …] here.
// Seeds are comparable within a version of this crate, not across versions.
let mut smallrng = match seed {
Some(s) => rand::rngs::SmallRng::seed_from_u64(s),
None => rand::rngs::SmallRng::from_entropy(),
None => rand::rngs::SmallRng::from_os_rng(),
};
(0..permutations).for_each(|_i| {
// get random permutations that are shared for all analyte sets
Expand Down
Loading