Skip to content

Commit bfd6ae6

Browse files
committed
fix: do not use asyncio.gather
Using asyncio.gather seemed to cause a race condition where the proper number of reads was not always stored in the correct variable
1 parent d8b77d1 commit bfd6ae6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

main/como/rnaseq_preprocess.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ async def build_from_tab(cls, filepath: Path) -> _STARinformation:
4141
raise ValueError(f"Building STAR information requires a '.tab' file; received: '{filepath}'")
4242

4343
async with aiofiles.open(filepath) as i_stream:
44-
unmapped, multimapping, no_feature, ambiguous = await asyncio.gather(
45-
*[i_stream.readline(), i_stream.readline(), i_stream.readline(), i_stream.readline()]
46-
)
44+
unmapped = await i_stream.readline()
45+
multimapping = await i_stream.readline()
46+
no_feature = await i_stream.readline()
47+
ambiguous = await i_stream.readline()
48+
4749
num_unmapped = [int(i) for i in unmapped.rstrip("\n").split("\t")[1:]]
4850
num_multimapping = [int(i) for i in multimapping.rstrip("\n").split("\t")[1:]]
4951
num_no_feature = [int(i) for i in no_feature.rstrip("\n").split("\t")[1:]]

0 commit comments

Comments
 (0)