Skip to content

Commit

Permalink
Merge pull request #347 from hubmapconsortium/cell-count-fix
Browse files Browse the repository at this point in the history
Cell count fix
  • Loading branch information
axdanbol authored Apr 15, 2024
2 parents 8713483 + 9e77a18 commit 1a6d6f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
npx nx affected --target=test --parallel=3 --ci --code-coverage
npx nx affected --target=test-doc-coverage --parallel=3
npx nx affected --target=build --parallel=3
main-branch-name: develop
main-branch-name: ${{ github.base_ref || github.ref_name }}

agents:
name: Nx Cloud - Agents
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ testem.log
Thumbs.db

.angular
.nx
env/
4 changes: 2 additions & 2 deletions libs/state/src/lib/cell-summary/cell-summary.helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CellSummary } from '@hra-ui/services';
import { CellSummaryAggregate, CellSummaryAggregateRow } from './cell-summary.model';
import { CellSummaryAggregate, CellSummaryAggregateCell, CellSummaryAggregateRow } from './cell-summary.model';

/**
* This function gets the index of the column if it does not have any
Expand Down 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] = row.find((item): item is CellSummaryAggregateCell => typeof item === 'object')?.data.count;
}

const columns = Array.from(columnIndexByBiomarker.keys()).map((id) => getLabel(biomarkers, id, 'biomarker'));
Expand Down
3 changes: 3 additions & 0 deletions libs/state/src/lib/cell-summary/cell-summary.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { CellSummary, FtuDataSchemas } from '@hra-ui/services';
import { StateContext } from '@ngxs/store';
import { z } from 'zod';

/** Single aggregate cell */
export type CellSummaryAggregateCell = z.infer<typeof AGGREGATE_CELL>;

/** Type representing a single AGGREGATE_ROW */
export type CellSummaryAggregateRow = z.infer<typeof AGGREGATE_ROW>;

Expand Down

0 comments on commit 1a6d6f7

Please sign in to comment.