Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hubmapconsortium/hra-ui int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
bherr2 committed Aug 15, 2024
2 parents c6042f7 + 8b2c970 commit 163ccb1
Show file tree
Hide file tree
Showing 19 changed files with 355 additions and 441 deletions.
14 changes: 7 additions & 7 deletions apps/ftu-ui/src/assets/TEMP/ftu-cell-summaries.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@graph": [
{
"@type": "CellSummary",
"cell_source": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"cell_source": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-nephron",
"annotation_method": "Aggregation",
"biomarker_type": "gene",
"summary": [
Expand Down Expand Up @@ -3746,7 +3746,7 @@
},
{
"@type": "CellSummary",
"cell_source": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"cell_source": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-renal-corpuscle",
"annotation_method": "Aggregation",
"biomarker_type": "gene",
"summary": [
Expand Down Expand Up @@ -6744,7 +6744,7 @@
},
{
"@type": "CellSummary",
"cell_source": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"cell_source": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-cortical-collecting-duct",
"annotation_method": "Aggregation",
"biomarker_type": "gene",
"summary": [
Expand Down Expand Up @@ -9756,7 +9756,7 @@
},
{
"@type": "CellSummary",
"cell_source": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"cell_source": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-ascending-thin-loop-of-henle",
"annotation_method": "Aggregation",
"biomarker_type": "gene",
"summary": [
Expand Down Expand Up @@ -11266,7 +11266,7 @@
},
{
"@type": "CellSummary",
"cell_source": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"cell_source": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_liver-liver-lobule",
"annotation_method": "Aggregation",
"biomarker_type": "gene",
"summary": [
Expand Down Expand Up @@ -13485,7 +13485,7 @@
},
{
"@type": "CellSummary",
"cell_source": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"cell_source": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_lung-pulmonary-alveolus",
"annotation_method": "Aggregation",
"biomarker_type": "gene",
"summary": [
Expand Down Expand Up @@ -16399,7 +16399,7 @@
},
{
"@type": "CellSummary",
"cell_source": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"cell_source": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_lung-bronchial-submucosal-gland",
"annotation_method": "Aggregation",
"biomarker_type": "gene",
"summary": [
Expand Down
14 changes: 7 additions & 7 deletions apps/ftu-ui/src/assets/TEMP/ftu-datasets.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@type": "FtuIllustration",
"data_sources": [
{
"@id": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"@id": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-nephron",
"@type": "Dataset",
"label": "snRNA-seq of Three Healthy Human Kidney Tissue",
"link": "https://doi.org/10.1038/s41467-021-22368-w",
Expand All @@ -53,7 +53,7 @@
"@type": "FtuIllustration",
"data_sources": [
{
"@id": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"@id": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-renal-corpuscle",
"@type": "Dataset",
"label": "snRNA-seq of Three Healthy Human Kidney Tissue",
"link": "https://doi.org/10.1038/s41467-021-22368-w",
Expand All @@ -76,7 +76,7 @@
"@type": "FtuIllustration",
"data_sources": [
{
"@id": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"@id": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-cortical-collecting-duct",
"@type": "Dataset",
"label": "snRNA-seq of Three Healthy Human Kidney Tissue",
"link": "https://doi.org/10.1038/s41467-021-22368-w",
Expand All @@ -99,7 +99,7 @@
"@type": "FtuIllustration",
"data_sources": [
{
"@id": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"@id": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_kidney-ascending-thin-loop-of-henle",
"@type": "Dataset",
"label": "snRNA-seq of Three Healthy Human Kidney Tissue",
"link": "https://doi.org/10.1038/s41467-021-22368-w",
Expand All @@ -122,7 +122,7 @@
"@type": "FtuIllustration",
"data_sources": [
{
"@id": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"@id": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_lung-bronchial-submucosal-gland",
"@type": "Dataset",
"label": "scRNA Seq of Resected Human Lung Tissue",
"link": "https://doi.org/10.1038/s41591-019-0468-5",
Expand All @@ -149,7 +149,7 @@
"@type": "FtuIllustration",
"data_sources": [
{
"@id": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"@id": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_lung-pulmonary-alveolus",
"@type": "Dataset",
"label": "scRNA Seq of Resected Human Lung Tissue",
"link": "https://doi.org/10.1038/s41591-019-0468-5",
Expand All @@ -176,7 +176,7 @@
"@type": "FtuIllustration",
"data_sources": [
{
"@id": "https://cns-iu.github.io/hra-cell-type-populations-supporting-information/data/enriched_rui_locations.jsonld#36e76662-60b8-4193-8a70-1bfd4f6938d0_D088_Lung",
"@id": "https://doi.org/10.1038/s41467-021-22368-w#CellSummary_liver-liver-lobule",
"@type": "Dataset",
"label": "sc Bulk Transcriptomics of Liver Data",
"link": "https://doi.org/10.1038/s41598-021-98806-y",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
routeText: '7th Release Notes.'
emoji: '🎉'

- type: announcement
announcementCard:
- message: 'Warning: DOI registration in progress. HRA v2.1 DOI URLs will not work until further notice.'

- type: margin
bottom: 3.5rem

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
routeText: '7th Release Notes.'
emoji: '🎉'

- type: announcement
announcementCard:
- message: 'Warning: DOI registration in progress. HRA v2.1 DOI URLs will not work until further notice.'

- type: margin
bottom: 3.5rem

Expand Down
4 changes: 0 additions & 4 deletions apps/humanatlas.io/src/assets/content/pages/asctb-tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
routeText: '7th Release Notes.'
emoji: '🎉'

- type: announcement
announcementCard:
- message: 'Warning: DOI registration in progress. HRA v2.1 DOI URLs will not work until further notice.'

- type: margin
bottom: 3.5rem

Expand Down
11 changes: 6 additions & 5 deletions apps/humanatlas.io/src/assets/content/pages/ccf-ontology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@
pageData:
- heading: Overview
descriptions: |
Using the Common Coordinate Framework (CCF) Ontology v2.0.1<sup>1</sup>, the HRA provides standard terminologies and data structures for describing specimens, biological structures,
and spatial positions of tissue blocks and organs linked to existing ontologies.
The new CCF Ontology v2.0.1 published in the 6th HRA release (Dec 2023) provides vocabulary for HRA plus embedded HRA v1.2 data used in HRA applications and interfaces<sup>2</sup>.
The Common Coordinate Framework (CCF) Ontology<sup>1</sup> provides standard terminologies and data structures for describing specimens, biological structures,
and spatial positions of tissue blocks and organs linked to existing ontologies.
CCF Ontology v3.0 published in the 7th HRA release (June 2024) removes the embedded HRA data and cleanly describes the HRA vocabulary.
The HRA v2.1 (<a href="https://humanatlas.io/release-notes/v2.1" target="_blank">https://humanatlas.io/release-notes/v2.1</a>) uses the CCF Ontology v3.0 vocabulary with HRA-specific classes and instances from HRA-curated
With HRA v2.1 (<a href="https://humanatlas.io/release-notes/v2.1" target="_blank">https://humanatlas.io/release-notes/v2.1</a>, June 2024), CCF Ontology v3.0, the embedded HRA data was removed and the CCF Ontology now cleanly describes the HRA vocabulary.
Concretely, the HRA v2.1 uses the CCF Ontology v3.0 vocabulary with HRA-specific classes and instances from HRA-curated
Digital Objects (DOs) resulting in the HRA (<a href="https://purl.humanatlas.io/collection/hra/v2.1" target="_blank">https://purl.humanatlas.io/collection/hra/v2.1</a>).
Prior to this (HRA v2.0), CCF Ontology v2.3.0 published in the 6th HRA release (Dec 2023) provides vocabulary for HRA plus embedded HRA v2.0 data used in HRA applications and interfaces<sup>2</sup>. The same was true for all HRA versions prior to 2.0.
CCF v3.0 details key vocabulary for six types of HRA-curated DOs (ASCT+B tables, OMAPs, 2D and 3D reference objects,
Cell Type Annotation Crosswalks, vascular geometry, and dataset-graphs). About 10,000 experimental datasets have been linked to the HRA with the
HRA Cell Type Populations graph (hra-pop), which is also part of the HRA KG
Expand Down
4 changes: 0 additions & 4 deletions apps/humanatlas.io/src/assets/content/pages/omap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
routeText: '7th Release Notes.'
emoji: '🎉'

- type: announcement
announcementCard:
- message: 'Warning: DOI registration in progress. HRA v2.1 DOI URLs will not work until further notice.'

- type: margin
bottom: 3.5rem

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
descriptions: |
**New & Revised Digital Objects**
The Human Reference Atlas now includes 65 reference organs with 1,280 anatomical structures.
The Human Reference Atlas now includes 65 3D reference organs with 1,215 3D anatomical structures.
<a href="https://grlc.io/api-git/hubmapconsortium/ccf-grlc/subdir/ccf/#/default/get_as_3d_counts" target="_blank">This SPARQL query</a> returns all anatomical structures with an Uberon ID, i.e., it retrieves the 1,215 anatomical structures plus the 65 organs for a total of 1,280 items.
- 2 new ASCT+B Tables: anatomical systems, palatine tonsil
- 20 revised ASCT+B Tables: allen brain, fallopian tube, blood vasculature, bone marrow, heart, kidney, knee, liver, lung, lymph node, lymph vasculature, main bronchus,
muscular system, pancreas, peripheral nervous system, placenta full term, prostate, skeleton, skin, thymus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
height: 100%;

&.small {
height: fit-content;
min-height: fit-content;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
:host {
display: block;

@media (min-height: 60.75rem) {
.table th {
height: 4.5rem !important;
}
.table th,
.table th div {
height: 6.5rem !important;
}

cdk-virtual-scroll-viewport {
Expand Down Expand Up @@ -104,10 +103,13 @@

.icon-header {
.header-column-text {
transform: rotate(-45deg);
// transform: rotate(-90deg);
writing-mode: vertical-rl;
transform: rotate(180deg);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0.5rem auto;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class BiomarkerTableComponent<T extends DataCell> implements OnInit, OnCh
* @param changes object consisting of change in the Input
*/
ngOnChanges(changes: SimpleChanges): void {
this.checkDisplayedColumns();
this.checkDisplayedColumns('columns' in changes);
if ('data' in changes || 'illustrationIds' in changes) {
this.dataSource.data = this.sortTableData(this.data);
}
Expand All @@ -194,11 +194,11 @@ export class BiomarkerTableComponent<T extends DataCell> implements OnInit, OnCh
/**
* Checks to see if columns should be updated
*/
checkDisplayedColumns(): void {
checkDisplayedColumns(forceUpdate = false): void {
const scrollable = this.vscroll.scrollable;
const size = scrollable.measureViewportSize('horizontal');
const offset = scrollable.measureScrollOffset('start');
let shouldUpdate = false;
let shouldUpdate = forceUpdate;

if (size !== this.horizontalViewportSize) {
this.updateHorizontalViewportSize(size);
Expand Down
73 changes: 1 addition & 72 deletions libs/services/src/lib/ftu-data/ftu-data.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
RAW_CELL_SUMMARIES,
RAW_DATASETS,
RAW_ILLUSTRATIONS_JSONLD,
RawCellSummary,
RawDatasets,
RawIllustrationFile,
RawIllustrationsJsonld,
Expand Down Expand Up @@ -59,11 +58,6 @@ const EMPTY_TISSUE_LIBRARY: TissueLibrary = {
nodes: {},
};

/** Capitalizes the first character */
function capitalize(str: string): string {
return str.slice(0, 1).toUpperCase() + str.slice(1);
}

/** Converts case to title case for organ name */
function titleCase(name: string) {
return name
Expand Down Expand Up @@ -139,10 +133,7 @@ export class FtuDataImplService extends FtuDataService {
@returns An Observable that emits an CellSummary array.
*/
override getCellSummaries(iri: Iri): Observable<CellSummary[]> {
return this.fetchData(iri, 'summaries', RAW_CELL_SUMMARIES).pipe(
map((data) => data?.['@graph']),
map((data) => (data ? this.constructCellSummaries(data) : [])),
);
return this.fetchData(iri, 'summaries', RAW_CELL_SUMMARIES).pipe(map((data) => data?.['@graph'] ?? []));
}

/**
Expand Down Expand Up @@ -289,68 +280,6 @@ export class FtuDataImplService extends FtuDataService {
return results;
}

/**
* constructCellSummaries : Formates Cell Summary after fetching the data
* @param data
* @returns
*/
private constructCellSummaries(data: RawCellSummary['@graph']): CellSummary[] {
type SummaryItem = RawCellSummary['@graph'][number]['summary'][number];
const cellSummaries: CellSummary[] = [];
const defaultBiomarkerLables = ['gene', 'protein', 'lipid'];
const biomarkersPresent = new Set(data.map((summary) => summary.biomarker_type.toLowerCase()));
const expandGenes = (summary: SummaryItem) =>
summary.genes.map((gene) => ({
...summary,
...gene,
}));

data.forEach((summaryGroup) => {
const nestedSummaries = summaryGroup.summary.map(expandGenes);
const summary = nestedSummaries.reduce((acc, items) => acc.concat(items), [] as (typeof nestedSummaries)[number]);

const cells = summary.map((entry) => ({
id: entry.cell_id as Iri,
label: entry.cell_label,
}));

const biomarkers = summary.map((entry) => ({
id: entry.gene_id as Iri,
label: entry.gene_label,
}));

const summaries = summary.map((entry) => ({
cell: entry.cell_id as Iri,
biomarker: entry.gene_id as Iri,
count: entry.count,
percentage: entry.percentage,
meanExpression: entry.mean_expression,
}));

cellSummaries.push({
label: `${capitalize(summaryGroup.biomarker_type)} Biomarkers`,
cellSource: summaryGroup.cell_source,
cells,
biomarkers,
summaries,
});
});

defaultBiomarkerLables.forEach((defaultLabel) => {
if (!biomarkersPresent.has(defaultLabel)) {
cellSummaries.push({
label: `${capitalize(defaultLabel)} Biomarkers`,
cellSource: '',
cells: [],
biomarkers: [],
summaries: [],
});
}
});

return cellSummaries;
}

/**
* Constructs tissue library ,forming parent and child nodes
* @param items
Expand Down
20 changes: 1 addition & 19 deletions libs/services/src/lib/ftu-data/ftu-data.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,25 +324,7 @@ const sourceReferences: SourceReference[] = [
/**
* Dummy data extract om Mock Data of tissue mock
*/
const CELL_SUMMARY_DATA: CellSummary[] = Object.values(MOCK_SUMMARIES).map((summary) => ({
label: summary.label,
cellSource: summary.cellSource,
cells: summary.entries.map((entry) => ({
id: entry.cell.id as Iri,
label: entry.cell.label,
})),
biomarkers: summary.entries.map((entry) => ({
id: entry.biomarker.id as Iri,
label: entry.biomarker.label,
})),
summaries: summary.entries.map((entry) => ({
cell: entry.cell.id as Iri,
biomarker: entry.biomarker.id as Iri,
count: entry.count,
percentage: entry.percentage,
meanExpression: entry.meanExpression,
})),
}));
const CELL_SUMMARY_DATA: CellSummary[] = [];

/**
This class represents a mock implementation of the FtuDataService class.
Expand Down
Loading

0 comments on commit 163ccb1

Please sign in to comment.