Skip to content
Open
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
3 changes: 2 additions & 1 deletion app/blast/blast.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class JobIDs(BaseModel):


def get_db_path(genome_id: str, db_type: str) -> str:
return f"ensembl/{genome_id}/{suffix_map.get(db_type, db_type)}"
genome_id_prefix = genome_id[:3]
return f"ensembl/{genome_id_prefix}/{genome_id}/{suffix_map.get(db_type, db_type)}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this something that the tools api has to work out on its own, or something that it should ask metadata about?



# Submit a BLAST job to JD. Returns a resolvable for fetching the response.
Expand Down
5 changes: 3 additions & 2 deletions app/tests/test_blast.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ def blast_payload():
# Test BLAST database path inference
def test_get_db_path(blast_payload):
genome_id = blast_payload["genome_ids"][0]
genome_id_prefix = genome_id[:3]
filename = get_db_path(genome_id, "dna_sm")
assert filename == f"ensembl/{genome_id}/softmasked"
assert filename == f"ensembl/{genome_id_prefix}/{genome_id}/softmasked"
filename = get_db_path(genome_id, "pep")
assert filename.endswith("pep")
assert filename == f"ensembl/{genome_id_prefix}/{genome_id}/pep"


# Test single BLAST job submission with a valid payload
Expand Down