Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename genome list and update to use data from ncbi (#177) #178

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 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,30 @@ 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;
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const SectionHero = (): JSX.Element => {
annotations and functional insights into disease-causing
organisms and their carriers
</Subhead>
<Button {...BUTTON_PROPS} href={ROUTES.ORGANISMS}>
<Button {...BUTTON_PROPS} href={ROUTES.GENOMES}>
Get started
</Button>
</SubHeadline>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Home/content/sectionSubHero.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BRC Analytics is your new destination for analysis of biological
data related to pathogens. Building on the foundation of VEuPathDb
the platform will provide access and analysis capabilities for
[785 eukaryotic pathogens](/data/organisms), hosts, and vectors. The functionality will
[785 eukaryotic pathogens](/data/genomes), hosts, and vectors. The functionality will
be developed and made available incrementally over the [following months](/roadmap).
6 changes: 6 additions & 0 deletions app/components/common/StyledLink/styledLink.styles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Link } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link";
import styled from "@emotion/styled";

export const StyledLink = styled(Link)`
text-decoration: underline;
`;
2 changes: 2 additions & 0 deletions app/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export {
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 { StyledLink } from "./common/StyledLink/styledLink.styles";
export { AnalysisMethod } from "./Entity/components/AnalysisMethod/analysisMethod";
export { AnalysisMethods } from "./Entity/components/AnalysisMethods/analysisMethods";
export { AnalysisMethodsTitle } from "./Entity/components/AnalysisMethodsTitle/analysisMethodsTitle";
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
Loading