From a046a45ccae5291a79b339277a59315306b5ff99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20H=C3=BCbner?= Date: Fri, 7 Feb 2025 16:27:28 +0100 Subject: [PATCH 1/2] Replace algorithm to determine the colour chemistry It was simplified to when the instrument is not a known Illumina sequencer with two-dye chemistry, a colour chemistry of four dyes is assumed. --- amdirt/core/__init__.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/amdirt/core/__init__.py b/amdirt/core/__init__.py index 634bbc9..616e263 100644 --- a/amdirt/core/__init__.py +++ b/amdirt/core/__init__.py @@ -103,24 +103,29 @@ def check_allowed_values(ref: list, test: str): def get_colour_chemistry(instrument: str) -> int: """ - Get number of colours used in sequencing chemistry + Get number of colours used in sequencing chemistry. If the instrument is + not a known Illumina sequencer with two-dye chemistry, a colour chemistry + of four dyes is assumed. + Args: instrument(str): Name of the instrument Returns: int: number of colours used in sequencing chemistry """ - chemistry_colours = { - "bgiseq": 4, - "miseq": 4, - "hiseq": 4, - "genome analyzer": 4, - "nextseq": 2, - "novaseq": 2, - } - - for k in chemistry_colours: - if k in instrument.lower(): - return chemistry_colours[k] + instruments_2dye = [ + "Illumina MiniSeq", + "Illumina NovaSeq 6000", + "Illumina NovaSeq X", + "Illumina iSeq 100", + "NextSeq 1000", + "NextSeq 2000", + "NextSeq 500", + "NextSeq 550", + ] + if instrument in instruments_2dye: + return 2 + else: + return 4 def doi2bib(doi: str) -> str: From c47d7da52df3a4390b84dcb5626771087cb7c136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20H=C3=BCbner?= Date: Sun, 9 Feb 2025 14:06:41 +0100 Subject: [PATCH 2/2] Update colour chemistry test --- tests/test_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 942f3cf..232cfe3 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -7,8 +7,8 @@ def test_get_colour_chemistry(): - assert get_colour_chemistry("hiseq") == 4 - assert get_colour_chemistry("novaseq") == 2 + assert get_colour_chemistry("Illumina HiSeq 2500") == 4 + assert get_colour_chemistry("Illumina NovaSeq 6000") == 2 def test_doi2bib():