Skip to content

FDR greater than 1.0 set to 1. #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025
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
4 changes: 2 additions & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "webgestalt"
version = "0.3.1"
version = "0.3.2"
authors = ["John Elizarraras"]
edition = "2021"
rust-version = "1.63.0"
Expand All @@ -17,7 +17,7 @@ bincode = "1.3.3"
clap = { version = "4.4.15", features = ["derive"] }
owo-colors = { version = "4.0.0", features = ["supports-colors"] }
serde_json = "1.0.116"
webgestalt_lib = { version = "0.3.1", path = "webgestalt_lib" }
webgestalt_lib = { version = "0.3.2", path = "webgestalt_lib" }

[profile.release]
opt-level = 3
2 changes: 1 addition & 1 deletion webgestalt_lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "webgestalt_lib"
version = "0.3.1"
version = "0.3.2"
authors = ["John Elizarraras"]
edition = "2021"
rust-version = "1.63.0"
Expand Down
7 changes: 7 additions & 0 deletions webgestalt_lib/src/methods/gsea.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ pub fn gsea(
.filter(|&x| x.abs() >= nes_abs)
.count() as f64;
let fdr: f64 = (top_val * bottom_len) / (bottom_val * top_len); // get FDR value
let fdr = if fdr.is_nan() {
0.0
} else if fdr > 1.0 {
1.0
} else {
fdr
};
final_gsea.push(item.add_fdr(fdr));
}
final_gsea
Expand Down