diff --git a/next/@types/network.ts b/next/@types/network.ts index 1f3ee4383..3e814acc7 100644 --- a/next/@types/network.ts +++ b/next/@types/network.ts @@ -16,6 +16,7 @@ export interface Contact { */ export enum ANALYSIS_PORTAL { CZ_CELLXGENE = "CZ_CELLXGENE", + UCSC_CELL_BROWSER = "CELL_BROWSER", } export interface AnalysisPortal { @@ -34,8 +35,10 @@ export interface Publication { export interface Atlas { code?: Pick[]; + componentAtlases?: IntegratedAtlas[]; // "external" integrated atlases. contact: Contact; coordinators: Coordinator[]; + cxgDataPortal?: Pick[]; cxgId: string; datasets: Dataset[]; externalDatasets: ProjectsResponse[]; @@ -56,7 +59,7 @@ export interface AtlasesRow extends AtlasRow { summaryCellCount?: number; } -export type AtlasRow = Omit; +export type AtlasRow = Omit; export interface CXGAssay { label: string; @@ -99,7 +102,7 @@ export interface CXGTissue { } export type IntegratedAtlasRow = AtlasRow & - Pick; + Pick; export interface DatasetAsset { downloadURL: string; @@ -110,10 +113,9 @@ export interface DatasetAsset { export type DatasetQueryOrgan = string; export interface IntegratedAtlas { + analysisPortals: AnalysisPortal[]; assay: string[]; cellCount: number; - cxgId: string; - cxgURL: string; datasetAssets: DatasetAsset[]; disease: string[]; name: string; @@ -149,7 +151,7 @@ export interface NetworkContext { export interface AtlasModule { Description: ElementType; - Inclusion: ElementType; + Inclusion?: ElementType; } export interface NetworkModule { @@ -177,7 +179,11 @@ export type NetworkKey = | "reproduction" | "skin"; -export type AtlasKey = "brain-v1-0" | "cortex-v1-0" | "lung-v1-0"; +export type AtlasKey = + | "brain-v1-0" + | "cortex-v1-0" + | "lung-v1-0" + | "retina-v1-0"; export interface BICCNPublication { authors: string[]; diff --git a/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/components/AnalysisPortalCell/analysisPortalCell.tsx b/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/components/AnalysisPortalCell/analysisPortalCell.tsx new file mode 100644 index 000000000..98050c474 --- /dev/null +++ b/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/components/AnalysisPortalCell/analysisPortalCell.tsx @@ -0,0 +1,19 @@ +import { Fragment } from "react"; +import { AnalysisPortal } from "../../../../../../../../../../@types/network"; +import { IconLink } from "../../../../../../../../../common/IconLink/iconLink"; + +interface AnalysisPortalCellProps { + analysisPortals: AnalysisPortal[]; +} + +export const AnalysisPortalCell = ({ + analysisPortals, +}: AnalysisPortalCellProps): JSX.Element => { + return ( + + {analysisPortals.map((analysisPortal, i) => ( + + ))} + + ); +}; diff --git a/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/mainColumn.tsx b/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/mainColumn.tsx index 7519cfc20..038877f29 100644 --- a/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/mainColumn.tsx +++ b/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/mainColumn.tsx @@ -20,7 +20,7 @@ import { Table, Toolbar } from "../../../../../../../common/Table/table.styles"; import { SectionText } from "../../../../../../components/Section/section.styles"; export const MainColumn = (): JSX.Element => { - const { Description } = useAtlasContent(); + const { Description } = useAtlasContent() || {}; const { atlas } = useAtlas(); const { integratedAtlases } = atlas; return ( @@ -31,7 +31,11 @@ export const MainColumn = (): JSX.Element => { - + {Description ? ( + + ) : ( + "No atlas description available." + )} @@ -47,7 +51,7 @@ export const MainColumn = (): JSX.Element => { {integratedAtlases.length > 0 ? ( ) : ( diff --git a/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/SideColumn/sideColumn.tsx b/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/SideColumn/sideColumn.tsx index cec69c123..68cb04d79 100644 --- a/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/SideColumn/sideColumn.tsx +++ b/next/components/HCABioNetworks/Network/Atlas/components/Overview/components/SideColumn/sideColumn.tsx @@ -13,6 +13,7 @@ export const SideColumn = (): JSX.Element => { code, contact: atlasContact, coordinators: atlasCoordinators, + cxgDataPortal, publications, } = atlas; const { contact: networkContact, coordinators: networkCoordinators } = @@ -26,6 +27,10 @@ export const SideColumn = (): JSX.Element => { {/* Code */} {code && } + {/* CELLxGENE Collection */} + {cxgDataPortal && ( + + )} {/* Atlas Coordinators */} []; @@ -14,7 +14,7 @@ export interface ReferencesProps { export const References = ({ links, title }: ReferencesProps): JSX.Element => { return ( - +
{links.length > 0 @@ -23,6 +23,6 @@ export const References = ({ links, title }: ReferencesProps): JSX.Element => { )) : "None"} - +
); }; diff --git a/next/components/common/Table/components/Cell/components/CXGDownloadCell/cxgDownloadCell.tsx b/next/components/common/Table/components/Cell/components/CXGDownloadCell/cxgDownloadCell.tsx index 49306afe8..e471b0a14 100644 --- a/next/components/common/Table/components/Cell/components/CXGDownloadCell/cxgDownloadCell.tsx +++ b/next/components/common/Table/components/Cell/components/CXGDownloadCell/cxgDownloadCell.tsx @@ -16,13 +16,15 @@ export const CXGDownloadCell = ({ const [open, setOpen] = useState(false); return ( <> - setOpen(true)} - size="medium" - /> + {datasetAssets.length > 0 && ( + setOpen(true)} + size="medium" + /> + )} setOpen(false)} diff --git a/next/components/index.tsx b/next/components/index.tsx index ed9409e92..64e2a7ae6 100644 --- a/next/components/index.tsx +++ b/next/components/index.tsx @@ -27,4 +27,5 @@ export { IconLink } from "./common/IconLink/iconLink"; export { PinnedNTagCell } from "./common/NTagCell/components/PinnedNTagCell/pinnedNTagCell"; export { BioNetworkCell } from "./common/Table/components/Cell/components/BioNetworkCell/bioNetworkCell"; export { CXGDownloadCell } from "./common/Table/components/Cell/components/CXGDownloadCell/cxgDownloadCell"; +export { AnalysisPortalCell } from "./HCABioNetworks/Network/Atlas/components/Overview/components/MainColumn/components/AnalysisPortalCell/analysisPortalCell"; export { Content } from "./Layout/components/Content/content"; diff --git a/next/constants/analysisPortals.ts b/next/constants/analysisPortals.ts index 6f83223ab..3b0eaf38b 100644 --- a/next/constants/analysisPortals.ts +++ b/next/constants/analysisPortals.ts @@ -8,3 +8,12 @@ export const CZ_CELLXGENE: Omit = { label: "CZ CELLxGENE", name: ANALYSIS_PORTAL.CZ_CELLXGENE, }; + +/** + * UCSC Cell Browser analysis portal. + */ +export const UCSC_CELL_BROWSER: Omit = { + icon: "/hca-bio-networks/network/atlas/icons/ucsc-cell.svg", + label: "UCSC Cell Browser", + name: ANALYSIS_PORTAL.UCSC_CELL_BROWSER, +}; diff --git a/next/constants/componentAtlases.ts b/next/constants/componentAtlases.ts new file mode 100644 index 000000000..f0997b1a6 --- /dev/null +++ b/next/constants/componentAtlases.ts @@ -0,0 +1,42 @@ +import { IntegratedAtlasRow } from "../@types/network"; +import { buildAtlas } from "../utils/atlases"; +import { UCSC_CELL_BROWSER } from "./analysisPortals"; + +const NORMAL = "normal"; +const TODO = "TODO"; + +export const COMPONENT_ATLASES: Record = { + adipose: [], + breast: [], + development: [], + "eye-retina": [ + buildAtlas( + [ + { + url: "https://cells.ucsc.edu/?ds=retina+hrca+atac", + ...UCSC_CELL_BROWSER, + }, + ], + ["10x ATAC"], + 354776, + [NORMAL], + "snATAC-seq of human retina", + [TODO], + [TODO] + ), + ], + "genetic-diversity": [], + gut: [], + heart: [], + immune: [], + kidney: [], + liver: [], + lung: [], + musculoskeletal: [], + "nervous-system": [], + oral: [], + organoid: [], + pancreas: [], + reproduction: [], + skin: [], +}; diff --git a/next/constants/datasets.ts b/next/constants/datasets.ts index e0534f3de..c8ca4ec81 100644 --- a/next/constants/datasets.ts +++ b/next/constants/datasets.ts @@ -1,10 +1,46 @@ import { buildDataset } from "../utils/datasets"; +const NORMAL = "normal"; +const TODO = "--"; + export const DATASETS = { adipose: [], breast: [], development: [], - eye: [], + "eye-retina": [ + // Chen (2023) Research Square. + buildDataset( + [TODO], + 2999939, + [TODO], + ["10x Genomics Single Cell 3' v3"], + [TODO], + "Integrated multi-omics single cell atlas of the human retina", + { + doi: "10.21203/rs.3.rs-3471275/v1", + officialHcaPublication: null, + publicationTitle: + "Integrated multi-omics single cell atlas of the human retina", + publicationUrl: "https://www.researchsquare.com/article/rs-3471275/v1", + } + ), + // Hahn (2023) Nature. + buildDataset( + [TODO], + 0, + [TODO], + [TODO], + [TODO], + "Evolution of neuronal cell classes and types in the vertebrate retina", + { + doi: "10.1038/s41586-023-06638-9", + officialHcaPublication: null, + publicationTitle: + "Evolution of neuronal cell classes and types in the vertebrate retina", + publicationUrl: "https://www.nature.com/articles/s41586-023-06638-9", + } + ), + ], "genetic-diversity": [], gut: [], heart: [], @@ -14,11 +50,11 @@ export const DATASETS = { lung: [ // Study name: Jain_Misharin_2021. buildDataset( - ["Normal"], + [NORMAL], 45557, - ["TODO"], + [TODO], ["10X 5' v1", "v2"], - ["TODO"], + [TODO], "Expansion of profibrotic monocyte-derived alveolar macrophages in patients with persistent respiratory symptoms and radiographic abnormalities after COVID-19", { doi: "10.1101/2023.07.30.551145", @@ -33,36 +69,36 @@ export const DATASETS = { buildDataset( ["IPF"], 100211, - ["TODO"], + [TODO], ["10X 3' v3"], - ["TODO"], + [TODO], "Barbry_unpubl" ), // Study name:Duong_lungMAP_unpubl. buildDataset( - ["Normal"], + [NORMAL], 53904, - ["TODO"], + [TODO], ["10X 3' v3"], - ["TODO"], + [TODO], "Duong_lungMAP_unpubl" ), // Study name: Schiller_2021. buildDataset( ["Cancer (non-cancerous tissue used for samples)"], 35984, - ["TODO"], + [TODO], ["10X 3' v3"], - ["TODO"], + [TODO], "Schiller_2021" ), // Study name: Schultze_unpubl. buildDataset( ["Cancer (non-cancerous tissue used for samples)"], 8016, - ["TODO"], + [TODO], ["Seq-Well"], - ["TODO"], + [TODO], "Schultze_unpubl" ), ], diff --git a/next/constants/networks.ts b/next/constants/networks.ts index 7155fcc50..147828e97 100644 --- a/next/constants/networks.ts +++ b/next/constants/networks.ts @@ -9,6 +9,7 @@ import * as adiposeContent from "../content/adipose"; import * as breastContent from "../content/breast"; import * as developmentContent from "../content/development"; import * as eyeContent from "../content/eye"; +import * as eyeNetworkRetinaAtlas from "../content/eye/atlases/retina"; import * as geneticDiversityContent from "../content/genetic-diversity"; import * as gutContent from "../content/gut"; import * as heartContent from "../content/heart"; @@ -16,19 +17,25 @@ import * as immuneContent from "../content/immune"; import * as kidneyContent from "../content/kidney"; import * as liverContent from "../content/liver"; import * as lungContent from "../content/lung"; -import * as atlasLung from "../content/lung/atlases/lung"; +import * as lungNetworkLungAtlas from "../content/lung/atlases/lung"; import * as musculoskeletalContent from "../content/musculoskeletal"; import * as nervousSystemContent from "../content/nervous-system"; -import * as altasBrain from "../content/nervous-system/atlases/brain"; -import * as atlasCortex from "../content/nervous-system/atlases/cortex"; +import * as nervousSystemNetworkBrainAtlas from "../content/nervous-system/atlases/brain"; +import * as nervousSystemNetworkCortexAtlas from "../content/nervous-system/atlases/cortex"; import * as oralContent from "../content/oral"; import * as organoidContent from "../content/organoid"; import * as pancreasContent from "../content/pancreas"; import * as reproductionContent from "../content/reproduction"; import * as skinContent from "../content/skin"; import BICCN_PUBLICATIONS from "./biccn-publications.json"; +import { COMPONENT_ATLASES } from "./componentAtlases"; import { DATASETS } from "./datasets"; +const BRAIN_V1_0 = "brain-v1-0"; +const CORTEX_V1_0 = "cortex-v1-0"; +const LUNG_V1_0 = "lung-v1-0"; +const RETINA_V1_0 = "retina-v1-0"; + export const NETWORKS: Network[] = [ { atlases: [], @@ -76,7 +83,45 @@ export const NETWORKS: Network[] = [ path: "development", }, { - atlases: [], + atlases: [ + { + code: [ + { + label: "https://github.com/RCHENLAB/HRCA_reproducibility", + url: "https://github.com/RCHENLAB/HRCA_reproducibility", + }, + ], + componentAtlases: COMPONENT_ATLASES["eye-retina"], + contact: { email: "eye@humancellatlas.org" }, + coordinators: [{ fullName: "Rui Chen" }], + cxgId: "4c6eaf5c-6d57-4c76-b1e9-60df8c655f1e", + datasets: [ + "2079bb2e-676e-4bbf-8c68-f9c6459edcbb", // DeAngelis, ..., Chen. + "aebc99a3-3151-482a-9709-da6802617763", // Thomas, ...,Cherry. + "9c20a245-f2c0-43ae-82c9-2232ec6b594f", // Liang, ..., Chen. + "1dddae6e-3753-48af-b20e-fa22abad125d", // Cowan, ..., Roska. + "e090445c-6971-4212-bc5f-ae4ec3914102", // Orozco, ..., Hackney. + "30dc3964-1135-4b56-b393-ce2dcbc6e379", // Yan, ..., Sanes. + "8185730f-4113-40d3-9cc3-929271784c2b", // Lukowski, ..., Wong. + "07d5987e-7f9e-4f34-b0fb-a185a35504f5", // Menon, ..., Hafler. + "4bec484d-ca7a-47b4-8d48-8830e06ad6db", // Voigt, ..., Scheetz. + ], + externalDatasets: DATASETS["eye-retina"], + integratedAtlases: [], + key: RETINA_V1_0, + name: "Single-cell atlas of the human retina v1.0", + path: RETINA_V1_0, + publications: [ + { + doi: "https://doi.org/10.1101/2023.11.07.566105", + label: "Li et al. (2023) bioRxiv", + }, + ], + summaryCellCount: 3548094, + updatedAt: "", + version: "v1", + }, + ], contact: { email: "eye@humancellatlas.org" }, coordinators: [{ fullName: "Rui Chen" }, { fullName: "Ayellet Segrè" }], datasetQueryOrgans: ["eye", "left eye", "retina", "right eye"], @@ -270,9 +315,9 @@ export const NETWORKS: Network[] = [ ], externalDatasets: DATASETS.lung, integratedAtlases: [], - key: "lung-v1-0", + key: LUNG_V1_0, name: "The integrated Human Lung Cell Atlas (HLCA) v1.0", - path: "lung-v1-0", + path: LUNG_V1_0, publications: [ { doi: "https://doi.org/10.1038/s41591-023-02327-2", @@ -353,9 +398,9 @@ export const NETWORKS: Network[] = [ datasets: [], externalDatasets: [], integratedAtlases: [], - key: "brain-v1-0", + key: BRAIN_V1_0, name: "Human Brain Cell Atlas v1.0", - path: "brain-v1-0", + path: BRAIN_V1_0, publications: [ { doi: "https://doi.org/10.1126/science.add7046", @@ -381,9 +426,9 @@ export const NETWORKS: Network[] = [ datasets: [], externalDatasets: [], integratedAtlases: [], - key: "cortex-v1-0", + key: CORTEX_V1_0, name: "Human Cortical Cell Atlas v1.0", - path: "cortex-v1-0", + path: CORTEX_V1_0, publications: [ { doi: "https://doi.org/10.1126/science.adf6812", @@ -566,8 +611,15 @@ export const NETWORK_ICONS: { [key in NetworkKey]: string } = { skin: "/hca-bio-networks/icons/skin.png", }; -export const ATLAS_CONTENT: { [key in AtlasKey]: AtlasModule } = { - "brain-v1-0": altasBrain, - "cortex-v1-0": atlasCortex, - "lung-v1-0": atlasLung, +export const NETWORK_ATLAS_CONTENT: Partial< + Record +> = { + eye: { [RETINA_V1_0]: eyeNetworkRetinaAtlas }, + lung: { + [LUNG_V1_0]: lungNetworkLungAtlas, + }, + "nervous-system": { + [BRAIN_V1_0]: nervousSystemNetworkBrainAtlas, + [CORTEX_V1_0]: nervousSystemNetworkCortexAtlas, + }, }; diff --git a/next/content/eye/atlases/retina/index.ts b/next/content/eye/atlases/retina/index.ts new file mode 100644 index 000000000..bd5d094a6 --- /dev/null +++ b/next/content/eye/atlases/retina/index.ts @@ -0,0 +1,4 @@ +import Description from "./v1.0/description.mdx"; +import Inclusion from "./v1.0/inclusion.mdx"; + +export { Description, Inclusion }; diff --git a/next/content/eye/atlases/retina/v1.0/description.mdx b/next/content/eye/atlases/retina/v1.0/description.mdx new file mode 100644 index 000000000..78827a04d --- /dev/null +++ b/next/content/eye/atlases/retina/v1.0/description.mdx @@ -0,0 +1,12 @@ +### Highlights + +1. Two parallel references were derived from single cell and single nuclei RNA-seq, respectively. +1. Over 120 cell types in the human retina are identified, nearly doubling the number reported in previous studies. +1. Integrative atlas with RNA and ATAC-seq, generating comprehensive gene regulatory landscape at single-cell resolution for the human retina. + +### Overview + +As the light-sensing part of the visual system, the human retina is composed of five classes of neurons, including photoreceptors, horizontal cells, amacrine, bipolar, and retinal ganglion cells. +Each class of neuron can be further classified into subclasses, with the abundance varying three orders of magnitude. +Therefore, to capture all cell types in the retina and generate a complete single-cell reference atlas by combining previously published and newly generated datasets, a single-cell atlas of the human retina that is composed of 3.4 million single nuclei or cells from 122 donors has been collected. +As a result, over 120 distinct cell types are identified based on the transcriptomics profile, with the rarest cell type accounting for about 0.01% of the cell population. In addition, open chromatin profiling has been collected for over 470K nuclei via single nuclei ATAC-seq, allowing systematic characterization of cis-regulatory elements for individual cell types. Both sn/scRNA-seq and snATAC-seq datasets are made accessible through interactive browsers. This represents the most comprehensive reference cell atlas of the human retina to date, laying the foundation for further research in understanding retina biology and diseases. diff --git a/next/content/eye/atlases/retina/v1.0/inclusion.mdx b/next/content/eye/atlases/retina/v1.0/inclusion.mdx new file mode 100644 index 000000000..4c27d2fd7 --- /dev/null +++ b/next/content/eye/atlases/retina/v1.0/inclusion.mdx @@ -0,0 +1 @@ +Inclusion TDB diff --git a/next/contexts/atlasContext.ts b/next/contexts/atlasContext.ts index 45831f0ea..305efd94c 100644 --- a/next/contexts/atlasContext.ts +++ b/next/contexts/atlasContext.ts @@ -1,4 +1,4 @@ -import { ATLAS_CONTENT, NETWORKS } from "constants/networks"; +import { NETWORKS, NETWORK_ATLAS_CONTENT } from "constants/networks"; import { createContext, useContext } from "react"; import { AtlasContext as AtlasContextType, @@ -21,10 +21,10 @@ export const useAtlas = (): AtlasContextType => { return useContext(AtlasContext); }; -export const useAtlasContent = (): AtlasModule => { +export const useAtlasContent = (): AtlasModule | undefined => { const { atlas: { key }, + network: { key: networkKey }, } = useAtlas(); - - return ATLAS_CONTENT[key]; + return NETWORK_ATLAS_CONTENT[networkKey]?.[key]; }; diff --git a/next/public/hca-bio-networks/network/atlas/icons/ucsc-cell.svg b/next/public/hca-bio-networks/network/atlas/icons/ucsc-cell.svg new file mode 100644 index 000000000..dd42eb2a8 --- /dev/null +++ b/next/public/hca-bio-networks/network/atlas/icons/ucsc-cell.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/next/utils/atlases.ts b/next/utils/atlases.ts new file mode 100644 index 000000000..b91ba0b60 --- /dev/null +++ b/next/utils/atlases.ts @@ -0,0 +1,44 @@ +import { AnalysisPortal, IntegratedAtlas } from "../@types/network"; + +const initAtlas: IntegratedAtlas = { + analysisPortals: [], + assay: [], + cellCount: 0, + datasetAssets: [], + disease: [], + name: "", + organism: [], + tissue: [], +}; + +/** + * Returns "external" integrated atlas. + * @param analysisPortals - Analysis portals. + * @param assay - Assay (i.e. library construction method). + * @param cellCount - Cell count. + * @param disease - Disease. + * @param name - Name. + * @param organism - Organism. + * @param tissue - Tissue. + * @returns integrated atlas. + */ +export function buildAtlas( + analysisPortals: AnalysisPortal[], + assay: string[], + cellCount: number, + disease: string[], + name: string, + organism: string[], + tissue: string[] +): IntegratedAtlas { + return { + ...initAtlas, + analysisPortals, + assay, + cellCount, + disease, + name, + organism, + tissue, + }; +} diff --git a/next/utils/network.ts b/next/utils/network.ts index 462896b83..4473172ab 100644 --- a/next/utils/network.ts +++ b/next/utils/network.ts @@ -1,4 +1,6 @@ +import { LinkProps } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link"; import { + AnalysisPortal, Atlas, CXGDataset, CXGDatasetAsset, @@ -9,6 +11,35 @@ import { } from "../@types/network"; import { processNullElements } from "../apis/azul/hca-dcp/common/utils"; import { config } from "../config/config"; +import { CZ_CELLXGENE } from "../constants/analysisPortals"; + +const CZ_CELLXGENE_DATA_PORTAL_URL = "https://cellxgene.cziscience.com"; + +/** + * Builds the CELLxGENE analysis portal for the given CELLxGENE URL. + * @param cxgURL - CELLxGENE URL. + * @returns CELLxGENE analysis portal. + */ +function buildCXGAnalysisPortal(cxgURL: string): AnalysisPortal { + return { url: cxgURL, ...CZ_CELLXGENE }; +} + +/** + * Builds the CELLxGENE data portal link for the given CELLxGENE dataset ID. + * @param cxgId - CELLxGENE dataset ID. + * @returns CELLxGENE data portal link. + */ +function buildCXGDataPortalLink( + cxgId: string +): Pick[] { + const cxgDataPortalURL = `${CZ_CELLXGENE_DATA_PORTAL_URL}/collections/${cxgId}`; + return [ + { + label: cxgDataPortalURL, + url: cxgDataPortalURL, + }, + ]; +} /** * Returns the H5AD and RDS dataset assets for the given CELLxGENE dataset assets. @@ -100,7 +131,11 @@ function filterCXGDatasetAsset(cxgDatasetAsset: CXGDatasetAsset): boolean { */ export function processAtlas(atlas: Atlas, cxgDatasets: CXGDataset[]): Atlas { const integratedAtlases = cxgDatasets.map(mapIntegratedAtlas); - return { ...atlas, integratedAtlases }; + if (atlas.componentAtlases) { + integratedAtlases.push(...atlas.componentAtlases); + } + const cxgDataPortal = buildCXGDataPortalLink(atlas.cxgId); + return { ...atlas, cxgDataPortal, integratedAtlases }; } /** @@ -117,6 +152,9 @@ export function processNetwork( const integratedAtlases = cxgDatasets .filter((dataset) => filterCXGDataset(dataset, atlas.cxgId)) .map(mapIntegratedAtlas); + if (atlas.componentAtlases) { + integratedAtlases.push(...atlas.componentAtlases); + } return { ...atlas, integratedAtlases }; }); const datasetURL = buildDatasetURL(network); @@ -130,10 +168,9 @@ export function processNetwork( */ export function mapIntegratedAtlas(cxgDataset: CXGDataset): IntegratedAtlas { return { + analysisPortals: [buildCXGAnalysisPortal(cxgDataset.explorer_url)], assay: processArrayValue(cxgDataset.assay, "label"), cellCount: cxgDataset.cell_count, - cxgId: cxgDataset.collection_id, - cxgURL: cxgDataset.explorer_url, datasetAssets: buildDatasetAssets(cxgDataset.assets), disease: processArrayValue(cxgDataset.disease, "label"), name: cxgDataset.title, diff --git a/next/viewModelBuilders/viewModelBuilders.ts b/next/viewModelBuilders/viewModelBuilders.ts index 54262d595..94039c4f4 100644 --- a/next/viewModelBuilders/viewModelBuilders.ts +++ b/next/viewModelBuilders/viewModelBuilders.ts @@ -22,7 +22,6 @@ import { } from "../apis/azul/hca-dcp/common/utils"; import * as C from "../components"; import { MetadataValueTuple } from "../components/common/NTagCell/components/PinnedNTagCell/pinnedNTagCell"; -import { CZ_CELLXGENE } from "../constants/analysisPortals"; import { NETWORKS_ROUTE } from "../constants/routes"; import { formatCountSize } from "../utils/formatCountSize"; import { DISEASE } from "./entities"; @@ -173,7 +172,7 @@ function getAtlasesExploreColumnDef< return { accessorKey: "explore", cell: ({ row }) => - C.IconLink({ height: 20, url: row.original.cxgURL, ...CZ_CELLXGENE }), + C.AnalysisPortalCell({ analysisPortals: row.original.analysisPortals }), header: "Explore", }; } @@ -503,6 +502,7 @@ function getSpecimenOrganColumnDef(): ColumnDef { */ function initAtlasRow(): AtlasesRow { return { + analysisPortals: [], assay: [], atlasName: "", cellCount: 0,