Skip to content

Commit f16a4ce

Browse files
Updated organ and organ part to use specimen. Resolves #901 (#1156)
* Updated row mapper and facets to use specimen organ and speciment organ part. Resolves #901. * Updated organ and organ part to use specimen. Resolves #901.
1 parent 4c6e669 commit f16a4ce

File tree

8 files changed

+35
-17
lines changed

8 files changed

+35
-17
lines changed

spa/src/app/files/hca-table-column-header-count/hca-table-column-header-count.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Component, Input } from "@angular/core";
1010

1111
// App dependencies
1212
import { getColumnCountType } from "../table/table-methods";
13+
import { getColumnCountName } from "../table/table-methods";
1314

1415
@Component({
1516
selector: "hca-table-column-header-count",
@@ -27,10 +28,6 @@ export class HCATableColumnHeaderCountComponent {
2728
// Template variables
2829
tooltipContentForCount = "Count of distinct values for this facet in the current search result set.";
2930

30-
/**
31-
* Public API
32-
*/
33-
3431
/**
3532
* Return a count of the set of values for the specified column.
3633
*
@@ -39,7 +36,8 @@ export class HCATableColumnHeaderCountComponent {
3936
*/
4037
public getDomainCount(columnName: string): number {
4138

42-
return this.domainCountsByColumnName.get(columnName);
39+
const columnCountName = getColumnCountName(columnName);
40+
return this.domainCountsByColumnName.get(columnCountName);
4341
}
4442

4543
/**

spa/src/app/files/hca-table-projects/project-row-mapper.mock.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,12 @@ export const PROJECT_ROW_VALUES_ACROSS_MULTIPLE_OBJECTS =
528528
"420508_specimen"
529529
],
530530
"organ": [
531-
"brain"
531+
"brain",
532+
"blood"
533+
],
534+
"organPart": [
535+
"a"
532536
],
533-
"organPart": [],
534537
"disease": [
535538
"x",
536539
"y"

spa/src/app/files/shared/file-facet-display.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class FileFacetDisplayService {
2525
},
2626
{
2727
facetGroupName: "Tissue Type",
28-
facetNames: ["sampleEntityType", "organ", "organPart", "modelOrgan", "selectedCellType"]
28+
facetNames: ["sampleEntityType", "specimenOrgan", "specimenOrganPart", "modelOrgan", "selectedCellType"]
2929
},
3030
{
3131
facetGroupName: "Specimen",

spa/src/app/files/shared/file-facet-name-display.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ export enum FileFacetNameDisplay {
1111
"libraryConstructionApproach" = "Library Construction Method",
1212
"projectId" = "Project",
1313
"sampleEntityType" = "Sample Type",
14+
"specimenOrgan" = "Organ",
15+
"specimenOrganPart" = "Organ Part",
1416
"workflow" = "Analysis Protocol"
1517
}

spa/src/app/files/table/entity-row-mapper.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ describe("EntityRowMapper:", () => {
427427
dataSource.connect().subscribe((rows) => {
428428

429429
const mappedProject = rows[0];
430-
expect(mappedProject.organ).toEqual(projectToMap.samples[0].organ[0]);
430+
expect(mappedProject.organ).toEqual(projectToMap.specimens[0].organ[0]);
431431
done();
432432
})
433433
});
@@ -442,7 +442,7 @@ describe("EntityRowMapper:", () => {
442442
dataSource.connect().subscribe((rows) => {
443443

444444
const mappedProject = rows[0];
445-
expect(mappedProject.organ).toEqual(projectToMap.samples[0].organ.join(", "));
445+
expect(mappedProject.organ).toEqual(projectToMap.specimens[0].organ.join(", "));
446446
done();
447447
})
448448
});
@@ -457,7 +457,7 @@ describe("EntityRowMapper:", () => {
457457
dataSource.connect().subscribe((rows) => {
458458

459459
const mappedProject = rows[0];
460-
const expectedValue = mapMultipleValues(projectToMap.samples, "organ");
460+
const expectedValue = mapMultipleValues(projectToMap.specimens, "organ");
461461
expect(mappedProject.organ).toEqual(expectedValue);
462462
done();
463463
})
@@ -590,7 +590,7 @@ describe("EntityRowMapper:", () => {
590590
dataSource.connect().subscribe((rows) => {
591591

592592
const mappedProject = rows[0];
593-
expect(mappedProject.organPart).toEqual(projectToMap.samples[0].organPart[0]);
593+
expect(mappedProject.organPart).toEqual(projectToMap.specimens[0].organPart[0]);
594594
done();
595595
})
596596
});
@@ -605,7 +605,7 @@ describe("EntityRowMapper:", () => {
605605
dataSource.connect().subscribe((rows) => {
606606

607607
const mappedProject = rows[0];
608-
expect(mappedProject.organPart).toEqual(projectToMap.samples[0].organPart.join(", "));
608+
expect(mappedProject.organPart).toEqual(projectToMap.specimens[0].organPart.join(", "));
609609
done();
610610
})
611611
});
@@ -620,7 +620,7 @@ describe("EntityRowMapper:", () => {
620620
dataSource.connect().subscribe((rows) => {
621621

622622
const mappedProject = rows[0];
623-
const expectedValue = mapMultipleValues(projectToMap.samples, "organPart");
623+
const expectedValue = mapMultipleValues(projectToMap.specimens, "organPart");
624624
expect(mappedProject.organPart).toEqual(expectedValue);
625625
done();
626626
})

spa/src/app/files/table/entity-row-mapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export class EntityRowMapper {
3030
this.cellSuspensions = rollUpMetadata(row.cellSuspensions);
3131
this.donorOrganisms = rollUpMetadata(row.donorOrganisms);
3232
this.samples = rollUpMetadata(row.samples);
33-
this.organs = this.samples.organ;
33+
this.specimens = rollUpMetadata(row.specimens);
34+
this.organs = this.specimens.organ;
3435
this.projects = rollUpMetadata(row.projects);
3536
this.protocols = rollUpMetadata(row.protocols);
3637
this.row = row;
37-
this.specimens = rollUpMetadata(row.specimens);
3838
}
3939

4040
/**
@@ -75,7 +75,7 @@ export class EntityRowMapper {
7575
libraryConstructionApproach: mappedLibraryConstructionApproach,
7676
organ: getUnspecifiedIfNullValue(this.organs),
7777
organismAge: getUnspecifiedIfNullValue(this.donorOrganisms.organismAge),
78-
organPart: getUnspecifiedIfNullValue(this.samples.organPart),
78+
organPart: getUnspecifiedIfNullValue(this.specimens.organPart),
7979
modelOrgan: modelOrgan,
8080
pairedEnd: getUnspecifiedIfNullValue(this.protocols.pairedEnd),
8181
projectTitle: getUnspecifiedIfNullValue(this.projects.projectTitle),

spa/src/app/files/table/table-column.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface TableColumn {
1818
columnSortKey?: string;
1919
columnTitleWidth?: number;
2020
countType: CountType;
21+
countName?: string;
2122
description?: string;
2223
descriptionFiles?: string;
2324
descriptionProjects?: string;

spa/src/app/files/table/table-methods.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ let tableColumns: TableColumn[] = [
3535
alignment: ColumnAlignment.LEFT,
3636
columnMinWidth: 88,
3737
columnSort: true,
38+
countName: "specimenDisease",
3839
countType: CountType.DOMAIN_COUNT
3940

4041
},
@@ -151,6 +152,7 @@ let tableColumns: TableColumn[] = [
151152
columnFlexDirection: ColumnFlexDirection.COLUMN,
152153
columnMinWidth: 100,
153154
columnSort: true,
155+
countName: "specimenOrgan",
154156
countType: CountType.DOMAIN_COUNT
155157
},
156158
{
@@ -159,6 +161,7 @@ let tableColumns: TableColumn[] = [
159161
description: "A term for a specific part of the organ that the biomaterial came from.",
160162
alignment: ColumnAlignment.LEFT,
161163
columnSort: true,
164+
countName: "specimenOrganPart",
162165
countType: CountType.DOMAIN_COUNT
163166
},
164167
{
@@ -307,6 +310,17 @@ export function getColumnCountType(column: string): string {
307310
return CountType[tableColumn.get(column).countType];
308311
}
309312

313+
/**
314+
* Returns count name for specified column if specified, otherwise returns the column name.
315+
*
316+
* @param {string} columnName
317+
* @returns {string}
318+
*/
319+
export function getColumnCountName(columnName: string): string {
320+
321+
return tableColumn.get(columnName).countName || columnName;
322+
}
323+
310324
/**
311325
* Returns the column description.
312326
* Used by table header tooltip.

0 commit comments

Comments
 (0)