Skip to content

Commit

Permalink
Merge pull request #13 from bzhanglab/dev
Browse files Browse the repository at this point in the history
remove borrowing on jobs
  • Loading branch information
iblacksand authored Oct 31, 2023
2 parents 56d5c61 + e4ac434 commit 963575b
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions webgestalt_lib/src/methods/multiomics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ pub enum AnalysisType {
ORA,
}

pub struct GSEAJob<'a> {
pub gmt: &'a Vec<Item>,
pub rank_list: &'a Vec<RankListItem>,
pub struct GSEAJob {
pub gmt: Vec<Item>,
pub rank_list: Vec<RankListItem>,
pub config: GSEAConfig,
}

pub struct ORAJob<'a> {
pub gmt: &'a Vec<Item>,
pub interest_list: &'a AHashSet<String>,
pub reference_list: &'a AHashSet<String>,
pub struct ORAJob {
pub gmt: Vec<Item>,
pub interest_list: AHashSet<String>,
pub reference_list: AHashSet<String>,
pub config: ORAConfig,
}

Expand Down Expand Up @@ -66,7 +66,7 @@ pub fn multiomic_gsea(jobs: Vec<GSEAJob>, method: MultiOmicsMethod) -> Vec<Vec<F
let mut phash: AHashMap<String, Vec<f64>> = AHashMap::default();
let mut results: Vec<Vec<FullGSEAResult>> = Vec::new();
for job in jobs {
let res = gsea(job.rank_list.to_vec(), job.gmt.to_vec(), job.config, None);
let res = gsea(job.rank_list, job.gmt, job.config, None);
for row in res.iter() {
let set = row.set.clone();
phash.entry(set).or_default().push(row.p);
Expand Down Expand Up @@ -125,12 +125,7 @@ pub fn multiomic_ora(jobs: Vec<ORAJob>, method: MultiOmicsMethod) -> Vec<Vec<ORA
let mut phash: AHashMap<String, Vec<f64>> = AHashMap::default();
let mut results: Vec<Vec<ORAResult>> = Vec::new();
for job in jobs {
let res = get_ora(
job.interest_list,
job.reference_list,
job.gmt.to_vec(),
job.config,
);
let res = get_ora(&job.interest_list, &job.reference_list, job.gmt, job.config);
for row in res.iter() {
let set = row.set.clone();
phash.entry(set).or_default().push(row.p);
Expand Down

0 comments on commit 963575b

Please sign in to comment.