Skip to content

Commit 6f5f8fa

Browse files
authored
FDR greater than 1.0 set to 1. (#28)
* set fdr to 1 if greater than 1 * update versions
1 parent 0e38d74 commit 6f5f8fa

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "webgestalt"
5-
version = "0.3.1"
5+
version = "0.3.2"
66
authors = ["John Elizarraras"]
77
edition = "2021"
88
rust-version = "1.63.0"
@@ -17,7 +17,7 @@ bincode = "1.3.3"
1717
clap = { version = "4.4.15", features = ["derive"] }
1818
owo-colors = { version = "4.0.0", features = ["supports-colors"] }
1919
serde_json = "1.0.116"
20-
webgestalt_lib = { version = "0.3.1", path = "webgestalt_lib" }
20+
webgestalt_lib = { version = "0.3.2", path = "webgestalt_lib" }
2121

2222
[profile.release]
2323
opt-level = 3

webgestalt_lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "webgestalt_lib"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
authors = ["John Elizarraras"]
55
edition = "2021"
66
rust-version = "1.63.0"

webgestalt_lib/src/methods/gsea.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,13 @@ pub fn gsea(
379379
.filter(|&x| x.abs() >= nes_abs)
380380
.count() as f64;
381381
let fdr: f64 = (top_val * bottom_len) / (bottom_val * top_len); // get FDR value
382+
let fdr = if fdr.is_nan() {
383+
0.0
384+
} else if fdr > 1.0 {
385+
1.0
386+
} else {
387+
fdr
388+
};
382389
final_gsea.push(item.add_fdr(fdr));
383390
}
384391
final_gsea

0 commit comments

Comments
 (0)