Skip to content

Commit

Permalink
Merge pull request #167 from SPAAM-community/colour_chemistry
Browse files Browse the repository at this point in the history
Replace algorithm to determine the colour chemistry
  • Loading branch information
alexhbnr authored Feb 9, 2025
2 parents 37e3c75 + c47d7da commit 6694a9d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
31 changes: 18 additions & 13 deletions amdirt/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 6694a9d

Please sign in to comment.