Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Unify code for RawDataTable and InvertedRawDataTable, selections will…
Browse files Browse the repository at this point in the history
… added as new column

Caleydo/targid2#255
  • Loading branch information
Holger Stitz committed Oct 12, 2016
1 parent 42efa16 commit 70120a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
8 changes: 1 addition & 7 deletions ExpressionScore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ class ExpressionScore implements IScore<number> {
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<any[]> {
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;
});
}
}
Expand Down
10 changes: 2 additions & 8 deletions Scores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ class AvgScore implements IScore<number> {
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<any[]> {
return ajax.getAPIJSON('/targid/db/dummy/avg_score');
}
}

Expand Down

0 comments on commit 70120a2

Please sign in to comment.