Skip to content

Commit

Permalink
Use dataaset_type and remove data_types and assay_type
Browse files Browse the repository at this point in the history
  • Loading branch information
bherr2 committed Jan 8, 2024
1 parent 2742039 commit 332cbcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const INCLUDED_DATA_FIELDS = [
'descendants.uuid',
'descendants.hubmap_id',
'descendants.sennet_id',
'descendants.data_types',
'descendants.ingest_metadata.metadata.assay_type',
'descendants.dataset_type',
'descendants.thumbnail_file',
'descendants.metadata.files.rel_path',
'rui_location', 'sample_category'
Expand Down
15 changes: 6 additions & 9 deletions projects/ccf-database/src/lib/xconsortia/xconsortia-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,24 +241,21 @@ export class HuBMAPTissueBlock {
const groupName = GROUP_UUID_MAPPING[dataset.group_uuid as string] || dataset.group_name as string;
const creator = dataset.created_by_user_displayname;

const types = [
...dataset.data_types as string[],
get(dataset, ['ingest_metadata', 'metadata', 'assay_type'], '')
];
const typesSearch = types.join('|').toLowerCase();
const types = (dataset.dataset_type ?? '') as string;
const typesSearch = types.toLowerCase();

let technology: string;
let thumbnail = 'assets/icons/ico-unknown.svg';
if (typesSearch.indexOf('10x') !== -1) {
technology = '10x';
thumbnail = 'assets/icons/ico-bulk-10x.svg';
} else if (typesSearch.indexOf('af') !== -1) {
} else if (typesSearch.indexOf('af') !== -1 || typesSearch.indexOf('auto-fluorescence') !== -1) {
technology = 'AF';
thumbnail = 'assets/icons/ico-spatial-af.svg';
} else if (typesSearch.indexOf('codex') !== -1) {
technology = 'CODEX';
thumbnail = 'assets/icons/ico-spatial-codex.svg';
} else if (typesSearch.indexOf('imc') !== -1) {
} else if (typesSearch.indexOf('imc') !== -1 || typesSearch.indexOf('imaging mass cytometry') !== -1) {
technology = 'IMC';
thumbnail = 'assets/icons/ico-spatial-imc.svg';
} else if ((typesSearch.indexOf('lc') !== -1) && (typesSearch.indexOf('af') === -1)) {
Expand All @@ -269,15 +266,15 @@ export class HuBMAPTissueBlock {
} else if (typesSearch.indexOf('pas') !== -1) {
technology = 'PAS';
} else {
technology = 'OTHER';
technology = types.split(/ \[/)[0];
}
thumbnail = this.getDatasetThumbnail(dataset, serviceToken) ?? thumbnail;

return {
'@id': this.portal.idPrefix + dataset.uuid,
'@type': 'Dataset',
label: `Registered ${dateEntered}, ${creator}, ${groupName}`,
description: `Data/Assay Types: ${types.join(', ')}`,
description: `Dataset Type: ${types}`,
link: `${this.portal.portal}dataset${this.portal.portalParams}${dataset.uuid}`,
technology,
thumbnail
Expand Down

0 comments on commit 332cbcf

Please sign in to comment.