Skip to content

Commit

Permalink
feat: use assembly taxonomy ids for organism taxonomy id column (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterckx committed Jan 16, 2025
1 parent 6990ba7 commit 3ca8188
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/apis/catalog/brc-analytics-catalog/common/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface BRCDataCatalogGenome {

export interface BRCDataCatalogOrganism {
assemblyCount: number;
assemblyTaxonomyIds: string[];
genomes: BRCDataCatalogGenome[];
ncbiTaxonomyId: string;
species: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@ export const buildLevel = (
};
};

/**
* Build props for the assembly taxonomy IDs cell.
* @param organism - Organism entity.
* @returns Props to be used for the cell.
*/
export const buildOrganismAssemblyTaxonomyIds = (
organism: BRCDataCatalogOrganism
): ComponentProps<typeof C.NTagCell> => {
return {
label: "taxonomy IDs",
values: organism.assemblyTaxonomyIds,
};
};

/**
* Build props for the taxon cell.
* @param organism - Organism entity.
Expand Down
3 changes: 3 additions & 0 deletions files/build-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ function buildOrganism(
): BRCDataCatalogOrganism {
return {
assemblyCount: (organism?.assemblyCount ?? 0) + 1,
assemblyTaxonomyIds: Array.from(
new Set([...(organism?.assemblyTaxonomyIds ?? []), genome.ncbiTaxonomyId])
),
genomes: [...(organism?.genomes ?? []), genome],
ncbiTaxonomyId: genome.speciesTaxonomyId,
species: genome.species,
Expand Down
65 changes: 65 additions & 0 deletions files/out/organisms.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"10244"
],
"genomes": [
{
"accession": "GCF_000857045.1",
Expand Down Expand Up @@ -35,6 +38,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"83332"
],
"genomes": [
{
"accession": "GCF_000195955.2",
Expand Down Expand Up @@ -69,6 +75,9 @@
},
{
"assemblyCount": 2,
"assemblyTaxonomyIds": [
"443226"
],
"genomes": [
{
"accession": "GCA_000170175.2",
Expand Down Expand Up @@ -124,6 +133,10 @@
},
{
"assemblyCount": 2,
"assemblyTaxonomyIds": [
"235443",
"214684"
],
"genomes": [
{
"accession": "GCA_000149245.3",
Expand Down Expand Up @@ -179,6 +192,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"237561"
],
"genomes": [
{
"accession": "GCF_000182965.3",
Expand Down Expand Up @@ -211,6 +227,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"246410"
],
"genomes": [
{
"accession": "GCF_000149335.2",
Expand Down Expand Up @@ -243,6 +262,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"420245"
],
"genomes": [
{
"accession": "GCF_000002845.2",
Expand Down Expand Up @@ -275,6 +297,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"5661"
],
"genomes": [
{
"accession": "GCF_000227135.1",
Expand Down Expand Up @@ -307,6 +332,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"347515"
],
"genomes": [
{
"accession": "GCF_000002725.2",
Expand Down Expand Up @@ -339,6 +367,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"185431"
],
"genomes": [
{
"accession": "GCF_000002445.2",
Expand Down Expand Up @@ -371,6 +402,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"5693"
],
"genomes": [
{
"accession": "GCF_000209065.1",
Expand Down Expand Up @@ -403,6 +437,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"508771"
],
"genomes": [
{
"accession": "GCF_000006565.2",
Expand Down Expand Up @@ -435,6 +472,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"36329"
],
"genomes": [
{
"accession": "GCF_000002765.6",
Expand Down Expand Up @@ -467,6 +507,9 @@
},
{
"assemblyCount": 2,
"assemblyTaxonomyIds": [
"5855"
],
"genomes": [
{
"accession": "GCA_900093555.2",
Expand Down Expand Up @@ -522,6 +565,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"54757"
],
"genomes": [
{
"accession": "GCF_900681995.1",
Expand Down Expand Up @@ -554,6 +600,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"5861"
],
"genomes": [
{
"accession": "GCF_900002385.2",
Expand Down Expand Up @@ -586,6 +635,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"2697049"
],
"genomes": [
{
"accession": "GCF_009858895.2",
Expand Down Expand Up @@ -620,6 +672,10 @@
},
{
"assemblyCount": 2,
"assemblyTaxonomyIds": [
"180454",
"7165"
],
"genomes": [
{
"accession": "GCF_000005575.2",
Expand Down Expand Up @@ -675,6 +731,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"42434"
],
"genomes": [
{
"accession": "GCF_016801865.2",
Expand Down Expand Up @@ -707,6 +766,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"7176"
],
"genomes": [
{
"accession": "GCF_015732765.1",
Expand Down Expand Up @@ -739,6 +801,9 @@
},
{
"assemblyCount": 1,
"assemblyTaxonomyIds": [
"330879"
],
"genomes": [
{
"accession": "GCF_000002655.1",
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 @@ -3,6 +3,7 @@ export const BRC_DATA_CATALOG_CATEGORY_KEY = {
ANALYZE_GENOME: "analyzeGenome",
ANNOTATION_STATUS: "annotationStatus",
ASSEMBLY_COUNT: "assemblyCount",
ASSEMBLY_TAXONOMY_IDS: "assemblyTaxonomyIds",
CHROMOSOMES: "chromosomes",
COVERAGE: "coverage",
GC_PERCENT: "gcPercent",
Expand All @@ -23,6 +24,7 @@ export const BRC_DATA_CATALOG_CATEGORY_LABEL = {
ANALYZE_GENOME: "Action",
ANNOTATION_STATUS: "Annotation Status",
ASSEMBLY_COUNT: "Assemblies",
ASSEMBLY_TAXONOMY_IDS: "Taxonomy ID",
CHROMOSOMES: "Chromosomes",
COVERAGE: "Coverage",
GC_PERCENT: "GC%",
Expand Down
14 changes: 7 additions & 7 deletions site-config/brc-analytics/local/index/organismEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export const organismEntityConfig: BRCEntityConfig<BRCDataCatalogOrganism> = {
label: BRC_DATA_CATALOG_CATEGORY_LABEL.SPECIES,
},
{
key: BRC_DATA_CATALOG_CATEGORY_KEY.TAXONOMY_ID,
label: BRC_DATA_CATALOG_CATEGORY_LABEL.TAXONOMY_ID,
key: BRC_DATA_CATALOG_CATEGORY_KEY.ASSEMBLY_TAXONOMY_IDS,
label: BRC_DATA_CATALOG_CATEGORY_LABEL.ASSEMBLY_TAXONOMY_IDS,
},
],
},
Expand Down Expand Up @@ -66,11 +66,11 @@ export const organismEntityConfig: BRCEntityConfig<BRCDataCatalogOrganism> = {
},
{
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildTaxonomyId,
} as ComponentConfig<typeof C.BasicCell, BRCDataCatalogOrganism>,
header: BRC_DATA_CATALOG_CATEGORY_LABEL.TAXONOMY_ID,
id: BRC_DATA_CATALOG_CATEGORY_KEY.TAXONOMY_ID,
component: C.NTagCell,
viewBuilder: V.buildOrganismAssemblyTaxonomyIds,
} as ComponentConfig<typeof C.NTagCell, BRCDataCatalogOrganism>,
header: BRC_DATA_CATALOG_CATEGORY_LABEL.ASSEMBLY_TAXONOMY_IDS,
id: BRC_DATA_CATALOG_CATEGORY_KEY.ASSEMBLY_TAXONOMY_IDS,
width: { max: "0.5fr", min: "164px" },
},
{
Expand Down

0 comments on commit 3ca8188

Please sign in to comment.