diff --git a/Cargo.toml b/Cargo.toml index 4d4f1d9..d36ab43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,9 @@ edition = "2021" [dependencies] bincode = "1.3.3" clap = { version = "4.4.6", features = ["derive"] } -owo-colors = {version = "3.5.0", features = ["supports-colors"]} -serde = {version="1.0.188", features=["std", "derive"]} -webgestalt_lib = {path = "webgestalt_lib"} +owo-colors = { version = "3.5.0", features = ["supports-colors"] } +serde = { version = "1.0.188", features = ["std", "derive"] } +webgestalt_lib = { path = "webgestalt_lib" } [profile.release] opt-level = 3 diff --git a/webgestalt_lib/src/methods/gsea.rs b/webgestalt_lib/src/methods/gsea.rs index ff36f92..b2a4dd7 100644 --- a/webgestalt_lib/src/methods/gsea.rs +++ b/webgestalt_lib/src/methods/gsea.rs @@ -4,7 +4,6 @@ use ahash::AHashSet; use rand::prelude::SliceRandom; use rand::SeedableRng; use rayon::prelude::*; -use std::sync::{Arc, Mutex}; /// Parameters for GSEA #[derive(Clone)] @@ -202,8 +201,8 @@ fn analyte_set_p( .collect(); let up_len = up.len(); let down_len = down.len(); - let up_avg: f64 = up.iter().sum::() / (up_len as f64 + 0.000001) + 0.000001; // up average - let down_avg: f64 = down.iter().sum::() / (down_len as f64 + 0.000001) - 0.000001; // down average + let up_avg: f64 = up.par_iter().sum::() / (up_len as f64 + 0.000001) + 0.000001; // up average + let down_avg: f64 = down.par_iter().sum::() / (down_len as f64 + 0.000001) - 0.000001; // down average let mut nes_es: Vec = up.par_iter().map(|x| x / up_avg).collect(); // get all normalized scores for up nes_es.extend(down.par_iter().map(|x| -x / down_avg).collect::>()); // extend with down scores let norm_es: f64 = if real_es >= 0_f64 { diff --git a/webgestalt_lib/src/methods/multiomics.rs b/webgestalt_lib/src/methods/multiomics.rs index bd700e2..284b907 100644 --- a/webgestalt_lib/src/methods/multiomics.rs +++ b/webgestalt_lib/src/methods/multiomics.rs @@ -22,7 +22,7 @@ pub enum MetaAnalysisMethod { } pub enum AnalysisType { - /// Gene Set Enrichment Analysips + /// Gene Set Enrichment Analysis GSEA, /// Over-representation Analysis ORA, @@ -49,12 +49,12 @@ pub enum NormalizationMethod { None, } -/// Run a multiomics analysis, using iehter the max/mean median ratio or a typical meta analysis +/// Run a multiomics analysis, using either the max/mean median ratio or a typical meta analysis /// method /// /// # Parameters /// -/// - `jobs` - A [`Vec`] containing all of the seperates 'jobs' or analysis to combine +/// - `jobs` - A [`Vec`] containing all of the separates 'jobs' or analysis to combine /// - `method` - A [`MultiOmicsMethod`] enum detailing the analysis method to combine the runs together (meta-analysis, mean median ration, or max median ratio). /// /// # Returns diff --git a/webgestalt_lib/src/methods/ora.rs b/webgestalt_lib/src/methods/ora.rs index f80fe66..2685b57 100644 --- a/webgestalt_lib/src/methods/ora.rs +++ b/webgestalt_lib/src/methods/ora.rs @@ -2,7 +2,6 @@ use crate::{readers::utils::Item, stat}; use ahash::AHashSet; use rayon::prelude::*; use statrs::distribution::{DiscreteCDF, Hypergeometric}; -use std::sync::{Arc, Mutex}; #[derive(Clone)] pub struct ORAConfig { diff --git a/webgestalt_lib/tests/gsea_tests.rs b/webgestalt_lib/tests/gsea_tests.rs index f281d7c..c782259 100644 --- a/webgestalt_lib/tests/gsea_tests.rs +++ b/webgestalt_lib/tests/gsea_tests.rs @@ -1,4 +1,4 @@ -use pretty_assertions::{assert_eq, assert_ne}; +use pretty_assertions::assert_eq; use statrs::assert_almost_eq; use webgestalt_lib; diff --git a/webgestalt_lib/tests/ora_tests.rs b/webgestalt_lib/tests/ora_tests.rs index 458aef4..7bea113 100644 --- a/webgestalt_lib/tests/ora_tests.rs +++ b/webgestalt_lib/tests/ora_tests.rs @@ -9,7 +9,7 @@ fn ora() { "data/genelist.txt".to_owned(), "data/reference.txt".to_owned(), ); - let gmtcount = gmt.len(); + let gmtcount: usize = gmt.len(); let x: Vec = webgestalt_lib::methods::ora::get_ora(&gene_list, &reference, gmt, ORAConfig::default()); let res = x.iter().find(|x| x.set == "GO:2000147").unwrap();