Skip to content

Commit

Permalink
Replace algorithm to determine the colour chemistry
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexhbnr committed Feb 7, 2025
1 parent f5f8a4f commit a046a45
Showing 1 changed file with 18 additions and 13 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

0 comments on commit a046a45

Please sign in to comment.