Skip to content

Commit

Permalink
FIX tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eboileau committed Jul 12, 2024
1 parent 917caf4 commit 895bfdd
Show file tree
Hide file tree
Showing 10 changed files with 823 additions and 955 deletions.
14 changes: 7 additions & 7 deletions server/src/scimodom/services/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def liftover(
unmapped_lines = self._file_service.count_lines(unmapped_file)
if unmapped_lines / raw_lines > threshold:
raise LiftOverError(
f"Liftover failed: {unmapped_lines} records of {raw_lines} could not be mapped."
f"Liftover failed: {unmapped_lines} records out of {raw_lines} could not be mapped."
)
if unmapped_lines > 0:
logger.warning(
Expand Down Expand Up @@ -234,7 +234,7 @@ def add_assembly(self, taxa_id: int, assembly_name: str) -> int:

if self._file_service.check_if_assembly_exists(taxa_id, assembly_name):
raise FileExistsError(
f"Directory exists, but assembly '{assembly_name}' does not exists!"
f"Directory exists, but assembly '{assembly_name}' does not exist!"
)

chain_file_name = self._get_chain_file_name(
Expand Down Expand Up @@ -277,8 +277,8 @@ def prepare_assembly_for_version(self, assembly_id: int) -> None:
assembly = self.get_assembly_by_id(assembly_id)
if not self.is_latest_assembly(assembly):
raise AssemblyVersionError(
f"Mismatch between assembly version {assembly.version} and "
f"database version {self._version}."
f"Mismatch between assembly version '{assembly.version}' and "
f"database version '{self._version}'."
)

logger.info(f"Setting up assembly {assembly.name} for current version...")
Expand All @@ -303,19 +303,19 @@ def _get_ensembl_chain_file_url(self, taxa_id: int, chain_file_name):
return urljoin(
ENSEMBL_FTP,
ENSEMBL_ASM_MAPPING,
self._get_organism_for_ensemble_url(taxa_id),
self._get_organism_for_ensembl_url(taxa_id),
chain_file_name,
)

def _get_organism_for_ensemble_url(self, taxa_id: int):
def _get_organism_for_ensembl_url(self, taxa_id: int):
organism = self._get_organism(taxa_id)
return ("_".join(organism.split())).lower()

def _get_ensembl_gene_build_url(self, taxa_id: int):
return urljoin(
ENSEMBL_SERVER,
ENSEMBL_ASM,
self._get_organism_for_ensemble_url(taxa_id),
self._get_organism_for_ensembl_url(taxa_id),
)

def _get_organism(self, taxa_id: int) -> str:
Expand Down
Loading

0 comments on commit 895bfdd

Please # to comment.