Back to index

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

List of all members.

Public Member Functions

def simple_check

Detailed Description

Tests where we have reference output.

Definition at line 269 of file test_SeqIO_QualityIO.py.


Member Function Documentation

def test_SeqIO_QualityIO.TestReferenceFastqConversions.simple_check (   self,
  base_name,
  in_variant 
)

Definition at line 271 of file test_SeqIO_QualityIO.py.

00271 
00272     def simple_check(self, base_name, in_variant):
00273         for out_variant in ["sanger", "solexa", "illumina"]:
00274             if out_variant != "sanger":
00275                 #Ignore data loss warnings from max qualities
00276                 warnings.simplefilter('ignore', BiopythonWarning)
00277             in_filename = "Quality/%s_original_%s.fastq" \
00278                           % (base_name, in_variant)
00279             self.assertTrue(os.path.isfile(in_filename))
00280             #Load the reference output...  
00281             expected = open("Quality/%s_as_%s.fastq" \
00282                             % (base_name, out_variant),
00283                             "rU").read()
00284             #Check matches using convert...
00285             handle = StringIO()
00286             SeqIO.convert(in_filename, "fastq-"+in_variant,
00287                           handle, "fastq-"+out_variant)
00288             self.assertEqual(expected, handle.getvalue())
00289             #Check matches using parse/write
00290             handle = StringIO()
00291             SeqIO.write(SeqIO.parse(open(in_filename), "fastq-"+in_variant),
00292                         handle, "fastq-"+out_variant)
00293             self.assertEqual(expected, handle.getvalue())
00294             if out_variant != "sanger":
00295                 warnings.filters.pop()
00296 
#Now add methods at run time...

Here is the call graph for this function:


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