Skip to content

Commit

Permalink
Use correct cell count
Browse files Browse the repository at this point in the history
  • Loading branch information
edlu77 committed Apr 5, 2024
1 parent a3d6278 commit 2190a71
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/services/src/lib/ftu-data/ftu-data.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export class FtuDataImplService extends FtuDataService {
const cells = summary.map((entry) => ({
id: entry.cell_id as Iri,
label: entry.cell_label,
count: entry.count,
}));

const biomarkers = summary.map((entry) => ({
Expand Down
1 change: 1 addition & 0 deletions libs/services/src/lib/ftu-data/ftu-data.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const CELL_SUMMARY_DATA: CellSummary[] = Object.values(MOCK_SUMMARIES).map((summ
cells: summary.entries.map((entry) => ({
id: entry.cell.id as Iri,
label: entry.cell.label,
count: entry.count,
})),
biomarkers: summary.entries.map((entry) => ({
id: entry.biomarker.id as Iri,
Expand Down
1 change: 1 addition & 0 deletions libs/services/src/lib/ftu-data/ftu-data.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const TISSUE_LIBRARY = z.object({
export const CELL = z.object({
id: IRI,
label: z.string(),
count: z.number(),
});

/** Zod Schema for a BIOMARKER */
Expand Down
2 changes: 1 addition & 1 deletion libs/state/src/lib/cell-summary/cell-summary.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function computeAggregate(summary: CellSummary): CellSummaryAggregate {

for (const [cell, row] of rowsByCell.entries()) {
row[0] = getLabel(cells, cell, 'cell');
row[1] = getTotalCount(row);
row[1] = cells.find((celll) => celll.label === getLabel(cells, cell, 'cell'))?.count;
}

const columns = Array.from(columnIndexByBiomarker.keys()).map((id) => getLabel(biomarkers, id, 'biomarker'));
Expand Down

0 comments on commit 2190a71

Please sign in to comment.