Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_Phd.PhdTestSolexa Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_check_SeqIO

Public Attributes

 handle

Detailed Description

Definition at line 288 of file test_Phd.py.


Member Function Documentation

Definition at line 289 of file test_Phd.py.

00289 
00290     def setUp(self):
00291         self.handle = open("Phd/phd_solexa")

Definition at line 292 of file test_Phd.py.

00292 
00293     def tearDown(self):
00294         self.handle.close()

Test phd2 using parser via SeqIO.

Definition at line 295 of file test_Phd.py.

00295 
00296     def test_check_SeqIO(self):
00297         """Test phd2 using parser via SeqIO."""
00298         records = SeqIO.parse(self.handle, "phd")
00299         #Contig 1
00300         record = records.next()
00301         self.assertEqual(record.id, "HWI-EAS94_4_1_1_537_446")
00302         self.assertEqual(record.name, "HWI-EAS94_4_1_1_537_446")
00303         self.assertEqual(record.description, "HWI-EAS94_4_1_1_537_446 1")
00304         self.assertEqual(str(record.seq),
00305                          "gccaatcaggtttctctgcaagcccctttagcagctgagc")
00306         self.assertEqual(record.letter_annotations["phred_quality"],
00307                          [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
00308                           30, 30, 30, 30, 30, 30, 30, 30, 30, 28, 23,
00309                           30, 30, 30, 30, 30, 30, 28, 22, 8, 22, 7, 15,
00310                           15, 15, 10, 10, 11, 15])
00311         self.assertEqual(record.format("fasta"),
00312                          ">HWI-EAS94_4_1_1_537_446 1\n"
00313                          "gccaatcaggtttctctgcaagcccctttagcagctgagc\n")
00314         self.assertEqual(record.format("qual"),
00315                          ">HWI-EAS94_4_1_1_537_446 1\n"
00316                          "30 30 30 30 30 30 30 30 30 30 "
00317                          "30 30 30 30 30 30 30 30 30 30\n"
00318                          "28 23 30 30 30 30 30 30 28 22 "
00319                          "8 22 7 15 15 15 10 10 11 15\n")
00320         self.assertEqual(record.format("fastq"),
00321                          "@HWI-EAS94_4_1_1_537_446 1\n"
00322                          "gccaatcaggtttctctgcaagcccctttagcagctgagc\n"
00323                          "+\n"
00324                          "????????????????????=8??????=7)7(000++,0\n")
00325         self.assertEqual(record.format("fastq-illumina"),
00326                          "@HWI-EAS94_4_1_1_537_446 1\n"
00327                          "gccaatcaggtttctctgcaagcccctttagcagctgagc\n"
00328                          "+\n"
00329                          "^^^^^^^^^^^^^^^^^^^^\\W^^^^^^\\VHVGOOOJJKO\n")
00330         #Contig 2
00331         record = records.next()
00332         self.assertEqual(record.id, "HWI-EAS94_4_1_1_602_99")
00333         self.assertEqual(record.name, "HWI-EAS94_4_1_1_602_99")
00334         self.assertEqual(record.description, "HWI-EAS94_4_1_1_602_99 1")
00335         self.assertEqual(str(record.seq),
00336                          "gccatggcacatatatgaaggtcagaggacaacttgctgt")
00337         self.assertEqual(record.letter_annotations["phred_quality"],
00338                          [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
00339                           30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
00340                           30, 30, 16, 30, 28, 22, 22, 22, 14, 15, 15, 5,
00341                           10, 15, 10, 5])
00342         self.assertEqual(record.format("fasta"),
00343                          ">HWI-EAS94_4_1_1_602_99 1\n"
00344                          "gccatggcacatatatgaaggtcagaggacaacttgctgt\n")
00345         self.assertEqual(record.format("qual"),
00346                          ">HWI-EAS94_4_1_1_602_99 1\n"
00347                          "30 30 30 30 30 30 30 30 30 30 "
00348                          "30 30 30 30 30 30 30 30 30 30\n"
00349                          "30 30 30 30 30 30 16 30 28 22 "
00350                          "22 22 14 15 15 5 10 15 10 5\n")
00351         self.assertEqual(record.format("fastq"),
00352                          "@HWI-EAS94_4_1_1_602_99 1\n"
00353                          "gccatggcacatatatgaaggtcagaggacaacttgctgt\n"
00354                          "+\n"
00355                          "??????????????????????????1?=777/00&+0+&\n")
00356         self.assertEqual(record.format("fastq-illumina"),
00357                          "@HWI-EAS94_4_1_1_602_99 1\n"
00358                          "gccatggcacatatatgaaggtcagaggacaacttgctgt\n"
00359                          "+\n"
00360                          "^^^^^^^^^^^^^^^^^^^^^^^^^^P^\\VVVNOOEJOJE\n")
00361         # Make sure that no further records are found
00362         self.assertRaises(StopIteration, records.next)        


Member Data Documentation

Definition at line 290 of file test_Phd.py.


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