Sniff fastqsanger more aggressively (#8322)

Sniff fastqsanger more aggressively
This commit is contained in:
Nicola Soranzo
2019-07-12 10:03:21 +01:00
committed by GitHub
2 changed files with 13 additions and 2 deletions
+5 -2
View File
@@ -694,13 +694,16 @@ class BaseFastq(Sequence):
>>> fname = get_test_fname('1.fastqsanger')
>>> FastqSanger().sniff(fname)
True
>>> fname = get_test_fname('4.fastqsanger')
>>> FastqSanger().sniff(fname)
True
>>> fname = get_test_fname('3.fastq')
>>> FastqSanger().sniff(fname)
False
>>> Fastq().sniff(fname)
True
>>> fname = get_test_fname('2.fastq')
>>> Fastq().sniff( fname )
>>> Fastq().sniff(fname)
True
>>> FastqSanger().sniff(fname)
False
@@ -819,7 +822,7 @@ class FastqSanger(Fastq):
def quality_check(lines):
"""Presuming lines are lines from a fastq file, return True if the qualities are compatible with sanger encoding"""
for line in islice(lines, 3, None, 4):
if not all(_ >= '!' and _ <= 'M' for _ in line[0]) or ' ' in line:
if not all(_ >= '!' and _ <= 'S' for _ in line[0]):
return False
return True
+8
View File
@@ -0,0 +1,8 @@
@DCW97JN1:309:C0C42ACXX:4:2206:12976:57510/1
AAATGGGCATAATATAGATGTAGAGATGTGTTGAATTTATGACTCATTT
+
ADECJJJJDCCECCCCMCCNCCMCNBCLBJBCLADCDC=CNDJILEDDD
@DCW97JN1:309:C0C42ACXX:4:2211:6915:3569/1
AAAGAAATTAAATGGGCATAATATAGATGTAGAGATGTGTTGAATTTAT
+
@DEJAAA?B@ECCEFFGDBBFC8ABGCBK=BI=66@HE@@JACCCDCCI