Example #1
0
def test_fastq_context_manager():
	filename = "tests/data/simple.fastq"
	with open(filename) as f:
		assert not f.closed
		reads = list(seqio.open(f))
		assert not f.closed
	assert f.closed

	with seqio.FastqReader(filename) as sr:
		tmp_sr = sr
		assert not sr.fp.closed
		reads = list(sr)
		assert not sr.fp.closed
	assert tmp_sr.fp is None
Example #2
0
def test_fastq_incomplete():
    fastq = StringIO("@name\nACGT+\n")
    with seqio.FastqReader(fastq) as fq:
        list(fq)
Example #3
0
def test_fastq_wrongformat():
    with seqio.FastqReader("tests/data/withplus.fastq") as f:
        reads = list(f)
Example #4
0
def test_fastqreader_dos():
    with seqio.FastqReader("tests/data/dos.fastq") as f:
        dos_reads = list(f)
    with seqio.FastqReader("tests/data/small.fastq") as f:
        unix_reads = list(f)
    assert dos_reads == unix_reads
Example #5
0
def test_fastqreader():
    with seqio.FastqReader("tests/data/simple.fastq") as f:
        reads = list(f)
    assert reads == simple_fastq