Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adding support for NextSeq #69

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 36 additions & 1 deletion checkQC/default_config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
12 changes: 11 additions & 1 deletion checkQC/run_type_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
12 changes: 11 additions & 1 deletion tests/test_run_type_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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):

Expand All @@ -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"}}}
Expand Down Expand Up @@ -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")