From 9669edcecfe9829f1eea6ec4cce4f24c95fcd83f Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Wed, 12 Sep 2018 16:54:32 +0200 Subject: [PATCH 1/4] Adding support for NextSeq --- README.md | 4 +++- checkQC/run_type_recognizer.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index abb4601..a0145c4 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,12 @@ Instrument types supported in checkQC are the following: - HiSeq2500 - MiSeq - NovaSeq + - ISeq + - NextSeq Install instructions -------------------- -CheckQC **requires Python 3.5** (or higher to run). CheckQC can be installed with pip. +CheckQC **requires Python 3.5 or Python3.6**. CheckQC can be installed with pip. ``` pip install checkqc diff --git a/checkQC/run_type_recognizer.py b/checkQC/run_type_recognizer.py index 81a4e3f..fc04a33 100644 --- a/checkQC/run_type_recognizer.py +++ b/checkQC/run_type_recognizer.py @@ -56,6 +56,15 @@ def reagent_version(runtype_recognizer): """ raise NotImplementedError +class NextSeq(IlluminaInstrument): + @staticmethod + def name(): + return "nextseq" + + @staticmethod + def reagent_version(runtype_recognizer): + return "v1" + class ISeq(IlluminaInstrument): @staticmethod @@ -176,7 +185,8 @@ def instrument_type(self): "D": "hiseq2500", "ST": "hiseqx", "A": "novaseq", - "FFSP": "iseq"} + "FFSP": "iseq", + "ns": "nextseq"} for key, value in machine_type_mappings.items(): if instrument_name.startswith(key): From 3d06dac5ae900fcf68fc87c0fb9e1722d7d9c7e7 Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Wed, 12 Sep 2018 16:56:29 +0200 Subject: [PATCH 2/4] Capitalize instrument ID --- checkQC/run_type_recognizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkQC/run_type_recognizer.py b/checkQC/run_type_recognizer.py index fc04a33..c893c66 100644 --- a/checkQC/run_type_recognizer.py +++ b/checkQC/run_type_recognizer.py @@ -186,7 +186,7 @@ def instrument_type(self): "ST": "hiseqx", "A": "novaseq", "FFSP": "iseq", - "ns": "nextseq"} + "NS": "nextseq"} for key, value in machine_type_mappings.items(): if instrument_name.startswith(key): From 25d64a4485f1502962c2b9945a6729619329191d Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Thu, 13 Sep 2018 10:22:22 +0200 Subject: [PATCH 3/4] Add basic tests for nextseq --- tests/test_run_type_recognizer.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_run_type_recognizer.py b/tests/test_run_type_recognizer.py index a190c2f..846c822 100644 --- a/tests/test_run_type_recognizer.py +++ b/tests/test_run_type_recognizer.py @@ -4,7 +4,7 @@ import os from checkQC.exceptions import RunModeUnknown, ReagentVersionUnknown -from checkQC.run_type_recognizer import RunTypeRecognizer, HiSeq2500, MiSeq, NovaSeq, ISeq +from checkQC.run_type_recognizer import RunTypeRecognizer, HiSeq2500, MiSeq, NovaSeq, ISeq, NextSeq from checkQC.runfolder_reader import RunfolderReader @@ -48,6 +48,11 @@ def test_returns_iseq(self): actual = runtyperecognizer.instrument_type() self.assertTrue(isinstance(actual, ISeq)) + def test_returns_nextseq(self): + runtyperecognizer = self._create_runtype_recognizer("NS500559") + actual = runtyperecognizer.instrument_type() + self.assertTrue(isinstance(actual, NextSeq)) + class TestIlluminaInstrument(TestCase): @@ -60,6 +65,7 @@ def setUp(self): self.miseq = MiSeq() self.novaseq = NovaSeq() self.iseq = ISeq() + self.nextseq = NextSeq() def test_all_is_well(self): runtype_dict = {"RunParameters": {"Setup": {"RunMode": "RapidHighOutput", "Sbs": "HiSeq SBS Kit v4"}}} @@ -117,3 +123,7 @@ def test_novaseq_reagent_version_raises(self): with self.assertRaises(ReagentVersionUnknown): self.novaseq.reagent_version(mock_runtype_recognizer) + + def test_nextseq(self): + self.assertEqual(self.nextseq.name(), "nextseq") + self.assertEqual(self.nextseq.reagent_version(self.MockRunTypeRecognizer(None)), "v1") From aef068c33507d29625eb24ba04175c325d0071bf Mon Sep 17 00:00:00 2001 From: Johan Dahlberg Date: Thu, 13 Sep 2018 10:23:12 +0200 Subject: [PATCH 4/4] WIP: QC config for NextSeq --- checkQC/default_config/config.yaml | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/checkQC/default_config/config.yaml b/checkQC/default_config/config.yaml index 424b842..a4430b6 100644 --- a/checkQC/default_config/config.yaml +++ b/checkQC/default_config/config.yaml @@ -316,7 +316,7 @@ miseq_v3: error: 9 # 50 % of threshold for clusters pass filter iseq_v1: - 300: + 301: handlers: - name: ClusterPFHandler warning: 4 # Millons of clusters @@ -331,3 +331,38 @@ iseq_v1: - name: ReadsPerSampleHandler warning: unknown error: 2 # 50 % of threshold for clusters pass filter + +# TODO The nextseq really has a high and a mid-output mode. +# This needs to be supported here later. +# /JD 2018-09-13 +nextseq_v1: + 76: + handlers: + - name: ClusterPFHandler + warning: 400 # Millons of clusters + error: unknown + - name: Q30Handler + warning: 80 # Give percentage for reads greater than Q30 + error: unknown # Give percentage for reads greater than Q30 + - name: ErrorRateHandler + allow_missing_error_rate: False + warning: 1.5 + error: unknown + - name: ReadsPerSampleHandler + warning: unknown + error: 200 # 50 % of threshold for clusters pass filter + 151: + handlers: + - name: ClusterPFHandler + warning: 400 # Millons of clusters + error: unknown + - name: Q30Handler + warning: 75 # Give percentage for reads greater than Q30 + error: unknown # Give percentage for reads greater than Q30 + - name: ErrorRateHandler + allow_missing_error_rate: False + warning: 1.5 + error: unknown + - name: ReadsPerSampleHandler + warning: unknown + error: 200 # 50 % of threshold for clusters pass filter