Skip to content

Commit

Permalink
feat: build data from ncbi and add organisms with assembly lists (#208)…
Browse files Browse the repository at this point in the history
… (#209)


Co-authored-by: Danielle Callan <[email protected]>
  • Loading branch information
hunterckx and d-callan authored Jan 16, 2025
1 parent f4bdff4 commit 0947c6d
Show file tree
Hide file tree
Showing 26 changed files with 1,913 additions and 9,958 deletions.
34 changes: 24 additions & 10 deletions app/apis/catalog/brc-analytics-catalog/common/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,31 @@ export enum ANALYSIS_METHOD {
export type BRCCatalog = BRCDataCatalogGenome;

export interface BRCDataCatalogGenome {
chromosomes: number;
contigs: number;
geneModelUrl: string;
genomeVersionAssemblyId: string;
accession: string;
annotationStatus: string | null;
chromosomes: number | null;
coverage: string | null;
gcPercent: number;
geneModelUrl: string | null;
isRef: string;
length: number;
level: string;
ncbiTaxonomyId: string;
organism: string;
species: string;
strain: string;
supercontigs: number;
ucscBrowserUrl: string;
vEuPathDBProject: string;
scaffoldCount: number;
scaffoldL50: number;
scaffoldN50: number;
strain: string | null;
tags: string[];
taxon: string;
ucscBrowserUrl: string | null;
}

export interface BRCDataCatalogOrganism {
assemblyCount: number;
genomes: BRCDataCatalogGenome[];
ncbiTaxonomyId: string;
tags: string[];
taxon: string;
}

export interface EntitiesResponse<R> {
Expand Down
10 changes: 7 additions & 3 deletions app/apis/catalog/brc-analytics-catalog/common/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { BRCDataCatalogGenome } from "./entities";
import { BRCDataCatalogGenome, BRCDataCatalogOrganism } from "./entities";

export function getGenomeId(genome: BRCDataCatalogGenome): string {
return sanitizeEntityId(genome.genomeVersionAssemblyId);
return sanitizeEntityId(genome.accession);
}

export function getGenomeTitle(genome?: BRCDataCatalogGenome): string {
if (!genome) return "";
return `${genome.species} - ${genome.strain}`;
return `${genome.taxon}`;
}

export function getOrganismId(organism: BRCDataCatalogOrganism): string {
return sanitizeEntityId(organism.ncbiTaxonomyId);
}

export function sanitizeEntityId(entityId?: string): string {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Entity/components/AnalysisMethod/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { ANALYSIS_METHOD } from "../../../../apis/catalog/brc-analytics-catalog/
export interface Props {
analysisMethod: ANALYSIS_METHOD;
content: ReactNode;
geneModelUrl: string;
geneModelUrl: string | null;
genomeVersionAssemblyId: string;
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { SubTitle } from "@databiosphere/findable-ui/lib/components/Layout/compo
import { TEXT_HEADING } from "@databiosphere/findable-ui/lib/theme/common/typography";
import { HeroTitle as Typography } from "@databiosphere/findable-ui/src/components/common/Title/title.styles";
import { ReactNode } from "react";
import { BackButton } from "./components/BackButton/backButton";
import {
DetailViewHeroHeadline,
DetailViewHero as DetailViewHeroLayout,
Expand All @@ -29,7 +28,6 @@ export const DetailViewHero = ({
<DetailViewHeroLayout>
{(breadcrumbs || title) && (
<DetailViewHeroHeadline>
<BackButton />
<HeroHeader>
{breadcrumbs}
<HeroTitle>
Expand Down
2 changes: 2 additions & 0 deletions app/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export {
BackPageContentSideColumn,
BackPageContentSingleColumn,
} from "@databiosphere/findable-ui/lib/components/Layout/components/BackPage/backPageView.styles";
export { DetailViewTable } from "@databiosphere/findable-ui/lib/components/Detail/components/DetailViewTable/detailViewTable";
export { Logo } from "@databiosphere/findable-ui/lib/components/Layout/components/Header/components/Content/components/Logo/logo";
export { Link } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link";
export { BasicCell } from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell";
export { NTagCell } from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/NTagCell/nTagCell";
export { CopyText } from "./common/CopyText/copyText";
export { AnalysisMethod } from "./Entity/components/AnalysisMethod/analysisMethod";
export { AnalysisMethods } from "./Entity/components/AnalysisMethods/analysisMethods";
Expand Down
4 changes: 2 additions & 2 deletions app/utils/galaxy-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const WORKFLOW_LANDING_URL_PREFIX =
export async function getWorkflowLandingUrl(
workflowId: WORKFLOW_ID,
referenceGenome: string,
geneModelUrl: string
geneModelUrl: string | null
): Promise<string> {
const body: WorkflowLandingsBody = {
public: true,
Expand Down Expand Up @@ -74,7 +74,7 @@ function buildFastaUrl(identifier: string): string {
function getWorkflowLandingsRequestState(
workflowId: WORKFLOW_ID,
referenceGenome: string,
geneModelUrl: string
geneModelUrl: string | null
): WorkflowLandingsBodyRequestState {
if (workflowId === WORKFLOW_ID.VARIANT_CALLING && geneModelUrl) {
return {
Expand Down
Loading

0 comments on commit 0947c6d

Please sign in to comment.