diff --git a/ExpressionScore.ts b/ExpressionScore.ts index 9a2f20c..176a0c1 100644 --- a/ExpressionScore.ts +++ b/ExpressionScore.ts @@ -20,17 +20,11 @@ class ExpressionScore implements IScore { domain: this.score === 'ab_int' ? [0, 100] : [-1, 1] }; } - compute(ids: ranges.Range, idtype: idtypes.IDType, idMapper:(id:string) => number): Promise<{ [id:string]: number }> { + compute(ids: ranges.Range, idtype: idtypes.IDType): Promise { return ajax.getAPIJSON('/targid/db/dummy/expression_score', { score: this.score, b_cat2 : this.tumor_sample, agg: this.aggregation - }).then((rows: any[]) => { - const r : { [id:string]: number } = {}; - rows.forEach((row) => { - r[idMapper(row.id)] = row.score; - }); - return r; }); } } diff --git a/Scores.ts b/Scores.ts index 3de4e15..deac3fe 100644 --- a/Scores.ts +++ b/Scores.ts @@ -20,14 +20,8 @@ class AvgScore implements IScore { domain: [0, 100] }; } - compute(ids: ranges.Range, idtype: idtypes.IDType, idMapper:(id:string) => number): Promise<{ [id:string]: number }> { - return ajax.getAPIJSON('/targid/db/dummy/avg_score').then((rows: any[]) => { - const r : { [id:string]: number } = {}; - rows.forEach((row) => { - r[idMapper(row.id)] = row.score; - }); - return r; - }); + compute(ids: ranges.Range, idtype: idtypes.IDType): Promise { + return ajax.getAPIJSON('/targid/db/dummy/avg_score'); } }