Back to index

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

List of all members.

Public Member Functions

def check_fails
def check_general_fails
def check_general_passes
def check_all_fail
def check_qual_char

Detailed Description

Test reject invalid FASTQ files.

Definition at line 130 of file test_SeqIO_QualityIO.py.


Member Function Documentation

def test_SeqIO_QualityIO.TestFastqErrors.check_all_fail (   self,
  filename,
  count 
)

Definition at line 164 of file test_SeqIO_QualityIO.py.

00164 
00165     def check_all_fail(self, filename, count):
00166         self.check_fails(filename, count)
00167         self.check_general_fails(filename, count)

Here is the call graph for this function:

def test_SeqIO_QualityIO.TestFastqErrors.check_fails (   self,
  filename,
  good_count,
  formats = None,
  raw = True 
)

Definition at line 132 of file test_SeqIO_QualityIO.py.

00132 
00133     def check_fails(self, filename, good_count, formats=None, raw=True):
00134         if not formats:
00135             formats = ["fastq-sanger", "fastq-solexa", "fastq-illumina"]
00136         for format in formats:
00137             handle = open(filename, "rU")
00138             records = SeqIO.parse(handle, format)
00139             for i in range(good_count):
00140                 record = records.next() #Make sure no errors!
00141                 self.assertTrue(isinstance(record, SeqRecord))
00142             self.assertRaises(ValueError, records.next)
00143             handle.close()

Here is the call graph for this function:

Here is the caller graph for this function:

def test_SeqIO_QualityIO.TestFastqErrors.check_general_fails (   self,
  filename,
  good_count 
)

Definition at line 144 of file test_SeqIO_QualityIO.py.

00144 
00145     def check_general_fails(self, filename, good_count):
00146         handle = open(filename, "rU")
00147         tuples = QualityIO.FastqGeneralIterator(handle)
00148         for i in range(good_count):
00149             title, seq, qual = tuples.next() #Make sure no errors!
00150         self.assertRaises(ValueError, tuples.next)
00151         handle.close()

Here is the call graph for this function:

Here is the caller graph for this function:

def test_SeqIO_QualityIO.TestFastqErrors.check_general_passes (   self,
  filename,
  record_count 
)

Definition at line 152 of file test_SeqIO_QualityIO.py.

00152 
00153     def check_general_passes(self, filename, record_count):
00154         handle = open(filename, "rU")
00155         tuples = QualityIO.FastqGeneralIterator(handle)
00156         #This "raw" parser doesn't check the ASCII characters which means
00157         #certain invalid FASTQ files will get parsed without errors.
00158         count = 0
00159         for title, seq, qual in tuples:
00160             self.assertEqual(len(seq), len(qual))
00161             count += 1
00162         self.assertEqual(count, record_count)
00163         handle.close()

Here is the call graph for this function:

Here is the caller graph for this function:

def test_SeqIO_QualityIO.TestFastqErrors.check_qual_char (   self,
  filename,
  good_count,
  count 
)

Definition at line 168 of file test_SeqIO_QualityIO.py.

00168 
00169     def check_qual_char(self, filename, good_count, count):
00170         self.check_fails(filename, good_count)
00171         self.check_general_passes(filename, count)
00172 
00173 #Now add methods at run time... these FASTQ files will be rejected
#by both the low level parser AND the high level SeqRecord parser:

Here is the call graph for this function:


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