Skip to content

Commit 5347243

Browse files
authored
feat: link species name to ncbi taxon page (#82) (#110)
* feat: link species name to ncbi taxon page (#82) * fix: uri-encode taxonomy id in ncbi url (#82)
1 parent c4cfe8f commit 5347243

File tree

7 files changed

+1673
-734
lines changed

7 files changed

+1673
-734
lines changed

app/apis/catalog/brc-analytics-catalog/common/entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export interface BRCDataCatalogGenome {
44
chromosomes: number;
55
contigs: number;
66
genomeVersionAssemblyId: string;
7+
ncbiTaxonomyId: string;
78
organism: string;
89
species: string;
910
strain: string;

app/viewModelBuilders/catalog/brc-analytics-catalog/common/viewModelBuilders.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,15 @@ export const buildGenomeDetails = (
124124
genome: BRCDataCatalogGenome
125125
): ComponentProps<typeof C.KeyValuePairs> => {
126126
const keyValuePairs = new Map<Key, Value>();
127-
keyValuePairs.set("Species", genome.species);
127+
keyValuePairs.set(
128+
"Species",
129+
C.Link({
130+
label: genome.species,
131+
url: `https://www.ncbi.nlm.nih.gov/datasets/taxonomy/${encodeURIComponent(
132+
genome.ncbiTaxonomyId
133+
)}/`,
134+
})
135+
);
128136
keyValuePairs.set("Strain", genome.strain);
129137
keyValuePairs.set("Assembly Version ID", genome.genomeVersionAssemblyId);
130138
keyValuePairs.set("VeUPathDB Project", genome.vEuPathDbProject);
@@ -173,9 +181,12 @@ export const buildOrganismListHero = (): ComponentProps<
173181
*/
174182
export const buildSpecies = (
175183
genome: BRCDataCatalogGenome
176-
): ComponentProps<typeof C.BasicCell> => {
184+
): ComponentProps<typeof C.Link> => {
177185
return {
178-
value: genome.species,
186+
label: genome.species,
187+
url: `https://www.ncbi.nlm.nih.gov/datasets/taxonomy/${encodeURIComponent(
188+
genome.ncbiTaxonomyId
189+
)}/`,
179190
};
180191
};
181192

files/build-catalog.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ async function buildGenomes(): Promise<BRCDataCatalogGenome[]> {
2323
chromosomes: parseNumber(row.Chromosomes),
2424
contigs: parseNumber(row.Contigs),
2525
genomeVersionAssemblyId: row["Genome Version/Assembly ID"],
26+
ncbiTaxonomyId: row.taxId,
2627
organism: row.Organism,
2728
species: row.Species,
2829
strain: row.Strain,

files/build-genomes-files.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def build_genomes_files():
3434
if (len(unmatched_assemblies) != 0):
3535
print(f"Omitted {len(unmatched_assemblies)} assemblies that had no matches: {", ".join(unmatched_assemblies)}")
3636

37+
result_df["taxId"] = result_df["taxId"].astype(int)
38+
3739
result_df.to_csv(OUTPUT_PATH, index=False, sep="\t")
3840

3941
print(f"Wrote to {OUTPUT_PATH}")

0 commit comments

Comments
 (0)