Back to index

python-biopython  1.60
Public Member Functions
test_SeqIO_QualityIO.TestQual Class Reference

List of all members.

Public Member Functions

def test_paired
def test_qual
def test_qual_out
def test_fasta
def test_fasta_out
def test_qual_negative

Detailed Description

Tests with QUAL files.

Definition at line 314 of file test_SeqIO_QualityIO.py.


Member Function Documentation

Check FASTQ parsing matches FASTA parsing

Definition at line 338 of file test_SeqIO_QualityIO.py.

00338 
00339     def test_fasta(self):
00340         """Check FASTQ parsing matches FASTA parsing"""
00341         records1 = list(SeqIO.parse(open("Quality/example.fasta"),"fasta"))
00342         records2 = list(SeqIO.parse(open("Quality/example.fastq"),"fastq"))
00343         self.assertTrue(compare_records(records1, records2))

Here is the call graph for this function:

Check FASTQ to FASTA output

Definition at line 344 of file test_SeqIO_QualityIO.py.

00344 
00345     def test_fasta_out(self):
00346         """Check FASTQ to FASTA output"""
00347         records = SeqIO.parse(open("Quality/example.fastq"),"fastq")
00348         h = StringIO("")
00349         SeqIO.write(records, h, "fasta")
00350         self.assertEqual(h.getvalue(),open("Quality/example.fasta").read())

Here is the call graph for this function:

Check FASTQ parsing matches FASTA+QUAL parsing

Definition at line 316 of file test_SeqIO_QualityIO.py.

00316 
00317     def test_paired(self):
00318         """Check FASTQ parsing matches FASTA+QUAL parsing"""
00319         records1 = list(\
00320             QualityIO.PairedFastaQualIterator(open("Quality/example.fasta"),
00321                                               open("Quality/example.qual")))
00322         records2 = list(SeqIO.parse(open("Quality/example.fastq"),"fastq"))
00323         self.assertTrue(compare_records(records1, records2))

Here is the call graph for this function:

Check FASTQ parsing matches QUAL parsing

Definition at line 324 of file test_SeqIO_QualityIO.py.

00324 
00325     def test_qual(self):
00326         """Check FASTQ parsing matches QUAL parsing"""
00327         records1 = list(SeqIO.parse(open("Quality/example.qual"),"qual"))
00328         records2 = list(SeqIO.parse(open("Quality/example.fastq"),"fastq"))
00329         #Will ignore the unknown sequences :)
00330         self.assertTrue(compare_records(records1, records2))

Here is the call graph for this function:

Check QUAL negative scores mapped to PHRED zero

Definition at line 351 of file test_SeqIO_QualityIO.py.

00351 
00352     def test_qual_negative(self):
00353         """Check QUAL negative scores mapped to PHRED zero"""
00354         data = """>1117_10_107_F3
00355 23 31 -1 -1 -1 29 -1 -1 20 32 -1 18 25 7 -1 6 -1 -1 -1 30 -1 20 13 7 -1 -1 21 30 -1 24 -1 22 -1 -1 22 14 -1 12 26 21 -1 5 -1 -1 -1 20 -1 -1 12 28 
00356 >1117_10_146_F3
00357 20 33 -1 -1 -1 29 -1 -1 28 28 -1 7 16 5 -1 30 -1 -1 -1 14 -1 4 13 4 -1 -1 11 13 -1 5 -1 7 -1 -1 10 16 -1 4 12 15 -1 8 -1 -1 -1 16 -1 -1 10 4 
00358 >1117_10_1017_F3
00359 33 33 -1 -1 -1 27 -1 -1 17 16 -1 28 24 11 -1 6 -1 -1 -1 29 -1 8 29 24 -1 -1 8 8 -1 20 -1 13 -1 -1 8 13 -1 28 10 24 -1 10 -1 -1 -1 4 -1 -1 7 6 
00360 >1117_11_136_F3
00361 16 22 -1 -1 -1 33 -1 -1 30 27 -1 27 28 32 -1 29 -1 -1 -1 27 -1 18 9 6 -1 -1 23 16 -1 26 -1 5 7 -1 22 7 -1 18 14 8 -1 8 -1 -1 -1 11 -1 -1 4 24"""
00362         h = StringIO(data)
00363         h2 = StringIO()
00364         self.assertEqual(4, SeqIO.convert(h, "qual", h2, "fastq"))
00365         self.assertEqual(h2.getvalue(), """@1117_10_107_F3
00366 ??????????????????????????????????????????????????
00367 +
00368 8@!!!>!!5A!3:(!'!!!?!5.(!!6?!9!7!!7/!-;6!&!!!5!!-=
00369 @1117_10_146_F3
00370 ??????????????????????????????????????????????????
00371 +
00372 5B!!!>!!==!(1&!?!!!/!%.%!!,.!&!(!!+1!%-0!)!!!1!!+%
00373 @1117_10_1017_F3
00374 ??????????????????????????????????????????????????
00375 +
00376 BB!!!<!!21!=9,!'!!!>!)>9!!))!5!.!!).!=+9!+!!!%!!('
00377 @1117_11_136_F3
00378 ??????????????????????????????????????????????????
00379 +
00380 17!!!B!!?<!<=A!>!!!<!3*'!!81!;!&(!7(!3/)!)!!!,!!%9
00381 """)
00382 
00383 

Check FASTQ to QUAL output

Definition at line 331 of file test_SeqIO_QualityIO.py.

00331 
00332     def test_qual_out(self):
00333         """Check FASTQ to QUAL output"""
00334         records = SeqIO.parse(open("Quality/example.fastq"),"fastq")
00335         h = StringIO("")
00336         SeqIO.write(records, h, "qual")
00337         self.assertEqual(h.getvalue(),open("Quality/example.qual").read())

Here is the call graph for this function:


The documentation for this class was generated from the following file: