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: link species name to ncbi taxon page (#82) #110

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@ -4,6 +4,7 @@ export interface BRCDataCatalogGenome {
chromosomes: number;
contigs: number;
genomeVersionAssemblyId: string;
ncbiTaxonomyId: string;
organism: string;
species: string;
strain: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ export const buildGenomeDetails = (
genome: BRCDataCatalogGenome
): ComponentProps<typeof C.KeyValuePairs> => {
const keyValuePairs = new Map<Key, Value>();
keyValuePairs.set("Species", genome.species);
keyValuePairs.set(
"Species",
C.Link({
label: genome.species,
url: `https://www.ncbi.nlm.nih.gov/datasets/taxonomy/${encodeURIComponent(
genome.ncbiTaxonomyId
)}/`,
})
);
keyValuePairs.set("Strain", genome.strain);
keyValuePairs.set("Assembly Version ID", genome.genomeVersionAssemblyId);
keyValuePairs.set("VeUPathDB Project", genome.vEuPathDbProject);
Expand Down Expand Up @@ -173,9 +181,12 @@ export const buildOrganismListHero = (): ComponentProps<
*/
export const buildSpecies = (
genome: BRCDataCatalogGenome
): ComponentProps<typeof C.BasicCell> => {
): ComponentProps<typeof C.Link> => {
return {
value: genome.species,
label: genome.species,
url: `https://www.ncbi.nlm.nih.gov/datasets/taxonomy/${encodeURIComponent(
genome.ncbiTaxonomyId
)}/`,
};
};

Expand Down
1 change: 1 addition & 0 deletions files/build-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function buildGenomes(): Promise<BRCDataCatalogGenome[]> {
chromosomes: parseNumber(row.Chromosomes),
contigs: parseNumber(row.Contigs),
genomeVersionAssemblyId: row["Genome Version/Assembly ID"],
ncbiTaxonomyId: row.taxId,
organism: row.Organism,
species: row.Species,
strain: row.Strain,
Expand Down
2 changes: 2 additions & 0 deletions files/build-genomes-files.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def build_genomes_files():
if (len(unmatched_assemblies) != 0):
print(f"Omitted {len(unmatched_assemblies)} assemblies that had no matches: {", ".join(unmatched_assemblies)}")

result_df["taxId"] = result_df["taxId"].astype(int)

result_df.to_csv(OUTPUT_PATH, index=False, sep="\t")

print(f"Wrote to {OUTPUT_PATH}")
Expand Down
Loading
Loading