Completed NCBI lookup, FASTA reading, ABIF reading, and Institut Pasteur querying

This commit is contained in:
2025-01-03 16:41:51 +00:00
parent b834aa93b0
commit 362e0867e5
22 changed files with 339 additions and 56 deletions

View File

@@ -0,0 +1,16 @@
from Bio import SeqIO
from mlstmyfasta.engine.data.MLST import Allele
from mlstmyfasta.engine.remote.databases.institutpasteur.profiling import InstitutPasteurProfiler
async def test_profiling_results_in_exact_matches_when_exact():
sequence = str(SeqIO.read("tests/resources/tohama_I_bpertussis.fasta", "fasta").seq)
async with InstitutPasteurProfiler(database_name="pubmlst_bordetella_seqdef") as dummy_profiler:
exact_matches = dummy_profiler.fetch_mlst_profile(sequence_string=sequence)
targets_left = {"adk", "fumC", "glyA", "tyrB", "icd", "pepA", "pgm"}
async for exact_match in exact_matches:
assert isinstance(exact_match, Allele)
assert exact_match.allele_variant == '1' # All of Tohama I has allele id I
targets_left.remove(exact_match.allele_loci)
assert len(targets_left) == 0

View File

@@ -0,0 +1,5 @@
from mlstmyfasta.engine.remote.databases.ncbi.genbank import fetch_ncbi_genbank
async def test_fetch_ncbi_genbank_with_id_works():
assert len((await fetch_ncbi_genbank("CP011448.1")).sequence) > 0