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

resolve rapid species home #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

resolve rapid species home #10

wants to merge 2 commits into from

Conversation

jyobhai
Copy link
Contributor

@jyobhai jyobhai commented Dec 9, 2024

This PR is to resolve rapid species home urls.

https://rapid.ensembl.org/Homo_sapiens_GCA_009914755.4/
https://rapid.ensembl.org/Homo_sapiens_GCA_009914755.4/Info/Index
Also it would redirect rapid home page to beta home - something to decide whether to do it or not.

Uses new grpc endpoint in web-metadata-api Ensembl/ensembl-web-metadata-api#63

https://www.ebi.ac.uk/panda/jira/browse/ENSWBSITES-2830

# Resolve species home
# https://rapid.ensembl.org/Homo_sapiens_GCA_009914755.4/
# https://rapid.ensembl.org/Homo_sapiens_GCA_009914755.4/Info/Index
@router.get("/{species_url}/{subpath:path}", name="Rapid Species Home")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't species_url properly referred to as species_url_name?

async def resolve_species(request: Request, species_url: str, subpath: str):
(species_name, accession_id) = species_url.split("_GCA_")
assembly_accession_id = "GCA_" + accession_id
genome_object = get_genome_id_from_accession(assembly_accession_id)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_genome_id_from_accession from_assembly_accession_id?

genome_object = get_genome_id_from_accession(assembly_accession_id)
if genome_object:
genome_id = genome_object.get("genomeUuid")
url = f"{ENSEMBL_URL}/species/{genome_id}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we get genome tag from the metadata api, by the way?

I suppose none of the species on rapid will have a genome tag; but still, what if?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants