Multiple string profiling now respects grouped queries (for non-WGS)
All checks were successful
automlst.engine/pipeline/head This commit looks good
All checks were successful
automlst.engine/pipeline/head This commit looks good
This commit is contained in:
parent
ddf9cde175
commit
5a03c7e8d8
@ -124,13 +124,17 @@ class RemoteBIGSdbMLSTProfiler(BIGSdbMLSTProfiler):
|
|||||||
|
|
||||||
async def profile_multiple_strings(self, query_named_string_groups: AsyncIterable[Iterable[NamedString]], stop_on_fail: bool = False) -> AsyncGenerator[NamedMLSTProfile, Any]:
|
async def profile_multiple_strings(self, query_named_string_groups: AsyncIterable[Iterable[NamedString]], stop_on_fail: bool = False) -> AsyncGenerator[NamedMLSTProfile, Any]:
|
||||||
async for named_strings in query_named_string_groups:
|
async for named_strings in query_named_string_groups:
|
||||||
|
names: list[str] = list()
|
||||||
|
sequences: list[str] = list()
|
||||||
for named_string in named_strings:
|
for named_string in named_strings:
|
||||||
try:
|
names.append(named_string.name)
|
||||||
yield NamedMLSTProfile(named_string.name, (await self.profile_string([named_string.sequence])))
|
sequences.append(named_string.sequence)
|
||||||
except NoBIGSdbMatchesException as e:
|
try:
|
||||||
if stop_on_fail:
|
yield NamedMLSTProfile("-".join(names), (await self.profile_string(sequences)))
|
||||||
raise e
|
except NoBIGSdbMatchesException as e:
|
||||||
yield NamedMLSTProfile(named_string.name, None)
|
if stop_on_fail:
|
||||||
|
raise e
|
||||||
|
yield NamedMLSTProfile("-".join(names), None)
|
||||||
|
|
||||||
async def close(self):
|
async def close(self):
|
||||||
await self._http_client.close()
|
await self._http_client.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user