Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Development #140

Merged
merged 2 commits into from
Apr 26, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,18 @@ export class PathwayEnrichmentComponent

fetchEnrichedPathwaysFile(): void {
let data: unknown[];
let analyteType = 'both';
if (this.enrichedDataframe.fishresults) {
data = this.enrichedDataframe.fishresults as unknown[]
} else {
data = this.enrichedDataframe as unknown[]
}
if(this.enrichedDataframe.analyte_type) {
analyteType = this.enrichedDataframe.analyte_type[0];
}
const fff = new FisherResult(data[0] as Partial<FisherResult>)
this._downloadFile(
this._toTSV(data, fff._getFields()),
this._toTSV(data, fff._getFields(analyteType)),
'fetchEnrichedPathwaysFromAnalytes-download.tsv',
);
}
Expand Down
9 changes: 7 additions & 2 deletions libs/models/ramp-models/src/lib/fisher-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ export class FisherResult {
}
}

_getFields() {
return Object.keys(this).filter(field => !['Total_In_Path', 'Pval_Holm', 'Pval_FDR', 'Pval', 'Num_In_Path', 'metabCount', 'geneCount', 'pathCount'].includes(field));
_getFields(analyte_type: string) {
let ret: string[];
if(analyte_type ==='both') {
return Object.keys(this).filter(field => !['Total_In_Path', 'Pval_Holm', 'Pval_FDR', 'Pval', 'Num_In_Path', 'metabCount', 'geneCount', 'pathCount'].includes(field));
} else {
return Object.keys(this).filter(field => !['Total_In_Path_Metab', 'Total_In_Path_Gene', 'Pval_combined_Holm', 'Pval_combined_FDR', 'Pval_Metab','Pval_combined', 'Num_In_Path_Metab', 'Num_In_Path_Gene', 'metabCount', 'geneCount', 'pathCount'].includes(field));
}
}
}
Loading