Skip to content

Commit

Permalink
feat: add strain to genomes list (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterckx committed Dec 12, 2024
1 parent 1f4f3af commit 4f9dfd6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,19 @@ export const buildScaffoldN50 = (
};
};

/**
* Build props for the strain cell.
* @param genome - Genome entity.
* @returns Props to be used for the cell.
*/
export const buildStrain = (
genome: BRCDataCatalogGenome
): ComponentProps<typeof C.BasicCell> => {
return {
value: genome.strain,
};
};

/**
* Build props for the tags cell.
* @param genome - Genome entity.
Expand Down
2 changes: 2 additions & 0 deletions site-config/brc-analytics/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const BRC_DATA_CATALOG_CATEGORY_KEY = {
SCAFFOLD_COUNT: "scaffoldCount",
SCAFFOLD_L50: "scaffoldL50",
SCAFFOLD_N50: "scaffoldN50",
STRAIN: "strain",
TAGS: "tags",
TAXON: "taxon",
TAXONOMY_ID: "ncbiTaxonomyId",
Expand All @@ -32,6 +33,7 @@ export const BRC_DATA_CATALOG_CATEGORY_LABEL = {
SCAFFOLD_COUNT: "Scaffolds",
SCAFFOLD_L50: "Scaffold L50",
SCAFFOLD_N50: "Scaffold N50",
STRAIN: "Strain",
TAGS: "Tags",
TAXON: "Taxon",
TAXONOMY_ID: "Taxonomy ID",
Expand Down
15 changes: 14 additions & 1 deletion site-config/brc-analytics/local/index/genomeEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const genomeEntityConfig: BRCEntityConfig<BRCDataCatalogGenome> = {
key: BRC_DATA_CATALOG_CATEGORY_KEY.TAXON,
label: BRC_DATA_CATALOG_CATEGORY_LABEL.TAXON,
},
{
key: BRC_DATA_CATALOG_CATEGORY_KEY.STRAIN,
label: BRC_DATA_CATALOG_CATEGORY_LABEL.STRAIN,
},
{
key: BRC_DATA_CATALOG_CATEGORY_KEY.TAXONOMY_ID,
label: BRC_DATA_CATALOG_CATEGORY_LABEL.TAXONOMY_ID,
Expand Down Expand Up @@ -103,7 +107,16 @@ export const genomeEntityConfig: BRCEntityConfig<BRCDataCatalogGenome> = {
} as ComponentConfig<typeof C.BasicCell, BRCDataCatalogGenome>,
header: BRC_DATA_CATALOG_CATEGORY_LABEL.TAXON,
id: BRC_DATA_CATALOG_CATEGORY_KEY.TAXON,
width: { max: "1fr", min: "284px" },
width: { max: "1fr", min: "240px" },
},
{
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildStrain,
} as ComponentConfig<typeof C.BasicCell, BRCDataCatalogGenome>,
header: BRC_DATA_CATALOG_CATEGORY_LABEL.STRAIN,
id: BRC_DATA_CATALOG_CATEGORY_KEY.STRAIN,
width: { max: "0.5fr", min: "180px" },
},
{
componentConfig: {
Expand Down

0 comments on commit 4f9dfd6

Please sign in to comment.